Examples of VcDatastore


Examples of com.vmware.aurora.vc.VcDatastore

      Assert.assertEquals(dss.size(), 1);
   }

   @Test
   public void testFindDSInVcByName() {
      VcDatastore ds = VcResourceUtils.findDSInVcByName("line_1");
      Assert.assertNull(ds);
      ds = VcResourceUtils.findDSInVcByName("test_1");
      Assert.assertEquals(ds.getName(), "test_1");
   }
View Full Code Here

Examples of com.vmware.aurora.vc.VcDatastore

@MockClass(realClass = VcInventory.class)
public class MockVcInventory {
   @Mock
   static public List<VcCluster> getClusters() {
      VcCluster cluster1 = Mockito.mock(VcCluster.class);
      VcDatastore ds1 = Mockito.mock(VcDatastore.class);
      Mockito.when(ds1.getName()).thenReturn("test_1");
      List<VcDatastore> dsList1 = new ArrayList<VcDatastore>();
      dsList1.add(ds1);
      Mockito.when(cluster1.getAllDatastores()).thenReturn(dsList1);
      List<VcCluster> clusters = new ArrayList<VcCluster>();
      clusters.add(cluster1);
View Full Code Here

Examples of com.vmware.aurora.vc.VcDatastore

         for (VcNetwork net : cluster.getSharedNetworks()) {
            System.out.println(net);
         }
         for (VcDatastore ds : cluster.getSharedDatastores()) {
            System.out.println(ds + " supported: " + ds.isSupported());
            VcDatastore ds1 = VcCache.get(ds.getId());
            System.out.println(ds1 + " supported: " + ds.isSupported());
         }
      }
   }
View Full Code Here

Examples of com.vmware.aurora.vc.VcDatastore

            System.out.println(newNet + ", id=" + newNet.getId());
            AuAssert.check(net.getId().equals(newNet.getId()));
         }

         for (VcDatastore ds : cluster.getSharedDatastores()) {
            VcDatastore newDs = VcCache.get(ds.getId());
            System.out.println(newDs + ", id=" + newDs.getId());
            AuAssert.check(ds.getId().equals(newDs.getId()));
         }
      }
   }
View Full Code Here

Examples of com.vmware.aurora.vc.VcDatastore

         }
      });
   }

   public static boolean isDatastoreAccessible(String dsMobId) {
      final VcDatastore ds = VcCache.getIgnoreMissing(dsMobId);
      try {
         VcContext.inVcSessionDo(new VcSession<Void>() {
            @Override
            protected boolean isTaskSession() {
               return true;
            }

            @Override
            protected Void body() throws Exception {
               ds.update();
               return null;
            }
         });
      } catch (Exception e) {
         logger.info("failed to update datastore " + ds.getName()
               + ", ignore this error.");
      }
      if (ds != null && ds.isAccessible())
         return true;
      return false;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.