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.
|
(package private) java.util.Set<javax.management.ObjectName> |
queryMBeans(javax.management.ObjectName name)
Get all MBeans that match the specified name.
|
(package private) void |
setAttribute(javax.management.ObjectName objName,
java.lang.String name,
java.lang.Object value)
Set the value of an attribute via 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, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, 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, toString
private 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.TestCase
java.lang.Exception
- if an unexpected Exception occursprotected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
protected javax.management.MBeanServerConnection getMBeanServerConnection() throws java.lang.Exception
java.lang.Exception
protected javax.management.MBeanServerConnection getMBeanServerConnection(java.lang.String user, java.lang.String password) throws java.lang.Exception
java.lang.Exception
protected 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.Exception
java.util.Set<javax.management.ObjectName> queryMBeans(javax.management.ObjectName name) throws java.lang.Exception
name
- the name pattern to look forjava.lang.Exception
protected javax.management.ObjectName getApplicationManagementMBean() throws java.lang.Exception
java.lang.Exception
protected 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.Exception
protected 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.Exception
protected 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.Exception
void setAttribute(javax.management.ObjectName objName, java.lang.String name, java.lang.Object value) throws java.lang.Exception
objName
- the name of the object that has the attributename
- the name of the attributevalue
- the new value of the attributejava.lang.Exception
- if an error occurs when changing the attributeprotected 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.Exception
protected void assertIntAttribute(int expected, javax.management.ObjectName objName, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertLongAttribute(int expected, javax.management.ObjectName objName, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertStringAttribute(java.lang.String expected, javax.management.ObjectName objName, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected 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.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.