From be59ba5e5e2a03dc3eff96585a9d2a79cab34b76 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 30 Apr 2010 11:20:23 -0700 Subject: [PATCH] added test to ensure that images cache properly --- .../compute/BaseComputeServiceLiveTest.java | 15 ++++++++++++--- demos/antjruby/build.xml | 10 +++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index 7ac0643757..4a52b148bb 100755 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -146,6 +146,15 @@ public abstract class BaseComputeServiceLiveTest { abstract protected Module getSshModule(); + public void testImagesCache() throws Exception { + client.getImages(); + long time = System.currentTimeMillis(); + client.getImages(); + long duration = System.currentTimeMillis() - time; + assert duration < 1000 : String.format("%dms to get images", duration); + } + + @Test(enabled = true, dependsOnMethods = "testImagesCache") public void testTemplateMatch() throws Exception { template = buildTemplate(client.templateBuilder()); Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build(); @@ -318,12 +327,12 @@ public abstract class BaseComputeServiceLiveTest { testGet(); } - @Test(enabled = true/*, dependsOnMethods = "testTemplateMatch"*/) + @Test(enabled = true/* , dependsOnMethods = "testTemplateMatch" */) public void testTemplateOptions() throws Exception { TemplateOptions options = new TemplateOptions().withMetadata(); Template t = client.templateBuilder().smallest().options(options).build(); - assert t.getOptions().isIncludeMetadata() : "The metadata option should be 'true' " + - "for the created template"; + assert t.getOptions().isIncludeMetadata() : "The metadata option should be 'true' " + + "for the created template"; } public void testListNodes() throws Exception { diff --git a/demos/antjruby/build.xml b/demos/antjruby/build.xml index f356e3fb61..543bbc1a75 100644 --- a/demos/antjruby/build.xml +++ b/demos/antjruby/build.xml @@ -35,12 +35,12 @@ - + - - - - + + + +