1 23 package com.sun.enterprise.management.config; 24 25 26 import com.sun.appserv.management.config.AvailabilityServiceConfig; 27 28 import com.sun.enterprise.management.AMXTestBase; 29 import com.sun.enterprise.management.ClusterSupportRequired; 30 31 32 public class AvailabilityServiceConfigTest extends AMXTestBase 33 implements ClusterSupportRequired 34 { 35 public AvailabilityServiceConfigTest() 36 { 37 } 38 39 private AvailabilityServiceConfig 40 getIt() 41 { 42 return getConfigConfig().getAvailabilityServiceConfig(); 43 } 44 45 46 49 public void testAvailabilityEnabled() 50 { 51 getIt().setAvailabilityEnabled(false); 52 assertFalse("getAvailabilityEnabled() was supposed to return false.", getIt().getAvailabilityEnabled()); 53 getIt().setAvailabilityEnabled(true); 54 assertTrue("getAvailabilityEnabled() was supposed to return true.", getIt().getAvailabilityEnabled()); 55 } 56 57 60 public void testAutoManageHAStore() 61 { 62 boolean save = getIt().getAutoManageHAStore(); 63 getIt().setAutoManageHAStore(true); 64 assertTrue("getAutoManageHAStore() was supposed to return true.", getIt().getAutoManageHAStore()); 65 getIt().setAutoManageHAStore(false); 66 assertFalse("getAutoManageHAStore() was supposed to return false.", getIt().getAutoManageHAStore()); 67 getIt().setAutoManageHAStore(save); 68 } 69 70 73 public void testHAAgentHosts() 74 { 75 String hosts = "hp,hp,hp,hp"; 76 final String save = getIt().getHAAgentHosts(); 77 getIt().setHAAgentHosts(hosts); 78 String s = getIt().getHAAgentHosts(); 79 assertEquals(hosts, s); 80 getIt().setHAAgentHosts( (save == null) ? "" : save); 81 } 82 83 86 public void testHAAgentPort() 87 { 88 String port = "3456"; 89 final String save = getIt().getHAAgentPort(); 90 getIt().setHAAgentPort(port); 91 String s = getIt().getHAAgentPort(); 92 assertEquals(port, s); 93 getIt().setHAAgentPort( (save == null) ? "" : save); 94 } 95 96 99 public void testHAStoreHealthcheckIntervalSeconds() 100 { 101 String time = "90"; 102 final String save = getIt().getHAStoreHealthcheckIntervalSeconds(); 103 getIt().setHAStoreHealthcheckIntervalSeconds(time); 104 String s = getIt().getHAStoreHealthcheckIntervalSeconds(); 105 assertEquals(time, s); 106 getIt().setHAStoreHealthcheckIntervalSeconds( (save == null) ? "" : save); 107 } 108 109 112 public void testHAStoreName() 113 { 114 String storeName = "cluster1"; 115 final String save = getIt().getHAStoreName(); 116 getIt().setHAStoreName(storeName); 117 String s = getIt().getHAStoreName(); 118 assertEquals(storeName, s); 119 getIt().setHAStoreName( (save == null) ? "" : save); 120 } 121 122 125 public void testStorePoolName() 126 { 127 String storeName = "xxxx"; 128 final String save = getIt().getStorePoolName(); 129 getIt().setStorePoolName(storeName); 130 String s = getIt().getStorePoolName(); 131 assertEquals(storeName, s); 132 getIt().setStorePoolName( (save == null) ? "" : save); 133 } 134 135 138 public void testHAStoreHealthcheckEnabled() 139 { 140 final boolean save = getIt().getHAStoreHealthcheckEnabled(); 141 142 getIt().setHAStoreHealthcheckEnabled(false); 143 assertFalse("getHAStoreHealthcheckEnabled() was supposed to return false.", getIt().getHAStoreHealthcheckEnabled()); 144 getIt().setHAStoreHealthcheckEnabled(true); 145 assertTrue("getHAStoreHealthcheckEnabled() was supposed to return true.", getIt().getHAStoreHealthcheckEnabled()); 146 getIt().setHAStoreHealthcheckEnabled( save ); 147 } 148 } 149 150 151 | Popular Tags |