org.globus.ogsa.impl.core.logging.test
Class TestOgsiLogging

java.lang.Object
  extended byTestCase
      extended byorg.globus.ogsa.server.test.GridTestCase
          extended byorg.globus.ogsa.impl.core.logging.test.TestOgsiLogging
All Implemented Interfaces:
NotificationSinkCallback, ServiceProperties

public class TestOgsiLogging
extends GridTestCase
implements NotificationSinkCallback

tests OgsiLogging

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.globus.ogsa.server.test.GridTestCase
TEST_SERVER
 
Fields inherited from interface org.globus.ogsa.ServiceProperties
ACTIVATE_ON_STARTUP, ACTIVATION, BASE_CLASS_NAME, BOOTSTRAP, CONFIG_PATH, CONTAINS_REFERENCE, CREATION_EXTENSIBILITY, CREATION_EXTENSIBILITY_OUTPUT, CUSTOM_EXTENSIBILITY_DESERIALIZER, CUSTOM_EXTENSIBILITY_SERIALIZER, CUSTOM_MAPPING_REGISTERED, DEACTIVATED_PERSISTENT, DEACTIVATED_STATE, DEACTIVATED_TRANSIENT, DEACTIVATION, DESTROY_LISTENER, DESTRUCTION_SKELETON, DISABLE_FACTORY_REGISTRY, ENDPOINT, ENTRY_INSTANCE_CREATION, FACTORY, FACTORY_CALLBACK, FACTORY_HANDLE, FACTORY_PROVIDER, FACTORY_REGISTRY, GSR_DESCRIPTION, HANDLE, HANDLE_PORT, HANDLE_PROTOCOL, INSTANCE_CLASS, INSTANCE_DEACTIVATION, INSTANCE_GSR_DESCRIPTION, INSTANCE_LIFECYCLE, INSTANCE_PORT_TYPE, INSTANCE_PORT_TYPE_NS, INSTANCE_PREFIX, INSTANCE_REGISTRY, INSTANCE_SCHEMA_PATH, INSTANCE_WSDL, INTERFACE_CLASS_NAME, INVOCATION_ID, LAZY_CREATION, LIFECYCLE, LIFECYCLE_MONITOR, LIFECYCLE_MONITOR_CLASS, NAME, NOTIFICATION_ENGINE, NOTIFICATION_FACTORY, NOTIFICATION_SOURCE, OPERATION_PROVIDERS, PERSISTENT, PERSISTENT_PROPERTIES, PORT, PORT_TYPE, PORT_TYPE_NS, PRIMARY_KEY, PROTOCOL, QUERY_ENGINE, REDIRECT_RESOLVER, REGISTRY, RESOLVER_CACHE, ROUTER_HEADER, ROUTER_VIA, SCHEMA_LOCATION, SCHEMA_PATH, SERVICE_ACTIVATOR, SERVICE_DATA, SERVICE_DEPLOYMENT, SERVICE_GROUP_ENTRY, SERVICE_GROUP_PROVIDER, SERVICE_LOADER, SERVICE_NODE, SERVICE_PATH, SINK_ID, STARTUP_STATE, SWEEP_SERVICE_DATA, TIMEOUT, TIMESTAMP, TRANSIENT, TYPE, USER, WEBSTART_PANEL_NAME, WEBSTART_URL, WSDL
 
Constructor Summary
TestOgsiLogging(java.lang.String name)
           
 
Method Summary
 void deliverNotification(ExtensibilityType message)
          implementation for the NotificationSinkCallback
 void flush()
          gives a hint that this property should be checkpointed to the deployment descriptor, it is however not guaranteed that the properties have been persisted when the method returns
 java.lang.Object getPersistentProperty(java.lang.String key)
          gets a persistent property (checkpointed to deployment descriptor) keyed by name
 java.lang.Object getProperty(java.lang.String key)
          gets a property keyed by name
 void setPersistentProperty(java.lang.String key, java.lang.Object val)
          sets a persistent property (checkpointed to deployment descriptor) keyed by name
 void setProperty(java.lang.String key, java.lang.Object val)
          sets a property keyed by name
protected  void setUp()
           
static Test suite()
           
 void testChangeTransientGroupAttribute()
          test for changeTransientGroupAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages.
 void testChangeTransientGroupNameInvalid()
          testChangeTransientGroupNameInvalid change to an unknown group name.
 void testLogLevelChanges()
          test for log level changes
 void testPersistentLogLevelChanges()
          test for log level changes
 void testRemoveTransientAttribute()
          testRemoveTransientAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages.
 void testServiceDataChangeNotification()
          test that we are notified of ServiceData changes - get a NotificationSinkManager and add ourself as a listener for ServiceData changes - log messages to cause notifications - verify that we were notified
 void testSetLogBufferSize()
          check the default LogBufferSize, and set it larger.
 void testSetPersistentAttribute()
          test for setPersistentAttribute
 void testSetPersistentAttributeDestInvalid()
          test for invalid Destination attribute
 void testSetPersistentAttributeLevelInvalid()
          test for invalid LEVEL attribute
 void testSetTransientAttribute()
          test for setTransientAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages.
 void testSetTransientAttributeDestInvalid()
          test for invalid Destination attribute
 void testSetTransientAttributeLevelInvalid()
          test for invalid LEVEL attribute
 
Methods inherited from class org.globus.ogsa.server.test.GridTestCase
setTestServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestOgsiLogging

public TestOgsiLogging(java.lang.String name)
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: ServiceProperties
gets a property keyed by name

Specified by:
getProperty in interface ServiceProperties
Parameters:
key - property key
Returns:
property value or null

getPersistentProperty

public java.lang.Object getPersistentProperty(java.lang.String key)
Description copied from interface: ServiceProperties
gets a persistent property (checkpointed to deployment descriptor) keyed by name

Specified by:
getPersistentProperty in interface ServiceProperties
Parameters:
key - property key
Returns:
property value or null

setPersistentProperty

public void setPersistentProperty(java.lang.String key,
                                  java.lang.Object val)
Description copied from interface: ServiceProperties
sets a persistent property (checkpointed to deployment descriptor) keyed by name

Specified by:
setPersistentProperty in interface ServiceProperties
Parameters:
key - property key
val - property value, if null the property will be removed (if it exists)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object val)
Description copied from interface: ServiceProperties
sets a property keyed by name

Specified by:
setProperty in interface ServiceProperties
Parameters:
key - property key
val - property value, if null the property will be removed (if it exists)

flush

public void flush()
Description copied from interface: ServiceProperties
gives a hint that this property should be checkpointed to the deployment descriptor, it is however not guaranteed that the properties have been persisted when the method returns

Specified by:
flush in interface ServiceProperties

suite

public static Test suite()

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class GridTestCase
Throws:
java.lang.Exception

testSetLogBufferSize

public void testSetLogBufferSize()
                          throws java.lang.Exception
check the default LogBufferSize, and set it larger.

Throws:
java.lang.Exception

testChangeTransientGroupAttribute

public void testChangeTransientGroupAttribute()
                                       throws java.lang.Exception
test for changeTransientGroupAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages. - run add(1) which causes a message to be logged - set the group logging level lower - run add(2) again. Should NOT be logged - set the group logging level back to debug - run add(3). Should be logged. - Verify. deliverNotification stores the received messages. Check those for expected results.

Throws:
java.lang.Exception

testSetTransientAttribute

public void testSetTransientAttribute()
                               throws java.lang.Exception
test for setTransientAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages. - run add(1) which causes a message to be logged - set the logging level lower - run add(2) again. Should NOT be logged - set the logging level back to debug - run add(3). Should be logged. - Verify. deliverNotification stores the received messages. Check those for expected results.

Throws:
java.lang.Exception

testRemoveTransientAttribute

public void testRemoveTransientAttribute()
                                  throws java.lang.Exception
testRemoveTransientAttribute Basic strategy: - Use Logging Counter because it logs messages - Make sure it is logging by calling setTransient - Subscribe to log messages. - run add(1) which causes a message to be logged - set the logging level lower - run add(2) again. Should NOT be logged - set the logging level back to debug - run add(3). Should be logged. - Verify. deliverNotification stores the received messages. Check those for expected results.

Throws:
java.lang.Exception

testChangeTransientGroupNameInvalid

public void testChangeTransientGroupNameInvalid()
                                         throws java.lang.Exception
testChangeTransientGroupNameInvalid change to an unknown group name. Should throw exception which we catch.

Throws:
java.lang.Exception

testSetTransientAttributeDestInvalid

public void testSetTransientAttributeDestInvalid()
                                          throws java.lang.Exception
test for invalid Destination attribute

Throws:
java.lang.Exception

testSetTransientAttributeLevelInvalid

public void testSetTransientAttributeLevelInvalid()
                                           throws java.lang.Exception
test for invalid LEVEL attribute

Throws:
java.lang.Exception

testLogLevelChanges

public void testLogLevelChanges()
                         throws java.lang.Exception
test for log level changes

Throws:
java.lang.Exception

testSetPersistentAttribute

public void testSetPersistentAttribute()
                                throws java.lang.Exception
test for setPersistentAttribute

Throws:
java.lang.Exception

testSetPersistentAttributeDestInvalid

public void testSetPersistentAttributeDestInvalid()
                                           throws java.lang.Exception
test for invalid Destination attribute

Throws:
java.lang.Exception

testSetPersistentAttributeLevelInvalid

public void testSetPersistentAttributeLevelInvalid()
                                            throws java.lang.Exception
test for invalid LEVEL attribute

Throws:
java.lang.Exception

testPersistentLogLevelChanges

public void testPersistentLogLevelChanges()
                                   throws java.lang.Exception
test for log level changes

Throws:
java.lang.Exception

testServiceDataChangeNotification

public void testServiceDataChangeNotification()
                                       throws java.lang.Exception
test that we are notified of ServiceData changes - get a NotificationSinkManager and add ourself as a listener for ServiceData changes - log messages to cause notifications - verify that we were notified

Throws:
java.lang.Exception

deliverNotification

public void deliverNotification(ExtensibilityType message)
                         throws java.rmi.RemoteException
implementation for the NotificationSinkCallback

Throws:
java.rmi.RemoteException