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 = "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"), "standard", 0, false,
              Sets.<Attachment> newLinkedHashSet());

      CreateVolumeResponseHandler handler = injector.getInstance(CreateVolumeResponseHandler.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 = "BundleTaskHandlerTest")
public class BundleTaskHandlerTest extends BaseEC2HandlerTest {
   public void testBundleInstance() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/bundle_instance.xml");

      BundleTask expected = new BundleTask(defaultRegion, "bun-c1a540a8", null, "i-12345678", 70, dateService
            .iso8601DateParse("2008-10-07T11:41:50.000Z"), "bundling", "my-bucket", "winami", dateService
            .iso8601DateParse("2008-10-07T11:51:50.000Z"));

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

Examples of org.jclouds.date.DateService

      assertEquals(result, expected);
   }

   public void testCancleBundleTask() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/cancel_bundle_task.xml");
      BundleTask expected = new BundleTask(defaultRegion, "bun-cla322b9", null, "i-12345678", 20, dateService
            .iso8601DateParse("2008-10-07T11:41:50.000Z"), "canceling", "my-bucket", "my-new-image", dateService
            .iso8601DateParse("2008-10-07T11:51:50.000Z"));

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

Examples of org.knopflerfish.tutorial.dateservice.DateService

  public void start(BundleContext bc) throws Exception {
    System.out.println(bc.getBundle().getHeaders().get
                       (Constants.BUNDLE_NAME) + " starting...");
    Activator.bc = bc;

    DateService         service       = new DateServiceImpl();
    ServiceRegistration registration =
      bc.registerService(DateService.class.getName(),
                         service,
                         new Hashtable());
    System.out.println("Service registered: DateService");
View Full Code Here

Examples of org.knopflerfish.tutorial.dateservice.DateService

                       " starting...");
    Activator.bc = bc;
    ServiceReference reference =
      bc.getServiceReference(DateService.class.getName());

    DateService service = (DateService)bc.getService(reference);
    System.out.println("Using DateService: formatting date: " +
                       service.getFormattedDate(new Date()));
    bc.ungetService(reference);
  }
View Full Code Here

Examples of org.knopflerfish.tutorial.dateservice.DateService

    Activator.bc = bc;
    ServiceReference reference =
      bc.getServiceReference(DateService.class.getName());

    if(reference != null) {
      DateService service = (DateService)bc.getService(reference);
      System.out.println("Using DateService: formatting date: " +
                         service.getFormattedDate(new Date()));
      bc.ungetService(reference);
    } else {
      System.out.println("No Service available!");
    }
  }
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.