added test to ensure that images cache properly

This commit is contained in:
Adrian Cole 2010-04-30 11:20:23 -07:00
parent 3b4551b995
commit be59ba5e5e
2 changed files with 17 additions and 8 deletions

View File

@ -146,6 +146,15 @@ public abstract class BaseComputeServiceLiveTest {
abstract protected Module getSshModule(); 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 { public void testTemplateMatch() throws Exception {
template = buildTemplate(client.templateBuilder()); template = buildTemplate(client.templateBuilder());
Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build(); Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
@ -322,8 +331,8 @@ public abstract class BaseComputeServiceLiveTest {
public void testTemplateOptions() throws Exception { public void testTemplateOptions() throws Exception {
TemplateOptions options = new TemplateOptions().withMetadata(); TemplateOptions options = new TemplateOptions().withMetadata();
Template t = client.templateBuilder().smallest().options(options).build(); Template t = client.templateBuilder().smallest().options(options).build();
assert t.getOptions().isIncludeMetadata() : "The metadata option should be 'true' " + assert t.getOptions().isIncludeMetadata() : "The metadata option should be 'true' "
"for the created template"; + "for the created template";
} }
public void testListNodes() throws Exception { public void testListNodes() throws Exception {

View File

@ -35,12 +35,12 @@
<!-- Setup maven so that we can get latest version of jclouds, shrinkwrap, and jruby --> <!-- Setup maven so that we can get latest version of jclouds, shrinkwrap, and jruby -->
<artifact:dependencies pathId="shrinkwrap.classpath"> <artifact:dependencies pathId="shrinkwrap.classpath">
<dependency groupId="org.jboss.shrinkwrap" artifactId="shrinkwrap-impl-base" version="1.0.0-alpha-3" /> <dependency groupId="org.jboss.shrinkwrap" artifactId="shrinkwrap-impl-base" version="1.0.0-alpha-9" />
<dependency groupId="org.jruby" artifactId="jruby" version="1.4.0"/> <dependency groupId="org.jruby" artifactId="jruby" version="1.4.0"/>
<dependency groupId="org.jclouds" artifactId="jclouds-aws" version="1.0-beta-3" /> <dependency groupId="org.jclouds" artifactId="jclouds-aws" version="1.0-SNAPSHOT" />
<dependency groupId="org.jclouds" artifactId="jclouds-atmos" version="1.0-beta-3" /> <dependency groupId="org.jclouds" artifactId="jclouds-atmos" version="1.0-SNAPSHOT" />
<dependency groupId="org.jclouds" artifactId="jclouds-azure" version="1.0-beta-3" /> <dependency groupId="org.jclouds" artifactId="jclouds-azure" version="1.0-SNAPSHOT" />
<dependency groupId="org.jclouds" artifactId="jclouds-rackspace" version="1.0-beta-3" /> <dependency groupId="org.jclouds" artifactId="jclouds-rackspace" version="1.0-SNAPSHOT" />
<remoteRepository refid="shrinkwrap.repository" /> <remoteRepository refid="shrinkwrap.repository" />
<remoteRepository refid="jclouds-snapshot.repository" /> <remoteRepository refid="jclouds-snapshot.repository" />
<localRepository refid="local.repository" /> <localRepository refid="local.repository" />