Search in sources :

Example 1 with HelloWorld

use of org.openj9.test.util.HelloWorld in project openj9 by eclipse.

the class TestJmap method setupSuite.

@BeforeSuite
protected void setupSuite() {
    getJdkUtilityPath(JMAP_COMMAND);
    myId = TargetManager.getVmId();
    // $NON-NLS-1$
    assertNotNull(myId, "Attach ID missing");
    log(myId);
    /* make test objects */
    hws = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
        hws.add(new HelloWorld());
    }
    // $NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
    objectArray = new String[][] { { "a", "b" }, { "c", "d" } };
    objectVector = new Integer[] { Integer.valueOf(10), Integer.valueOf(20) };
    primitiveArray = new int[][] { { 1, 2 }, { 3, 4 } };
    primitiveVector = new long[] { 5, 6 };
    expectedClasses = new String[] { HELLOWORLD_CLASSNAME, primitiveArray.getClass().getName(), primitiveVector.getClass().getName(), objectArray.getClass().getName(), objectVector.getClass().getName() };
}
Also used : HelloWorld(org.openj9.test.util.HelloWorld) BeforeSuite(org.testng.annotations.BeforeSuite)

Example 2 with HelloWorld

use of org.openj9.test.util.HelloWorld in project openj9 by eclipse.

the class TestJmap method preserveHelloWorld.

@AfterTest
private void preserveHelloWorld() {
    /* force the objects to stay alive */
    for (HelloWorld instance : hws) {
        log(instance.getClass().getName());
    }
    log(Integer.toString(objectArray.hashCode()));
    log(Integer.toString(objectVector.hashCode()));
    log(Integer.toString(primitiveArray.hashCode()));
    log(Integer.toString(primitiveVector.hashCode()));
}
Also used : HelloWorld(org.openj9.test.util.HelloWorld) AfterTest(org.testng.annotations.AfterTest)

Aggregations

HelloWorld (org.openj9.test.util.HelloWorld)2 AfterTest (org.testng.annotations.AfterTest)1 BeforeSuite (org.testng.annotations.BeforeSuite)1