Skip to content

Commit

Permalink
added mockitoJunitTest case
Browse files Browse the repository at this point in the history
Signed-off-by: sophiaxu0424 <[email protected]>
  • Loading branch information
sophiaxu0424 committed May 16, 2024
1 parent 7aeed31 commit 1b089b0
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functional/MockitoTests/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
Mockito Tests
</description>
<import file="${TEST_ROOT}/functional/build.xml"/>
<property name="LIB" value="byte_buddy,byte_buddy_agent,objenesis,mockito_core" />
<property name="LIB" value="byte_buddy,byte_buddy_agent,objenesis,mockito_core,junit_jupiter_api" />
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>

<!-- set global properties for this build -->
Expand All @@ -45,6 +45,7 @@ limitations under the License.
<src path="${src}" />
<classpath>
<pathelement location="${LIB_DIR}/mockito-core.jar"/>
<pathelement location="${LIB_DIR}/junit-jupiter-api.jar"/>
</classpath>
</javac>
</target>
Expand Down
25 changes: 25 additions & 0 deletions functional/MockitoTests/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,29 @@
<version>11+</version>
</versions>
</test>
<test>
<testCaseName>MockitoJunitTest</testCaseName>
<disables>
<disable>
<comment>https://github.com/eclipse-openj9/openj9/issues/19331</comment>
<platform>.*zos.*</platform>
</disable>
<disable>
<comment>https://github.com/eclipse-openj9/openj9/issues/19354</comment>
<version>23+</version>
</disable>
</disables>
<command>
$(JAVA_COMMAND) $(JVM_OPTIONS) -cp $(Q)$(RESOURCES_DIR)$(P)$(TEST_RESROOT)$(D)MockitoTests.jar$(P)$(LIB_DIR)$(D)mockito-core.jar$(P)$(LIB_DIR)$(D)byte-buddy.jar$(P)$(LIB_DIR)$(D)byte-buddy-agent.jar$(P)$(LIB_DIR)$(D)objenesis.jar$(P)$(LIB_DIR)$(D)junit-jupiter-api.jar$(Q) test.java.MockitoJunitTest ; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
</levels>
<groups>
<group>functional</group>
</groups>
<versions>
<version>11+</version>
</versions>
</test>
</playlist>
33 changes: 33 additions & 0 deletions functional/MockitoTests/src/test/java/MockitoJunitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*******************************************************************************
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package test.java;

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

class MockitoJunitTest {

class Some {}

@Test
public void reproduceCrash() {
System.out.println("Call Mockito.mock(Some.class)");
Mockito.mock(Some.class);
}

public static void main(String[] args) {

}

}

0 comments on commit 1b089b0

Please sign in to comment.