Search in sources :

Example 1 with JVM

use of com.sun.appserv.management.j2ee.JVM in project Payara by payara.

the class J2EETest method testJVMs.

public void testJVMs() {
    final QueryMgr queryMgr = getQueryMgr();
    final Set jvms = queryMgr.queryJ2EETypeSet(J2EETypes.JVM);
    final Iterator iter = jvms.iterator();
    String lastVendor = null;
    String lastVersion = null;
    while (iter.hasNext()) {
        final JVM jvm = (JVM) iter.next();
        // the ObjectName of the Node must match the String version for "node"
        assert (jvm.getnode() != null);
        // the JVMs should all have the same vendor (presumably)
        assert (jvm.getjavaVendor() != null);
        if (lastVendor == null) {
            lastVendor = jvm.getjavaVendor();
        } else {
            assert (lastVendor.equals(jvm.getjavaVendor()));
        }
        // the JVMs should all have the same version (presumably)
        assert (jvm.getjavaVersion() != null);
        if (lastVersion == null) {
            lastVersion = jvm.getjavaVersion();
        } else {
            assert (lastVersion.equals(jvm.getjavaVersion()));
        }
    }
}
Also used : QueryMgr(com.sun.appserv.management.base.QueryMgr) JVM(com.sun.appserv.management.j2ee.JVM) HashSet(java.util.HashSet) Set(java.util.Set) Iterator(java.util.Iterator)

Aggregations

QueryMgr (com.sun.appserv.management.base.QueryMgr)1 JVM (com.sun.appserv.management.j2ee.JVM)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1