Methods Summary |
---|
private void | checkAMXWithObjectNames(java.lang.String msg, java.util.Set set1, java.util.Set set2)
if ( set1.size() != set2.size() )
{
failure( msg + "set sizes don't match: " + set1.size() + " != " + set2.size() );
}
final Set<ObjectName> set1ObjectNames = new HashSet<ObjectName>();
for( final AMX item : set1 )
{
final ObjectName objectName = Util.getObjectName( item );
if ( set1ObjectNames.contains( objectName ) )
{
failure( "set1 contains the same proxy twice with ObjectName: " + objectName );
}
set1ObjectNames.add( objectName );
}
checkSetsEqual( msg, set1ObjectNames, set2 );
|
private void | checkSetsEqual(java.lang.String msg, java.util.Set set1, java.util.Set set2)
if ( ! set1.equals( set2 ) )
{
final Set<T> conflict = GSetUtil.newNotCommonSet( set1, set2 );
final String values = CollectionUtil.toString( conflict, "\n" );
failure( msg + ", mismatch =\n" + values );
}
|
private java.util.Set | getAllInterfaceNames(java.util.Set amxSet)
final Set<String> interfaceNames = new HashSet<String>();
for( final T amx : amxSet )
{
interfaceNames.add( Util.getExtra( amx ).getInterfaceName() );
}
return( interfaceNames );
|
public static com.sun.enterprise.management.Capabilities | getCapabilities()
return getOfflineCapableCapabilities( true );
|
public void | testGetJ2EETypeObjectNames()
final long start = now();
final Set<String> j2eeTypes = getTestUtil().getAvailJ2EETypes();
for( final String j2eeType : j2eeTypes )
{
final Set<AMX> results =
getQueryMgr().queryJ2EETypeSet(j2eeType );
assert( results.size() >= 1 );
}
printElapsed( "testGetJ2EETypeObjectNames", start );
|
public void | testGetJ2EETypeProxies()
final long start = now();
final Set<String> j2eeTypes = getTestUtil().getAvailJ2EETypes();
for( final String j2eeType : j2eeTypes )
{
final Set<AMX> proxies =
getQueryMgr().queryJ2EETypeSet( j2eeType );
assert( proxies != null );
}
printElapsed( "testGetJ2EETypeProxies", start );
|
public void | testGetQueryMgr()
assert( getQueryMgr() != null );
|
public void | testQueryAll()
final long start = now();
final Set result = getQueryMgr().queryAllSet();
assert( result.size() > 1 );
printElapsed( "testQueryAll", start );
|
public void | testQueryAll_AMXMatchesObjectName()
final long start = now();
final Set<AMX> allSet = mQM.queryAllSet();
final Set<ObjectName> allObjectNameSet = mQM.queryAllObjectNameSet();
assert( allSet.size() == allObjectNameSet.size() );
checkAMXWithObjectNames(
"queryAllSet() != queryAllObjectNameSet()",
allSet, allObjectNameSet );
printElapsed( "testQueryAll_AMXMatchesObjectName", start );
|
public void | testQueryInterfaceObjectNames()Final all available interfaces, then for each type of interface, query
for all items that have the interface and verify that's the interface
they return from getInterfaceName().
final long start = now();
final QueryMgr queryMgr = getQueryMgr();
final Set<AMX> allAMX = getQueryMgr().queryAllSet();
final Set<ObjectName> allAMXObjectNames = Util.toObjectNames( allAMX );
final Set<String> interfaceNames = getAllInterfaceNames( allAMX );
for( final String interfaceName : interfaceNames )
{
final Set amxs = queryMgr.queryInterfaceSet( interfaceName, allAMXObjectNames );
final Iterator amxIter = amxs.iterator();
while ( amxIter.hasNext() )
{
final AMX amx = Util.asAMX(amxIter.next());
assert( interfaceName.equals( Util.getExtra( amx ).getInterfaceName() ) );
}
}
printElapsed( "testQueryInterfaceObjectNames", start );
|
public void | testQueryInterfacePvsON()
final long start = now();
final Set<AMX> candidates = mQM.queryAllSet();
final Set<ObjectName> candidateObjectNames = Util.toObjectNames( candidates );
final String interfaceName = DomainRoot.class.getName();
checkAMXWithObjectNames(
"queryInterfaceSet() != queryInterfaceObjectNameSet()",
mQM.queryInterfaceSet( interfaceName, candidateObjectNames ),
mQM.queryInterfaceObjectNameSet( interfaceName, candidateObjectNames ) );
printElapsed( "testQueryInterfacePvsON", start );
|
public void | testQueryJ2EENamePvsON()
final long start = now();
final String name = getDomainRoot().getName();
checkAMXWithObjectNames(
"queryJ2EENameSet() != queryJ2EENameObjectNameSet()",
mQM.queryJ2EENameSet( name ),
mQM.queryJ2EENameObjectNameSet( name ) );
printElapsed( "testQueryJ2EENamePvsON", start );
|
public void | testQueryJ2EETypePvsON()
final long start = now();
final String testType1 = XTypes.DOMAIN_CONFIG;
checkAMXWithObjectNames(
"queryJ2EETypeSet(XTypes.DOMAIN_CONFIG) != queryJ2EETypeObjectNameSet(XTypes.DOMAIN_CONFIG)",
mQM.queryJ2EETypeSet( testType1 ),
mQM.queryJ2EETypeObjectNameSet( testType1 ) );
printElapsed( "testQueryJ2EETypePvsON", start );
|
public void | testQueryJ2EETypesSet()
final long start = now();
final Set<ResourceConfig> resources = mQM.queryJ2EETypesSet( RESOURCE_TYPES );
final Set<ObjectName> resourcesObjectNames = mQM.queryJ2EETypesObjectNameSet( RESOURCE_TYPES );
assert( resourcesObjectNames.size() >= 1 ) : "testQueryJ2EETypesSet: no resources found for " + CollectionUtil.toString( RESOURCE_TYPES, ", ");
assert( resources.size() >= 1 ) : "testQueryJ2EETypesSet: no resource ObjectNames found!";;
checkAMXWithObjectNames(
"queryJ2EETypesSet(...) != queryJ2EETypesObjectNameSet(...)",
resources, resourcesObjectNames );
//println( resourcesObjectNames );
printElapsed( "testQueryJ2EETypesSet", start );
|
public void | testQueryPatternProxies()
final long start = now();
final Set proxies = getQueryMgr().queryPropsSet( "*" );
assert proxies != null;
printElapsed( "testQueryPatternProxies", start );
|
public void | testQueryPatternPvsON()
final long start = now();
final String domain = Util.getObjectName( mQM ).getDomain();
final ObjectName pat = JMXUtil.newObjectNamePattern( domain, "*" );
checkAMXWithObjectNames(
"queryPatternSet() != queryPatternObjectNameSet()",
mQM.queryPatternSet( pat ),
mQM.queryPatternObjectNameSet( pat ) );
checkAMXWithObjectNames(
"queryPatternSet() != queryPatternObjectNameSet()",
mQM.queryPatternSet( domain, "*" ),
mQM.queryPatternObjectNameSet( domain, "*" ) );
printElapsed( "testQueryPatternPvsON", start );
|
public void | testQueryPropsPvsON()
final long start = now();
final String domain = Util.getObjectName( mQM ).getDomain();
final String props = Util.makeRequiredProps( XTypes.DOMAIN_ROOT, domain );
checkAMXWithObjectNames(
"queryPropsSet() != queryPropsObjectNameSet()",
mQM.queryPropsSet( props ),
mQM.queryPropsObjectNameSet( props ) );
printElapsed( "testQueryPropsPvsON", start );
|
public void | testQueryWildPvsON()
final long start = now();
final String[] wildNames = new String[] { "*" };
final String[] wildValues = new String[] { "*" };
checkAMXWithObjectNames(
"queryWildSet() != queryWildObjectNameSet()",
mQM.queryWildSet( wildNames, wildValues ),
mQM.queryWildObjectNameSet( wildNames, wildValues ) );
printElapsed( "testQueryWildPvsON", start );
|