コード例 #1
0
 @Test
 public void testAddUsageListenerViaProperties() throws Exception {
   BrooklynProperties brooklynProperties = BrooklynProperties.Factory.newEmpty();
   brooklynProperties.put(
       UsageManager.USAGE_LISTENERS, RecordingStaticUsageListener.class.getName());
   mgmt = LocalManagementContextForTests.newInstance(brooklynProperties);
   assertUsageListenerCalledWhenApplicationStarted();
 }
コード例 #2
0
 @Test(expectedExceptions = ClassCastException.class)
 public void testErrorWhenConfiguredClassIsNotAUsageListener() {
   BrooklynProperties brooklynProperties = BrooklynProperties.Factory.newEmpty();
   brooklynProperties.put(UsageManager.USAGE_LISTENERS, Integer.class.getName());
   mgmt = LocalManagementContextForTests.newInstance(brooklynProperties);
 }
コード例 #3
0
 @Override
 protected LocalManagementContext newTestManagementContext() {
   // Don't need OSGi
   return LocalManagementContextForTests.newInstance();
 }