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();
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 {

View File

@ -35,12 +35,12 @@
<!-- Setup maven so that we can get latest version of jclouds, shrinkwrap, and jruby -->
<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.jclouds" artifactId="jclouds-aws" version="1.0-beta-3" />
<dependency groupId="org.jclouds" artifactId="jclouds-atmos" version="1.0-beta-3" />
<dependency groupId="org.jclouds" artifactId="jclouds-azure" version="1.0-beta-3" />
<dependency groupId="org.jclouds" artifactId="jclouds-rackspace" 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-SNAPSHOT" />
<dependency groupId="org.jclouds" artifactId="jclouds-azure" version="1.0-SNAPSHOT" />
<dependency groupId="org.jclouds" artifactId="jclouds-rackspace" version="1.0-SNAPSHOT" />
<remoteRepository refid="shrinkwrap.repository" />
<remoteRepository refid="jclouds-snapshot.repository" />
<localRepository refid="local.repository" />