Examples of ElasticStackApi


Examples of org.jclouds.elasticstack.ElasticStackApi

               public DriveInfo load(String key) throws Exception {
                  throw new IllegalStateException("cache should not be used");
               }
            });

      ElasticStackApi api = EasyMock.createMock(ElasticStackApi.class);
      Predicate<DriveInfo> driveNotClaimed = Predicates.alwaysTrue();
      DriveInfo mockDrive = new DriveInfo.Builder().uuid(UUID.randomUUID().toString()).name("mock")
            .metrics(new DriveMetrics.Builder().build()).build();

      expect(api.createDrive(anyObject(DriveInfo.class))).andReturn(mockDrive);
      api.imageDrive(image.getId(), mockDrive.getUuid(), ImageConversionType.GUNZIP);
      // Set a custom exception message to make sure the exception is thrown at the right point
      expectLastCall().andThrow(new IllegalStateException("imageDrive call failed"));
      api.destroyDrive(mockDrive.getUuid());
      expectLastCall();

      replay(api);

      ElasticStackComputeServiceAdapter adapter = new ElasticStackComputeServiceAdapter(api, driveNotClaimed,
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.