/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package amxtest;
//import org.glassfish.admin.amx.j2ee.*;
/**
These tests are designed to exercise the AMXProxyHandler code.
*/
//@Test(groups={"amx"}, description="AMXProxy tests", sequential=false, threadPoolSize=5)
@Test(
groups =
{
"amx"
},
description = "test the functionality of AMX dymamic proxy eg AMXProxy"
)
{
public AMXProxyTests()
{
}
{
return JMXUtil.getAttributeName(m);
}
{
}
{
assert objectName != null;
//assert extra.mbeanServerConnection() == getMBeanServerConnection();
if ( extra.globalSingleton() )
{
}
{
if ( JMXUtil.isIsOrGetter(m) )
{
{
}
try
{
}
catch( final Exception e )
{
e.printStackTrace();
}
}
}
{
// see whether the interface is missing any getters
{
//println( clazz.getName() + " missing getters attributes: " + missing );
}
}
return problems;
}
@Test
public void testDomainRoot()
{
// sanity check: see that the various attributes are reachable through its proxy
assert dr.getAMXReady();
}
@Test
public void testExt()
{
}
@Test
public void testQuery()
{
}
@Test
public void testBulkAccess()
{
}
@Test
public void testTools()
{
}
@Test
public void testMonitoringRoot()
{
}
@Test
public void testRuntimeRoot()
{
}
@Test
public void testServerRuntime()
{
{
}
}
@Test
public void testSystemInfo()
{
}
@Test
public void testLogging()
{
}
@Test
public void testPathnames()
{
}
@Test
public void testDomainConfig()
{
}
@Test
public void testApplications()
{
}
@Test
public void testResources()
{
}
@Test
public void testConfigs()
{
}
@Test
public void testSystemApplications()
{
}
@Test
public void testServers()
{
}
/** test all MBeans that contain Property */
@Test
public void testPropertyParent()
{
{
}
}
/** test all MBeans that contain SystemProperty */
@Test
public void testSystemPropertyParent()
{
final Set<AMXProxy> parentsWithProperty = findAllContainingType( Util.deduceType(SystemProperty.class) );
{
}
}
/** test all MBeans generically */
@Test
public void testForBogusAnnotations()
{
{
{
"Can't have both @ManagedAttribute and @ManagedOperation: " + desc;
{
assert numArgs == 0 :
"@ChildGetter cannot be applied to method with arguments: " + desc;
"@ManagedAttribute/@ManagedOperation not applicable with @ChildGetter: " + desc;
}
{
// operations that mimic getters are bad. We can't prevent all such things
// but we can object to such oddball usage in an AMX interface
{
assert false : "testForBogusAnnotations: @ManagedOperation should be @ManagedAttribute: " + desc;
}
}
}
}
}
@Test
public void testSystemStatus()
{
final List<UnprocessedConfigChange> changes = SystemStatus.Helper.toUnprocessedConfigChange( ss.getRestartRequiredChanges() );
{
}
}
@Test
public void testAutoConvert()
{
// make sure there is a required change so the change list will be non-empty
final JavaConfig jc = getDomainConfig().getConfigs().getConfig().get("server-config").getJavaConfig();
assert jvmOptions != null;
{
{
//System.out.println( "CHANGING OPTION " + option );
jvmOptions[i] = "-Xmx999m";
jvmOptions[i] = option;
// we should now have two changes in the list
break;
}
}
final List<UnprocessedConfigChange> changes = SystemStatus.Helper.toUnprocessedConfigChange( systemStatus.getRestartRequiredChanges() );
{
// System.out.println( "" + change );
}
}
/** test all MBeans generically */
@Test
public void testAllGenerically()
{
{
try
{
}
catch( final Throwable t )
{
}
}
{
assert false : "" + problems;
}
}
@Test
public void testSingletonOrNot()
{
try
{
}
catch( final Exception e )
{
assert false : e;
}
try
{
assert false : "expecting failure";
}
catch( final Exception e )
{
// good
}
}
/**
has children of type Property ("property").
*/
{
@ChildGetter // type should be derived from method name
}
{
// we assume there are always properties on Domain
//System.out.println( "Testing properties on: " + amx.objectName() + " = " + numProps);
}
@Test
public void testChildGetterVariants()
{
{
_testChildGetter( amx );
}
}
@Test
{
if ( haveJSR77() )
{
}
}
}