Examples of DateService


Examples of org.jclouds.date.DateService

*/
//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "SnapshotHandlerTest")
public class SnapshotHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/created_snapshot.xml");

      Snapshot expected = new Snapshot(defaultRegion, "snap-78a54011", "vol-4d826724", 10,
               Snapshot.Status.PENDING, dateService.iso8601DateParse("2008-05-07T12:51:50.000Z"),
               60, "213457642086", "Daily Backup", null);

      SnapshotHandler handler = injector.getInstance(SnapshotHandler.class);
      addDefaultRegionToHandler(handler);
      Snapshot result = factory.create(handler).parse(is);
View Full Code Here

Examples of org.jclouds.date.DateService

//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "DescribeVolumesResponseHandlerTest")
public class DescribeVolumesResponseHandlerTest extends BaseEC2HandlerTest {

   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/describe_volumes.xml");

      Set<Volume> expected = Sets.newLinkedHashSet();
      expected.add(new Volume(defaultRegion, "vol-2a21e543", 1, null, "us-east-1a",
               Volume.Status.AVAILABLE, dateService.iso8601DateParse("2009-12-28T05:42:53.000Z"),
               Sets.<Attachment> newLinkedHashSet()));
      expected.add(new Volume(defaultRegion, "vol-4282672b", 800, "snap-536d1b3a",
               "us-east-1a", Volume.Status.IN_USE, dateService
                        .iso8601DateParse("2008-05-07T11:51:50.000Z"), Sets
                        .<Attachment> newHashSet(new Attachment(defaultRegion, "vol-4282672b", "i-6058a509",
                                 "/dev/sdh", Attachment.Status.ATTACHED, dateService
                                          .iso8601DateParse("2008-05-07T12:51:50.000Z")))));

      DescribeVolumesResponseHandler handler = injector
               .getInstance(DescribeVolumesResponseHandler.class);
      addDefaultRegionToHandler(handler);
View Full Code Here

Examples of org.jclouds.date.DateService

*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "AttachmentHandlerTest")
public class AttachmentHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/attach.xml");

      Attachment expected = new Attachment(defaultRegion, "vol-4d826724", "i-6058a509", "/dev/sdh",
            Attachment.Status.ATTACHING, dateService.iso8601DateParse("2008-05-07T11:51:50.000Z"));

      AttachmentHandler handler = injector.getInstance(AttachmentHandler.class);
      addDefaultRegionToHandler(handler);
      Attachment result = factory.create(handler).parse(is);

View Full Code Here

Examples of org.jclouds.date.DateService

   public void testCopyingTemplate() {
      InputStream is = getClass().getResourceAsStream("/vAppTemplate-copying.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      DateService dateService = injector.getInstance(DateService.class);

      VAppTemplate result = factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
      assertEquals(result.getName(), "Ubuntu10.04_v2");
      assertEquals(result.getHref(), URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-699683881"));
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vAppTemplate+xml");
      assertEquals(result.getStatus(), Status.UNRESOLVED);
      assertEquals(result.getVDC(), new ReferenceTypeImpl(null, VCloudMediaType.VDC_XML, URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/vdc/105186609")));
      assertEquals(result.getDescription(), null);
      assertEquals(result.getTasks(), ImmutableList.of(new TaskImpl(URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/task/q62gxhi32xgd9yrqvr"),
               "Copying Virtual Application Template Ubuntu10.04_v2(699683881)", TaskStatus.RUNNING, dateService
                        .iso8601DateParse("2010-09-17T23:20:46.039-04:00"), dateService
                        .iso8601DateParse("9999-12-31T23:59:59.999-05:00"), dateService
                        .iso8601DateParse("2010-12-16T23:20:46.039-05:00"), new ReferenceTypeImpl("Ubuntu10.04_v2",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml",
                        URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-699683881")),
               null)));
      assertEquals(result.getVAppScopedLocalId(), null);
View Full Code Here

Examples of org.jclouds.date.DateService

*/
//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "SnapshotHandlerTest")
public class SnapshotHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/created_snapshot.xml");

      Snapshot expected = new Snapshot(defaultRegion, "snap-78a54011", "vol-4d826724", 10,
               Snapshot.Status.PENDING, dateService.iso8601DateParse("2008-05-07T12:51:50.000Z"),
               60, "213457642086", "Daily Backup", null);

      SnapshotHandler handler = injector.getInstance(SnapshotHandler.class);
      addDefaultRegionToHandler(handler);
      Snapshot result = factory.create(handler).parse(is);
View Full Code Here

Examples of org.jclouds.date.DateService

//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "DescribeVolumesResponseHandlerTest")
public class DescribeVolumesResponseHandlerTest extends BaseEC2HandlerTest {

   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/describe_volumes.xml");

      Set<Volume> expected = Sets.newLinkedHashSet();
      expected.add(new Volume(defaultRegion, "vol-2a21e543", 1, null, "us-east-1a",
               Volume.Status.AVAILABLE, dateService.iso8601DateParse("2009-12-28T05:42:53.000Z"),
               Sets.<Attachment> newLinkedHashSet()));
      expected.add(new Volume(defaultRegion, "vol-4282672b", 800, "snap-536d1b3a",
               "us-east-1a", Volume.Status.IN_USE, dateService
                        .iso8601DateParse("2008-05-07T11:51:50.000Z"), Sets
                        .<Attachment> newHashSet(new Attachment(defaultRegion, "vol-4282672b", "i-6058a509",
                                 "/dev/sdh", Attachment.Status.ATTACHED, dateService
                                          .iso8601DateParse("2008-05-07T12:51:50.000Z")))));

      DescribeVolumesResponseHandler handler = injector
               .getInstance(DescribeVolumesResponseHandler.class);
      addDefaultRegionToHandler(handler);
View Full Code Here

Examples of org.jclouds.date.DateService

*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "AttachmentHandlerTest")
public class AttachmentHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/attach.xml");

      Attachment expected = new Attachment(defaultRegion, "vol-4d826724", "i-6058a509", "/dev/sdh",
            Attachment.Status.ATTACHING, dateService.iso8601DateParse("2008-05-07T11:51:50.000Z"));

      AttachmentHandler handler = injector.getInstance(AttachmentHandler.class);
      addDefaultRegionToHandler(handler);
      Attachment result = factory.create(handler).parse(is);

View Full Code Here

Examples of org.jclouds.date.DateService

   public void testApplyInputStream() {

      InputStream is = getClass().getResourceAsStream(
               "/describe_image_attribute_blockDeviceMapping.xml");

      DateService dateService = injector.getInstance(DateService.class);
      Map<String, BlockDevice> expected = ImmutableMap.<String, BlockDevice> of("/dev/sda1",
               new BlockDevice("vol-d74b82be", Attachment.Status.ATTACHED, dateService
                        .iso8601DateParse("2010-02-20T18:25:26.000Z"), true), "/dev/sdf",
               new BlockDevice("vol-another", Attachment.Status.DETACHED, dateService
                        .iso8601DateParse("2010-02-20T19:26:26.000Z"), false));

      Map<String, BlockDevice> result = factory.create(
               injector.getInstance(BlockDeviceMappingHandler.class)).parse(is);
View Full Code Here

Examples of org.jclouds.date.DateService

*/
//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "DescribeSnapshotsResponseHandlerTest")
public class DescribeSnapshotsResponseHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/describe_snapshots.xml");

      Set<Snapshot> expected = Sets.newLinkedHashSet();
      expected.add(new Snapshot(defaultRegion, "snap-78a54011", "vol-4d826724", 10,
               Snapshot.Status.PENDING, dateService.iso8601DateParse("2008-05-07T12:51:50.000Z"),
               80, "218213537122", "Daily Backup", null));

      DescribeSnapshotsResponseHandler handler = injector
               .getInstance(DescribeSnapshotsResponseHandler.class);
      addDefaultRegionToHandler(handler);
View Full Code Here

Examples of org.jclouds.date.DateService

//NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "CreateVolumeResponseHandlerTest")
public class CreateVolumeResponseHandlerTest extends BaseEC2HandlerTest {

   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/created_volume.xml");

      Volume expected = new Volume(Region.US_EAST_1, "vol-2a21e543", 1, null,
            "us-east-1a", Volume.Status.CREATING, dateService
                        .iso8601DateParse("2009-12-28T05:42:53.000Z"), Sets
                        .<Attachment> newLinkedHashSet());

      CreateVolumeResponseHandler handler = injector.getInstance(CreateVolumeResponseHandler.class);
      addDefaultRegionToHandler(handler);
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.