public class CacheManagerMBeanTest extends MBeanTest
CacheManagerMBean
.Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
ALL_ATTRIBUTES |
private static int |
DEFAULT_CONTAINER_CACHE_SIZE |
private static int |
DEFAULT_PAGE_CACHE_SIZE |
private static int |
DEFAULT_STATEMENT_CACHE_SIZE |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
CacheManagerMBeanTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private javax.management.ObjectName |
createObjectName(java.lang.String cacheName,
java.lang.String dbName)
Create an
ObjectName that identifies a CacheManager
management bean, or a pattern that potentially matches multiple
beans. |
protected void |
setUp()
Setup code to be run before each test fixture.
|
static junit.framework.Test |
suite() |
void |
testAllMBeansStartedAndStopped()
Test case that verifies that
CacheManagerMBean s start when
a database is started, and stop when the database is shut down. |
void |
testContainerCache()
Test the
CacheManagerMBean for the page cache. |
void |
testPageCache()
Test the
CacheManagerMBean for the page cache. |
void |
testStatementCache()
Test the
CacheManagerMBean for the statement cache. |
private void |
vetException(javax.management.RuntimeMBeanException e,
java.security.Permission perm)
Check that an exception raised when accessing an MBean, is caused
by missing a specific permission.
|
void |
withoutPermsTest()
Test that the CacheManagerMBean cannot be accessed if the code
base lacks SystemPermission("engine", "monitor").
|
void |
withPermsTest()
Test that the CacheManagerMBean can be accessed if the code base
runs with the same permissions as the
withoutPermsTest() test
case plus SystemPermission("engine", "monitor"). |
assertBooleanAttribute, assertIntAttribute, assertLongAttribute, assertStringAttribute, checkBooleanAttributeValue, checkIntAttributeValue, checkLongAttributeValue, checkStringAttributeValue, enableManagement, getApplicationManagementMBean, getAttribute, getCommandLineProperties, getDerbyDomainMBeans, getDerbyMBeanName, getMBeanServerConnection, getMBeanServerConnection, invokeOperation, invokeOperation, isPlatformJMXClient, queryMBeans, setAttribute, 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 int DEFAULT_PAGE_CACHE_SIZE
private static final int DEFAULT_CONTAINER_CACHE_SIZE
private static final int DEFAULT_STATEMENT_CACHE_SIZE
private static java.lang.String[] ALL_ATTRIBUTES
public static junit.framework.Test suite()
protected void setUp() throws java.lang.Exception
MBeanTest
private javax.management.ObjectName createObjectName(java.lang.String cacheName, java.lang.String dbName) throws java.lang.Exception
ObjectName
that identifies a CacheManager
management bean, or a pattern that potentially matches multiple
beans.cacheName
- the name of the cache (such as PageCache), or
null
to create a pattern that matches all cache namesdbName
- the name of the database, or null
to create
a pattern that matches all database namesObjectName
suitable for looking up beansjava.lang.Exception
public void testAllMBeansStartedAndStopped() throws java.lang.Exception
CacheManagerMBean
s start when
a database is started, and stop when the database is shut down.java.lang.Exception
public void testPageCache() throws java.lang.Exception
CacheManagerMBean
for the page cache.java.lang.Exception
public void testContainerCache() throws java.lang.Exception
CacheManagerMBean
for the page cache.java.lang.Exception
public void testStatementCache() throws java.lang.Exception
CacheManagerMBean
for the statement cache.java.lang.Exception
public void withoutPermsTest() throws java.lang.Exception
java.lang.Exception
private void vetException(javax.management.RuntimeMBeanException e, java.security.Permission perm)
e
- the exception to checkperm
- the missing permission to check forpublic void withPermsTest() throws java.lang.Exception
withoutPermsTest()
test
case plus SystemPermission("engine", "monitor").java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.