Skip to content

Add metadata for Mockito 4.8.1 #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions metadata/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@
"directory": "org.testcontainers/testcontainers",
"module": "org.testcontainers:testcontainers"
},
{
"directory": "org.mockito/mockito-core",
"module": "org.mockito:mockito-core"
},
{
"directory": "org.eclipse.jetty/jetty-client",
"module": "org.eclipse.jetty:jetty-client"
Expand Down
4 changes: 4 additions & 0 deletions metadata/org.mockito/mockito-core/4.8.1/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"reflect-config.json",
"resource-config.json"
]
201 changes: 201 additions & 0 deletions metadata/org.mockito/mockito-core/4.8.1/reflect-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
[
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.Java9PlusLocationImpl$MetadataShim"
},
"name": "java.lang.Object",
"methods": [
{
"name": "toString",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.Java9PlusLocationImpl"
},
"name": "java.lang.StackWalker",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.util.Set",
"int"
]
},
{
"name": "walk",
"parameterTypes": [
"java.util.function.Function"
]
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.LocationFactory"
},
"name": "java.lang.StackWalker"
},
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.Java9PlusLocationImpl"
},
"name": "java.lang.StackWalker$Option"
},
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.Java9PlusLocationImpl"
},
"name": "java.lang.StackWalker$StackFrame"
},
{
"condition": {
"typeReachable": "org.mockito.internal.debugging.Java9PlusLocationImpl$MetadataShim"
},
"name": "java.lang.StackWalker$StackFrame",
"methods": [
{
"name": "getClassName",
"parameterTypes": []
},
{
"name": "getFileName",
"parameterTypes": []
},
{
"name": "getLineNumber",
"parameterTypes": []
},
{
"name": "getMethodName",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.creation.proxy.InvokeDefaultProxy"
},
"name": "java.lang.reflect.InvocationHandler",
"methods": [
{
"name": "invokeDefault",
"parameterTypes": [
"java.lang.Object",
"java.lang.reflect.Method",
"java.lang.Object[]"
]
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.util.KotlinInlineClassUtil"
},
"name": "kotlin.jvm.JvmInline"
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.ClassPathLoader"
},
"name": "org.mockito.configuration.MockitoConfiguration"
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.configuration.DefaultDoNotMockEnforcer",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.configuration.InjectingAnnotationEngine",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.configuration.plugins.DefaultPluginSwitch",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.creation.instance.DefaultInstantiatorProvider",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.PluginInitializer"
},
"name": "org.mockito.internal.creation.proxy.ProxyMockMaker",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleanerProvider",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.util.ConsoleMockitoLogger",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.DefaultMockitoPlugins"
},
"name": "org.mockito.internal.util.reflection.ReflectionMemberAccessor",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
]
13 changes: 13 additions & 0 deletions metadata/org.mockito/mockito-core/4.8.1/resource-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"resources": {
"includes": [
{
"condition": {
"typeReachable": "org.mockito.internal.configuration.plugins.PluginInitializer"
},
"pattern": "\\Qmockito-extensions/org.mockito.plugins.MockMaker\\E"
}
]
},
"bundles": []
}
10 changes: 10 additions & 0 deletions metadata/org.mockito/mockito-core/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"latest": true,
"metadata-version": "4.8.1",
"module": "org.mockito:mockito-core",
"tested-versions": [
"4.8.1"
]
}
]
11 changes: 11 additions & 0 deletions tests/src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,17 @@
}
]
},
{
"test-project-path": "org.mockito/mockito-core/4.8.1",
"libraries": [
{
"name": "org.mockito:mockito-core",
"versions": [
"4.8.1"
]
}
]
},
{
"test-project-path": "org.eclipse.jetty/jetty-client/11.0.12",
"libraries": [
Expand Down
4 changes: 4 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gradlew.bat
gradlew
gradle/
build/
6 changes: 6 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Mockito

Mockito works in GraalVM when using the `org.mockito.internal.creation.proxy.ProxyMockMaker`, which uses JDK proxies
to mock interfaces, and interfaces only.

Metadata has been collected by using the agent.
33 changes: 33 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright and related rights waived via CC0
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/

plugins {
id "org.graalvm.internal.tck"
}

String libraryVersion = tck.testedLibraryVersion.get()

dependencies {
testImplementation "org.mockito:mockito-core:$libraryVersion"
testImplementation 'org.assertj:assertj-core:3.22.0'
}

graalvmNative {
agent {
defaultMode = "conditional"
modes {
conditional {
userCodeFilterPath = "user-code-filter.json"
}
}
metadataCopy {
mergeWithExisting = true
inputTaskNames.add("test")
outputDirectories.add("src/test/resources/META-INF/native-image/org.mockito/mockito-core")
}
}
}
2 changes: 2 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
library.version=4.8.1
metadata.dir=org.mockito/mockito-core/4.8.1
20 changes: 20 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright and related rights waived via CC0
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/

pluginManagement {
def tckPath = Objects.requireNonNullElse(
System.getenv("GVM_TCK_TCKDIR"),
"../../../../tck-build-logic"
)
includeBuild(tckPath)
}

plugins {
id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT"
}

rootProject.name = 'org.mockito.mockito-core_tests'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright and related rights waived via CC0
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
package org_mockito.mockito_core;

import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;

class MockitoTest {
@Test
void test() {
MyService myService = Mockito.mock(MyService.class);
Mockito.when(myService.getGreeting()).thenReturn("Hello Mockito");
assertThat(myService.getGreeting()).isEqualTo("Hello Mockito");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright and related rights waived via CC0
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
package org_mockito.mockito_core;

public interface MyService {
String getGreeting();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"interfaces": [
"org_mockito.mockito_core.MyService"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.mockito.internal.creation.proxy.ProxyMockMaker
10 changes: 10 additions & 0 deletions tests/src/org.mockito/mockito-core/4.8.1/user-code-filter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"rules": [
{
"excludeClasses": "**"
},
{
"includeClasses": "org.mockito.**"
}
]
}