/*
* 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.
*/
/**
Base class for testing the AMX API
*/
public class AMXTestBase
extends JMXTestBase {
/**
config name for PE (non-EE) configuration
*/
private final static boolean WEB_MODULE_MONITOR_BROKEN = true;
private static boolean MONITORING_ENABLED = false;
public AMXTestBase() {
try {
}
catch (Exception e) {
throw new RuntimeException(e.toString(), e);
}
}
{
return all;
}
getAllAMX() {
return getTestUtil().getAllAMX();
}
protected ModuleMonitoringLevelsConfig
final ModuleMonitoringLevelsConfig mon =
return (mon);
}
protected ModuleMonitoringLevelsConfig
return getModuleMonitoringLevelsConfig(null);
}
{
{
}
try {
} catch ( Exception e ) {
// ignore
}
}
/**
Ensure that monitoring is enabled so that unit tests don't miss anything
*/
protected synchronized void
synchronized (AMXTestBase.class) {
}
}
}
protected void
MONITORING_ENABLED = false;
}
protected void
turnOnMonitoring() {
MONITORING_ENABLED = true;
}
protected boolean
if (isRemote &&
", has the implementation changed?");
}
return isRemote;
}
protected boolean
return (shouldTest);
}
protected void
throws IOException {
mySleep(100);
}
mySleep(100);
}
}
/**
Because proxies are cleaned up asynchronously, it's possible for one
to remain in the factory until the factory processes the Notification
that it's MBean has been unregistered.
*/
protected void
final ProxyFactory factory,
final ObjectName objectName) {
long millis = 1;
millis *= 2;
}
}
protected final void
if (isRemoteIncomplete(objectName)) {
} else {
}
}
protected final Set<ObjectName>
getNotTestedSet() {
return (mNotTested);
}
public static void
try {
}
catch (InterruptedException e) {
}
}
protected final void
warnNotTested() {
}
}
protected void
assert (getConnection() != null);
try {
}
catch (Exception e) {
fail("Connection failed:\n" +
}
}
protected void
checkConnection() {
}
protected TestUtil
getTestUtil() {
return mTestUtil;
}
protected final AMX
return (proxy);
}
/**
We don't have T extend AMX because not all mixin interfaces extend AMX.
*/
protected final <T> T
final ObjectName objectName,
}
protected final DomainRoot
getDomainRoot() {
return (mDomainRoot);
}
protected final DomainConfig
getDomainConfig() {
return (getDomainRoot().getDomainConfig());
}
protected final J2EEDomain
getJ2EEDomain() {
return (getDomainRoot().getJ2EEDomain());
}
protected String[]
getConfigNames() {
}
protected ConfigConfig
final Map<String, ConfigConfig> configs = getDomainConfig().getConfigsConfig().getConfigConfigMap();
}
protected static ConfigConfig
return any.getDomainRoot().getDomainConfig().getConfigsConfig().getConfigConfigMap().get(configName);
}
protected ConfigConfig
getConfigConfig() {
return (getConfigConfig(PE_CONFIG_NAME));
}
protected QueryMgr
getQueryMgr() {
assert (mDomainRoot != null);
return (proxy);
}
protected NotificationServiceMgr
return (getDomainRoot().getNotificationServiceMgr());
}
protected BulkAccess
getBulkAccess() {
return (getDomainRoot().getBulkAccess());
}
protected ConnectionSource
assert (mConnectionSource != null);
return (mConnectionSource);
}
protected MBeanServerConnection
getConnection() {
return (getGlobalMBeanServerConnection());
}
protected ProxyFactory
getProxyFactory() {
return (mProxyFactory);
}
protected Class
throws ClassNotFoundException {
}
protected <T extends AMX> boolean
final Collection<T> proxies,
throws Exception {
boolean failed = false;
int testCount = 0;
if (!shouldTest(objectName)) {
continue;
}
++testCount;
try {
}
catch (Exception e) {
failed = true;
}
}
return (!failed);
}
protected boolean
throws Exception {
boolean failed = false;
int testCount = 0;
if (!shouldTest(objectName)) {
continue;
}
++testCount;
try {
}
catch (Exception e) {
failed = true;
}
}
return (!failed);
}
protected void
final String methodName)
throws Exception {
assert (success);
}
protected <T extends AMX> void
final Collection<T> proxies,
final String methodName)
throws Exception {
assert (success);
}
protected void
throws Exception {
}
public void
setUp()
throws Exception {
super.setUp();
}
public void
testAssertsOn() {
}
protected static String
} else {
}
return name;
}
protected Throwable
return ExceptionUtil.getRootCause(t);
}
protected String
return ExceptionUtil.getStackTrace(t);
}
protected String
return getStackTrace(getRootCause(t));
}
getNodeAgents() {
return TypeCast.checkedMap(m,
String.class, AppserverConnectionSource.class);
}
protected String
}
protected NodeAgentConfig
}
return config;
}
protected boolean
getTestOffline() {
}
/**
Check if we're testing in Offline mode, which means that
Config MBeans are loaded in-process. If so, issue a warning.
@return true if test should be run, false if in offline mode
*/
protected boolean
boolean offline = getTestOffline();
if (offline) {
//warning( "amxtest.testOffline=true, skipping test " + testName + "()" );
}
return !offline;
}
public static Capabilities
return getOfflineCapableCapabilities(true);
}
protected static Capabilities
final Capabilities c = new Capabilities();
return c;
}
try {
}
catch (Exception e) {
assert false : "Can't get proxy to " + objectName;
}
return null;
}
protected boolean
return supportsMultipleServers(getDomainRoot());
}
public static boolean
}
protected boolean
supportsClusters() {
}
}