@BeforeMethod
  public void setUp() throws Exception {
    super.setUp();
    FakeModel.instance().clear();
    myTaskExecutor = new CloudAsyncTaskExecutor("Test-vmware");
    myApiConnector = new FakeApiConnector();
    myIdxStorage = createTempDir();
    myImageDetails =
        new VmwareCloudImageDetails(
            "imageNickname",
            "srcVM",
            "srcVMSnap",
            "folderId",
            "rpId",
            CloneBehaviour.FRESH_CLONE,
            5);

    FakeModel.instance().addVM("srcVM");
    FakeModel.instance().addFolder("folderId");
    FakeModel.instance().addResourcePool("rpId");

    FakeModel.instance().addVMSnapshot("srcVM", "srcVMSnap");

    myImage = new VmwareCloudImage(myApiConnector, myImageDetails, myTaskExecutor, myIdxStorage);

    myCloudClient =
        new VMWareCloudClient(new CloudClientParameters(), myApiConnector, createTempDir());
    myCloudClient.populateImagesDataAsync(Collections.singletonList(myImageDetails));
    myUpdateTask =
        new UpdateInstancesTask<VmwareCloudInstance, VmwareCloudImage, VMWareCloudClient>(
            myApiConnector, myCloudClient, 10 * 1000);
  }
예제 #2
0
  @BeforeMethod
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    final Properties ps = readGitHubAccount();
    final String user = ps.getProperty(USERNAME);

    myRepoName = ps.getProperty(REPOSITORY);
    myRepoOwner = ps.getProperty(OWNER, user);

    myApi =
        new GitHubApiImpl(
            new HttpClientWrapperImpl(),
            ps.getProperty(URL),
            user,
            rewind(ps.getProperty(PASSWORD_REV)));
  }
 @AfterMethod
 public void tearDown() throws Exception {
   super.tearDown();
 }
예제 #4
0
 @BeforeMethod
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   myLog = new ArrayList<String>();
 }