abstract class MBeanTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private javax.management.MBeanServerConnection |
jmxConnection
JMX connection to use throughout the instance.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
MBeanTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertBooleanAttribute(boolean expected,
javax.management.ObjectName objName,
java.lang.String name) |
protected void |
assertIntAttribute(int expected,
javax.management.ObjectName objName,
java.lang.String name) |
protected void |
assertLongAttribute(int expected,
javax.management.ObjectName objName,
java.lang.String name) |
protected void |
assertStringAttribute(java.lang.String expected,
javax.management.ObjectName objName,
java.lang.String name) |
protected void |
checkBooleanAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
Checks the readability and type of an attribute value that is supposed
to be a boolean.
|
protected void |
checkIntAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
Checks the readability and type of an attribute value that is supposed
to be an int.
|
protected void |
checkLongAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
Checks the readability and type of an attribute value that is supposed
to be a long.
|
protected void |
checkStringAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
Checks the readability and type of an attribute value that is supposed
to be a String.
|
protected void |
enableManagement()
Enables Derby's MBeans in the MBeanServer by accessing Derby's
ManagementMBean.
|
protected javax.management.ObjectName |
getApplicationManagementMBean()
Get the ObjectName for the application
created ManagementMBean.
|
protected java.lang.Object |
getAttribute(javax.management.ObjectName objName,
java.lang.String name)
Gets the value of a given attribute that is exposed by the MBean
represented by the given object name.
|
protected static java.lang.String[] |
getCommandLineProperties(boolean authentication)
Returns a set of startup properties suitable for VersionMBeanTest.
|
protected java.util.Set<javax.management.ObjectName> |
getDerbyDomainMBeans()
Get all MBeans registered in Derby's domain.
|
protected javax.management.ObjectName |
getDerbyMBeanName(java.util.Hashtable<java.lang.String,java.lang.String> keyProperties)
Get the ObjectName for an MBean registered by Derby for a set of
key properties.
|
protected javax.management.MBeanServerConnection |
getMBeanServerConnection()
Obtains a connection to an MBean server with
no user name or password,
opens a single connection for the lifetime
of the fixture
|
protected javax.management.MBeanServerConnection |
getMBeanServerConnection(java.lang.String user,
java.lang.String password)
Obtains a connection to an MBean server with
a user name or password.
|
protected java.lang.Object |
invokeOperation(javax.management.ObjectName objName,
java.lang.String name)
Invokes an operation with no arguments.
|
protected java.lang.Object |
invokeOperation(javax.management.ObjectName objName,
java.lang.String name,
java.lang.Object[] params,
java.lang.String[] sign)
Invokes an operation with arguments.
|
protected boolean |
isPlatformJMXClient()
Is the JMX connecting using platform JMX.
|
protected void |
setUp()
Setup code to be run before each test fixture.
|
protected static junit.framework.Test |
suite(java.lang.Class<? extends MBeanTest> testClass,
java.lang.String suiteName) |
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringprivate javax.management.MBeanServerConnection jmxConnection
protected static junit.framework.Test suite(java.lang.Class<? extends MBeanTest> testClass, java.lang.String suiteName)
protected static java.lang.String[] getCommandLineProperties(boolean authentication)
protected void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exception - if an unexpected Exception occursprotected void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionprotected javax.management.MBeanServerConnection getMBeanServerConnection()
throws java.lang.Exception
java.lang.Exceptionprotected javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String user,
java.lang.String password)
throws java.lang.Exception
java.lang.Exceptionprotected boolean isPlatformJMXClient()
protected void enableManagement()
throws java.lang.Exception
java.lang.Exception - JMX-related exceptions if an unexpected error occurs.protected java.util.Set<javax.management.ObjectName> getDerbyDomainMBeans()
throws java.lang.Exception
java.lang.Exceptionprotected javax.management.ObjectName getApplicationManagementMBean()
throws java.lang.Exception
java.lang.Exceptionprotected javax.management.ObjectName getDerbyMBeanName(java.util.Hashtable<java.lang.String,java.lang.String> keyProperties)
throws java.lang.Exception
system will be set to the system identifier
for the Derby system under test (if Derby is running).keyProperties - Set of key properties, may be modified by this call.java.lang.Exceptionprotected java.lang.Object invokeOperation(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - MBean to operate onname - Operation name.null if there is no return value.java.lang.Exceptionprotected java.lang.Object invokeOperation(javax.management.ObjectName objName,
java.lang.String name,
java.lang.Object[] params,
java.lang.String[] sign)
throws java.lang.Exception
objName - MBean to operate onname - Operation name.params - An array containing the parameters to be set when the
operation is invoked.sign - An array containing the signature of the operation, i.e.
the types of the parameters.null if there is no return value.java.lang.Exceptionprotected java.lang.Object getAttribute(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - the object name defining a specific MBean instancename - the name of the attributejava.lang.Exception - if an unexpected error occursprotected void assertBooleanAttribute(boolean expected,
javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
java.lang.Exceptionprotected void assertIntAttribute(int expected,
javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
java.lang.Exceptionprotected void assertLongAttribute(int expected,
javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
java.lang.Exceptionprotected void assertStringAttribute(java.lang.String expected,
javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
java.lang.Exceptionprotected void checkBooleanAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - the object name representing the MBean instance from which
the attribute value will be retreivedname - the name of the attributejava.lang.Exception - if an unexpected error occursprotected void checkIntAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - the object name representing the MBean instance from which
the attribute value will be retreivedname - the name of the attributejava.lang.Exception - if an unexpected error occursprotected void checkLongAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - the object name representing the MBean instance from which
the attribute value will be retreivedname - the name of the attributejava.lang.Exception - if an unexpected error occursprotected void checkStringAttributeValue(javax.management.ObjectName objName,
java.lang.String name)
throws java.lang.Exception
objName - the object name representing the MBean instance from which
the attribute value will be retreivedname - the name of the attributejava.lang.Exception - if an unexpected error occursApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.