コード例 #1
0
 @Test
 public void testNullSafe() {
   VirtualDataCenterRestRep vdc = new VirtualDataCenterRestRep();
   vdc.canDisconnect();
   vdc.canReconnect();
   vdc.setLocal(true);
   vdc.canDisconnect();
   vdc.canReconnect();
 }
コード例 #2
0
 @Test
 public void testCanReconnect() {
   VirtualDataCenterRestRep vdc = new VirtualDataCenterRestRep();
   vdc.setLocal(false);
   vdc.setConnectionStatus("DISCONNECTED");
   Assert.assertTrue("reconnect should work on a DISCONNECTED non-local vdc", vdc.canReconnect());
 }
コード例 #3
0
 @Test
 public void testRejectLocal() {
   VirtualDataCenterRestRep vdc = new VirtualDataCenterRestRep();
   vdc.setLocal(true);
   vdc.setConnectionStatus("CONNECTED");
   Assert.assertFalse("disconnect should fail on a local vdc", vdc.canDisconnect());
   vdc.setConnectionStatus("DISCONNECTED");
   Assert.assertFalse("reconnect should fail on a local vdc", vdc.canReconnect());
 }