Package org.jclouds.cloudstack.features

Examples of org.jclouds.cloudstack.features.AsyncJobApi


   @Test
   public void testLoadAlreadyExists() throws UnknownHostException {
      final CloudStackApi client = createMock(CloudStackApi.class);
      SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
      ZoneApi zoneClient = createMock(ZoneApi.class);
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);
     
      SecurityGroup group = createMock(SecurityGroup.class);
     
      Zone zone = createMock(Zone.class);
View Full Code Here


   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testLoadZoneNoSecurityGroups() throws UnknownHostException {
      final CloudStackApi client = createMock(CloudStackApi.class);
      SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
      ZoneApi zoneClient = createMock(ZoneApi.class);
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);
     
      SecurityGroup group = createMock(SecurityGroup.class);
     
      Zone zone = createMock(Zone.class);
View Full Code Here

   @Test
   public void testApply() throws UnknownHostException {
      final CloudStackApi client = createMock(CloudStackApi.class);
      SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
      ZoneApi zoneClient = createMock(ZoneApi.class);
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);
     
      SecurityGroup group = createMock(SecurityGroup.class);
     
      Zone zone = createMock(Zone.class);
View Full Code Here

   @Test
   public void testApplyGroupAlreadyExists() throws UnknownHostException {
      final CloudStackApi client = createMock(CloudStackApi.class);
      SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
      ZoneApi zoneClient = createMock(ZoneApi.class);
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);
     
      SecurityGroup group = createMock(SecurityGroup.class);
     
      Zone zone = createMock(Zone.class);
View Full Code Here

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testApplyZoneNoSecurityGroups() throws UnknownHostException {
      final CloudStackApi client = createMock(CloudStackApi.class);
      SecurityGroupApi secClient = createMock(SecurityGroupApi.class);
      ZoneApi zoneClient = createMock(ZoneApi.class);
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);
     
      SecurityGroup group = createMock(SecurityGroup.class);
     
      Zone zone = createMock(Zone.class);
View Full Code Here

      String id = "1";
      String jobId = "2";

      CloudStackApi client = createMock(CloudStackApi.class);
      Predicate<String> jobComplete = Predicates.alwaysTrue();
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);

      expect(client.getAsyncJobApi()).andReturn(jobClient).atLeastOnce();
      expect(jobClient.getAsyncJob(jobId)).andReturn(AsyncJob.builder().id(jobId).result("foo").build()).atLeastOnce();

      replay(client);
      replay(jobClient);

      assertEquals(
View Full Code Here

      String jobId = "2";

      CloudStackApi client = createMock(CloudStackApi.class);
      // the alwaysfalse predicate should blow up with IllegalStateException
      Predicate<String> jobComplete = Predicates.alwaysFalse();
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);

      expect(client.getAsyncJobApi()).andReturn(jobClient).atLeastOnce();
      expect(jobClient.getAsyncJob(jobId)).andReturn(AsyncJob.builder().id(jobId).result("foo").build()).atLeastOnce();

      replay(client);
      replay(jobClient);

      assertEquals(
View Full Code Here

      String id = "1";
      String jobId = "2";

      CloudStackApi client = createMock(CloudStackApi.class);
      Predicate<String> jobComplete = Predicates.alwaysTrue();
      AsyncJobApi jobClient = createMock(AsyncJobApi.class);

      expect(client.getAsyncJobApi()).andReturn(jobClient).atLeastOnce();
      expect(jobClient.getAsyncJob(jobId)).andReturn(
            AsyncJob.builder().id(jobId)
                  .error(AsyncJobError.builder().errorCode(ErrorCode.INTERNAL_ERROR).errorText("ERRROR").build())
                  .result("foo").build())
            .atLeastOnce();
View Full Code Here

TOP

Related Classes of org.jclouds.cloudstack.features.AsyncJobApi

Copyright © 2018 www.massapicom. 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.