Package org.jclouds.digitalocean.compute.config.DigitalOceanComputeServiceContextModule

Examples of org.jclouds.digitalocean.compute.config.DigitalOceanComputeServiceContextModule.EventDonePredicate


      expect(eventApi.get(1)).andReturn(event(Status.DONE));
      expect(eventApi.get(2)).andReturn(event(Status.PENDING));
      expect(api.getEventApi()).andReturn(eventApi).times(2);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
      assertTrue(predicate.apply(1));
      assertFalse(predicate.apply(2));
   }
View Full Code Here


      expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR));
      expect(api.getEventApi()).andReturn(eventApi);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);

      try {
         predicate.apply(1);
         fail("Method should have thrown an IllegalStateException");
      } catch (IllegalStateException ex) {
         assertEquals(ex.getMessage(), "Resource is in invalid status: ERROR");
      }
   }
View Full Code Here

      expect(eventApi.get(1)).andReturn(event(Status.DONE));
      expect(eventApi.get(2)).andReturn(event(Status.PENDING));
      expect(api.getEventApi()).andReturn(eventApi).times(2);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
      assertTrue(predicate.apply(1));
      assertFalse(predicate.apply(2));
   }
View Full Code Here

      expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR));
      expect(api.getEventApi()).andReturn(eventApi);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);

      try {
         predicate.apply(1);
         fail("Method should have thrown an IllegalStateException");
      } catch (IllegalStateException ex) {
         assertEquals(ex.getMessage(), "Resource is in invalid status: ERROR");
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.digitalocean.compute.config.DigitalOceanComputeServiceContextModule.EventDonePredicate

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.