FileDocCategorySizeDatePackage
AvailabilityServiceConfigTest.javaAPI DocGlassfish v2 API7408Fri May 04 22:23:54 BST 2007com.sun.enterprise.management.config

AvailabilityServiceConfigTest

public class AvailabilityServiceConfigTest extends com.sun.enterprise.management.AMXTestBase implements com.sun.enterprise.management.ClusterSupportRequired

Fields Summary
Constructors Summary
public AvailabilityServiceConfigTest()

	
Methods Summary
private com.sun.appserv.management.config.AvailabilityServiceConfiggetIt()

		return getConfigConfig().getAvailabilityServiceConfig();
	
public voidtestAutoManageHAStore()
Test of [g/s]etAutoManageHAStore method, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final boolean save = getIt().getAutoManageHAStore();
            getIt().setAutoManageHAStore(true);
            assertTrue("getAutoManageHAStore() was supposed to return true.", getIt().getAutoManageHAStore());
            getIt().setAutoManageHAStore(false);
            assertFalse("getAutoManageHAStore() was supposed to return false.", getIt().getAutoManageHAStore());
            getIt().setAutoManageHAStore(save);
        }
	
public voidtestAvailabilityEnabled()
Test of [g/s]etAvailabilityEnabled method, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            getIt().setAvailabilityEnabled(false);
            assertFalse("getAvailabilityEnabled() was supposed to return false.", getIt().getAvailabilityEnabled());
            getIt().setAvailabilityEnabled(true);
            assertTrue("getAvailabilityEnabled() was supposed to return true.", getIt().getAvailabilityEnabled());
        }
	
public voidtestHAAgentHosts()
Test of [g/s]etHAAgentHosts methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final String hosts = "hp,hp,hp,hp";
            final String save = getIt().getHAAgentHosts();
            getIt().setHAAgentHosts(hosts);
            String s = getIt().getHAAgentHosts();
            assertEquals(hosts, s);
            getIt().setHAAgentHosts( (save == null) ? "" : save);
        }
	
public voidtestHAAgentPort()
Test of [g/s]etHAAgentPort methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final String port = "3456";
            final String save = getIt().getHAAgentPort();
            getIt().setHAAgentPort(port);
            final String s = getIt().getHAAgentPort();
            assertEquals(port, s);
            getIt().setHAAgentPort( (save == null) ? "" : save);
        }
	
public voidtestHAStoreHealthcheckEnabled()
Test of [g/s]etHAStoreHealthcheckEnabled methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final boolean save = getIt().getHAStoreHealthcheckEnabled();
            
            getIt().setHAStoreHealthcheckEnabled(false);
            assertFalse("getHAStoreHealthcheckEnabled() was supposed to return false.", getIt().getHAStoreHealthcheckEnabled());
            getIt().setHAStoreHealthcheckEnabled(true);
            assertTrue("getHAStoreHealthcheckEnabled() was supposed to return true.", getIt().getHAStoreHealthcheckEnabled());
            getIt().setHAStoreHealthcheckEnabled( save );
        }
	
public voidtestHAStoreHealthcheckIntervalSeconds()
Test of [g/s]etHAStoreHealthcheckIntervalSeconds methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final String time = "90";
            final String save = getIt().getHAStoreHealthcheckIntervalSeconds();
            getIt().setHAStoreHealthcheckIntervalSeconds(time);
            String s = getIt().getHAStoreHealthcheckIntervalSeconds();
            assertEquals(time, s);
            getIt().setHAStoreHealthcheckIntervalSeconds( (save == null) ? "" : save);
        }
	
public voidtestHAStoreName()
Test of [g/s]etHAStoreName methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final String storeName = "cluster1";
            final String save = getIt().getHAStoreName();
            getIt().setHAStoreName(storeName);
            final String s = getIt().getHAStoreName();
            assertEquals(storeName, s);
            getIt().setHAStoreName( (save == null) ? "" : save);
        }
	
public voidtestStorePoolName()
Test of [g/s]etStorePoolName methods, of class com.sun.appserv.management.config.AvailabilityServiceConfig.

        if ( getIt() != null )
        {
            final String storeName = "xxxx";
            final String save = getIt().getStorePoolName();
            getIt().setStorePoolName(storeName);
            final String s = getIt().getStorePoolName();
            assertEquals(storeName, s);
            getIt().setStorePoolName( (save == null) ? "" : save);
        }
	
public voidtestWarnAvail()

        if ( getIt() == null )
        {
            assert false : "AvailabilityServiceConfigTest:  no AvailabilityServiceConfig to test";
        }