public class ManagementMBeanTest extends MBeanTest
Test the ManagementMBean interface provided by Derby which has two implementations. A built in one and one that can be created by a user.
If you set the debug flag (-Dderby.tests.debug=true), then the test will print out the number of MBeans which it finds. This should be EXPECTED_BEAN_COUNT but could be something greater if MBeans are left hanging around from other tests.
Modifier and Type | Class and Description |
---|---|
private static class |
ManagementMBeanTest.StatsTuple |
Modifier and Type | Field and Description |
---|---|
private static int |
EXPECTED_BEAN_COUNT |
private static java.lang.String |
MANAGEMENT |
private static java.lang.String[] |
MBEAN_TYPES |
private static java.lang.String |
VERSION |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
ManagementMBeanTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
compareStats(ManagementMBeanTest.StatsTuple expected,
ManagementMBeanTest.StatsTuple actual)
Verify that the mbean information is what we expect.
|
private int[] |
countMBeanTypes(java.util.Set<javax.management.ObjectName> names)
Count the number of MBeans per type.
|
private ManagementMBeanTest.StatsTuple |
getCurrentStats(java.lang.String tag)
Get information on the current MBeans.
|
private void |
startStopManagement(javax.management.ObjectName mbean)
Test that the MBean with the passed in name can
successfully start and stop Derby's JMX management.
|
static junit.framework.Test |
suite() |
void |
testStartStopManagementFromApplication()
Test that the MBean created by the application can
successfully start and stop Derby's JMX management.
|
assertBooleanAttribute, assertIntAttribute, assertLongAttribute, assertStringAttribute, checkBooleanAttributeValue, checkIntAttributeValue, checkLongAttributeValue, checkStringAttributeValue, enableManagement, getApplicationManagementMBean, getAttribute, getCommandLineProperties, getDerbyDomainMBeans, getDerbyMBeanName, getMBeanServerConnection, getMBeanServerConnection, invokeOperation, invokeOperation, isPlatformJMXClient, queryMBeans, setAttribute, setUp, suite, 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 static final java.lang.String MANAGEMENT
private static final java.lang.String VERSION
private static final int EXPECTED_BEAN_COUNT
private static final java.lang.String[] MBEAN_TYPES
public static junit.framework.Test suite()
public void testStartStopManagementFromApplication() throws java.lang.Exception
java.lang.Exception
private void startStopManagement(javax.management.ObjectName mbean) throws java.lang.Exception
java.lang.Exception
private ManagementMBeanTest.StatsTuple getCurrentStats(java.lang.String tag) throws java.lang.Exception
java.lang.Exception
private void compareStats(ManagementMBeanTest.StatsTuple expected, ManagementMBeanTest.StatsTuple actual) throws java.lang.Exception
java.lang.Exception
private int[] countMBeanTypes(java.util.Set<javax.management.ObjectName> names) throws java.lang.Exception
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.