Skip to content

Commit

Permalink
fixed as to the review comment
Browse files Browse the repository at this point in the history
Signed-off-by: sophiaxu0424 <[email protected]>
  • Loading branch information
sophiaxu0424 committed Apr 11, 2024
1 parent 1e5ed79 commit 081f198
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
11 changes: 7 additions & 4 deletions functional/MockitoTests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ There are two OpenJ9 user issues where a crash with Mockito is reported:
- More Testcases would be added later as required

# This Mockito test cases will help identify the above crashes in our builds.
Test case 1: test.java.MainTest.java
Test case 2: test.java.SegmentationErrorDemo
Test case added: test.java.MockitoMockTest

# Next test case to be added
Test case: test.java.MockitoJunitTest(TBD)

# Dependencies Required:
- mockito-core
- junit-platform-console-standalone
- junit-jupiter-api
- byte-buddy
- byte-buddy-agent
- objenesis
4 changes: 1 addition & 3 deletions 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,junit_jupiter_api,junit_platform_console_standalone" />
<property name="LIB" value="byte_buddy,byte_buddy_agent,objenesis,mockito_core" />
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>

<!-- set global properties for this build -->
Expand All @@ -45,8 +45,6 @@ limitations under the License.
<src path="${src}" />
<classpath>
<pathelement location="${LIB_DIR}/mockito-core.jar"/>
<pathelement location="${LIB_DIR}/junit-jupiter-api.jar"/>
<pathelement location="${LIB_DIR}/junit-platform-console-standalone.jar"/>
</classpath>
</javac>
</target>
Expand Down
10 changes: 3 additions & 7 deletions functional/MockitoTests/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../TKG/resources/playlist.xsd">
<test>
<testCaseName>MockitoTests_SegmentationErrorTest</testCaseName>
<testCaseName>MockitoMockTest</testCaseName>
<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$(Q) test.java.Segmentation ; \
$(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$(Q) test.java.MockitoMockTest ; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
Expand All @@ -26,11 +26,7 @@
<group>functional</group>
</groups>
<versions>
<version>17+</version>
<version>11+</version>
</versions>
<impls>
<impl>openj9</impl>
</impls>
</test>

</playlist>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import java.util.ArrayList;
import org.mockito.Mockito;

public class Segmentation {
public class MockitoMockTest {
public static void main(String[] args) {
System.out.println("This is to trigger a SegmentationError!");
System.out.println("Call Mockito.mock(ArrayList.class)");
Mockito.mock(ArrayList.class);
}

}

}

0 comments on commit 081f198

Please sign in to comment.