mirror of https://github.com/apache/jclouds.git
test size comparison when testing templates
This commit is contained in:
parent
34bbfa3797
commit
11884540a6
|
@ -33,6 +33,7 @@ import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
import org.jclouds.Constants;
|
import org.jclouds.Constants;
|
||||||
import org.jclouds.compute.config.BaseComputeServiceContextModule;
|
import org.jclouds.compute.config.BaseComputeServiceContextModule;
|
||||||
|
import org.jclouds.compute.domain.Hardware;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
import org.jclouds.compute.domain.OsFamily;
|
||||||
import org.jclouds.compute.domain.OsFamilyVersion64Bit;
|
import org.jclouds.compute.domain.OsFamilyVersion64Bit;
|
||||||
import org.jclouds.compute.domain.Template;
|
import org.jclouds.compute.domain.Template;
|
||||||
|
@ -77,6 +78,29 @@ public abstract class BaseTemplateBuilderLiveTest {
|
||||||
apiversion = System.getProperty("test." + provider + ".apiversion");
|
apiversion = System.getProperty("test." + provider + ".apiversion");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testCompareSizes() throws Exception {
|
||||||
|
Hardware defaultSize = context.getComputeService().templateBuilder().build().getHardware();
|
||||||
|
|
||||||
|
Hardware smallest = context.getComputeService().templateBuilder().smallest().build().getHardware();
|
||||||
|
Hardware fastest = context.getComputeService().templateBuilder().fastest().build().getHardware();
|
||||||
|
Hardware biggest = context.getComputeService().templateBuilder().biggest().build().getHardware();
|
||||||
|
|
||||||
|
System.out.printf("smallest %s%n", smallest);
|
||||||
|
System.out.printf("fastest %s%n", fastest);
|
||||||
|
System.out.printf("biggest %s%n", biggest);
|
||||||
|
|
||||||
|
assertEquals(defaultSize, smallest);
|
||||||
|
|
||||||
|
assert getCores(smallest) <= getCores(fastest) : String.format("%s ! <= %s", smallest, fastest);
|
||||||
|
assert getCores(biggest) <= getCores(fastest) : String.format("%s ! <= %s", biggest, fastest);
|
||||||
|
|
||||||
|
assert biggest.getRam() >= fastest.getRam() : String.format("%s ! >= %s", biggest, fastest);
|
||||||
|
assert biggest.getRam() >= smallest.getRam() : String.format("%s ! >= %s", biggest, smallest);
|
||||||
|
|
||||||
|
assert getCores(fastest) >= getCores(biggest) : String.format("%s ! >= %s", fastest, biggest);
|
||||||
|
assert getCores(fastest) >= getCores(smallest) : String.format("%s ! >= %s", fastest, smallest);
|
||||||
|
}
|
||||||
|
|
||||||
protected Properties setupProperties() {
|
protected Properties setupProperties() {
|
||||||
Properties overrides = new Properties();
|
Properties overrides = new Properties();
|
||||||
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
|
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
|
||||||
|
|
Loading…
Reference in New Issue