Permalink
Browse files

fixed and improved tests

  • Loading branch information...
1 parent 7b5cbfd commit 939faa6e6b1a3ded2a02211ae7525fbc1f1c0838 @pauloricardomg pauloricardomg committed Aug 2, 2010
Showing with 681 additions and 245 deletions.
  1. +16 −4 ...ce/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.repr.xml
  2. +6 −6 service/service/java/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/main.xml
  3. +1 −1 ...a/tests/suites/basic/home/services/etc/nimbus/workspace-service/other/resource-locator-ACTIVE.xml
  4. +1 −1 .../tests/suites/basic/home/services/etc/nimbus/workspace-service/other/resource-locator-default.xml
  5. +23 −10 service/service/java/tests/suites/common/src/org/globus/workspace/testing/utils/ReprPopulator.java
  6. +16 −4 ...s/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/main.repr.xml
  7. +6 −6 .../tests/suites/spotinstances/noresources/home/services/etc/nimbus/workspace-service/other/main.xml
  8. +1 −1 ...nstances/noresources/home/services/etc/nimbus/workspace-service/other/resource-locator-ACTIVE.xml
  9. +1 −1 ...stances/noresources/home/services/etc/nimbus/workspace-service/other/resource-locator-default.xml
  10. +16 −4 ...s/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.repr.xml
  11. +5 −5 ...suites/spotinstances/singleresourcepool/home/services/etc/nimbus/workspace-service/other/main.xml
  12. +1 −1 ...s/singleresourcepool/home/services/etc/nimbus/workspace-service/other/resource-locator-ACTIVE.xml
  13. +1 −1 .../singleresourcepool/home/services/etc/nimbus/workspace-service/other/resource-locator-default.xml
  14. +24 −24 ...uites/spotinstances/src/org/globus/workspace/testing/suites/spotinstances/NoResourcesSISuite.java
  15. +445 −102 ...potinstances/src/org/globus/workspace/testing/suites/spotinstances/SingleResourcePoolSISuite.java
  16. +59 −37 ...ce/service/java/tests/unit/org/globus/workspace/scheduler/defaults/ResourcepoolUtilProfiling.java
  17. +59 −37 service/service/java/tests/unit/org/globus/workspace/scheduler/defaults/ResourcepoolUtilTest.java
@@ -26,8 +26,11 @@
<lookup-method name="_newCustomizationRequest" bean="nimbus-repr.CustomizationRequest"/>
<lookup-method name="_newShutdownTasks" bean="nimbus-repr.ShutdownTasks"/>
<lookup-method name="_newUsage" bean="nimbus-repr.Usage"/>
- <lookup-method name="_newSpotRequest" bean="nimbus-repr.SpotRequest" />
- <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newRequestInfo" bean="nimbus-repr.RequestInfo" />
+ <lookup-method name="_newSpotRequestInfo" bean="nimbus-repr.SpotRequestInfo" />
+ <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newSpotCreateRequest" bean="nimbus-repr.SpotCreateRequest" />
+ <lookup-method name="_newBackfillRequest" bean="nimbus-repr.BackfillRequest" />
<!-- vm package, writable: -->
@@ -69,12 +72,21 @@
<bean id="nimbus-repr.Usage" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultUsage" />
- <bean id="nimbus-repr.SpotRequest" scope="prototype"
- class="org.nimbustools.api.defaults.repr.DefaultSpotRequest" />
+ <bean id="nimbus-repr.RequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultRequestInfo" />
+
+ <bean id="nimbus-repr.SpotRequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotRequestInfo" />
<bean id="nimbus-repr.SpotPriceEntry" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultSpotPriceEntry" />
+ <bean id="nimbus-repr.BackfillRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultAsyncCreateRequest" />
+
+ <bean id="nimbus-repr.SpotCreateRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotCreateRequest" />
+
<!-- vm package beans: -->
<bean id="nimbus-repr.vm.Kernel" scope="prototype"
@@ -19,7 +19,7 @@
<constructor-arg ref="nimbus-repr.ReprFactory"/>
<constructor-arg ref="nimbus-rm.persistence.DataConvert"/>
<constructor-arg ref="nimbus-rm.loglevels" />
- <constructor-arg ref="nimbus-rm.spotinstances.manager" />
+ <constructor-arg ref="nimbus-rm.async.manager" />
<property name="accounting"
ref="nimbus-rm.accounting" />
@@ -102,7 +102,7 @@
<!-- set after object creation time to avoid circular dep -->
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
</bean>
@@ -408,7 +408,7 @@
<constructor-arg ref="other.MainDataSource" />
<constructor-arg ref="nimbus-rm.loglevels" />
<constructor-arg ref="nimbus-rm.persistence.dbloader" />
- <constructor-arg ref="nimbus-repr.ReprFactory"/>
+ <constructor-arg ref="nimbus-repr.ReprFactory"/>
</bean>
@@ -538,7 +538,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
<!-- definition of this bean is in "resource-locator-ACTIVE.xml" -->
<property name="slotManager"
ref="nimbus-rm.scheduler.SlotManagement" />
@@ -551,8 +551,8 @@
<bean id="nimbus-rm.spotinstances.pricingmodel"
class="$SI{si.pricingmodel}" />
- <bean id="nimbus-rm.spotinstances.manager"
- class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
+ <bean id="nimbus-rm.async.manager"
+ class="org.globus.workspace.spotinstances.AsyncRequestManagerImpl">
<constructor-arg ref="nimbus-rm.persistence.PersistenceAdapter" />
<constructor-arg ref="nimbus-rm.loglevels" />
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
@@ -21,17 +21,18 @@
import org.nimbustools.api._repr._Caller;
import org.nimbustools.api._repr._CreateRequest;
-import org.nimbustools.api._repr._RequestSI;
+import org.nimbustools.api._repr._AsyncCreateRequest;
+import org.nimbustools.api._repr._SpotCreateRequest;
import org.nimbustools.api._repr.vm._NIC;
import org.nimbustools.api._repr.vm._RequiredVMM;
import org.nimbustools.api._repr.vm._ResourceAllocation;
import org.nimbustools.api._repr.vm._Schedule;
import org.nimbustools.api._repr.vm._VMFile;
-import org.nimbustools.api.defaults.repr.DefaultRequestSI;
import org.nimbustools.api.repr.Caller;
import org.nimbustools.api.repr.CreateRequest;
import org.nimbustools.api.repr.ReprFactory;
-import org.nimbustools.api.repr.RequestSI;
+import org.nimbustools.api.repr.AsyncCreateRequest;
+import org.nimbustools.api.repr.SpotCreateRequest;
import org.nimbustools.api.repr.si.SIConstants;
import org.nimbustools.api.repr.vm.NIC;
import org.nimbustools.api.repr.vm.ResourceAllocation;
@@ -116,18 +117,30 @@ public Caller getCaller(String id) {
public Caller getSuperuserCaller() {
// workspace-service is currently broken with superuser
- return this.repr._newCaller();
+ _Caller superuser = this.repr._newCaller();
+ superuser.setIdentity("SUPERUSER");
+ superuser.setSuperUser(true);
+ return superuser;
}
- public RequestSI getBasicRequestSI(String name, int numNodes, Double spotPrice, boolean persistent) throws Exception {
- final _RequestSI reqSI = new DefaultRequestSI();
-
- populate(reqSI, 500, name, SIConstants.SI_TYPE_BASIC_MEM, numNodes, true);
-
+ public SpotCreateRequest getBasicRequestSI(String name, int numNodes, Double spotPrice, boolean persistent) throws Exception {
+ final _SpotCreateRequest reqSI = this.repr._newSpotCreateRequest();
reqSI.setInstanceType(SIConstants.SI_TYPE_BASIC);
reqSI.setSpotPrice(spotPrice);
- reqSI.setPersistent(persistent);
+ reqSI.setPersistent(persistent);
+
+ populate(reqSI, 500, name, SIConstants.SI_TYPE_BASIC_MEM, numNodes, true);
return reqSI;
+ }
+
+ public AsyncCreateRequest getBackfillRequest(String name, int numNodes) throws Exception {
+
+ final _AsyncCreateRequest backfill = this.repr._newBackfillRequest();
+ backfill.setInstanceType(SIConstants.SI_TYPE_BASIC);
+
+ populate(backfill, 500, name, SIConstants.SI_TYPE_BASIC_MEM, numNodes, true);
+
+ return backfill;
}
}
@@ -26,8 +26,11 @@
<lookup-method name="_newCustomizationRequest" bean="nimbus-repr.CustomizationRequest"/>
<lookup-method name="_newShutdownTasks" bean="nimbus-repr.ShutdownTasks"/>
<lookup-method name="_newUsage" bean="nimbus-repr.Usage"/>
- <lookup-method name="_newSpotRequest" bean="nimbus-repr.SpotRequest" />
- <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newRequestInfo" bean="nimbus-repr.RequestInfo" />
+ <lookup-method name="_newSpotRequestInfo" bean="nimbus-repr.SpotRequestInfo" />
+ <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newSpotCreateRequest" bean="nimbus-repr.SpotCreateRequest" />
+ <lookup-method name="_newBackfillRequest" bean="nimbus-repr.BackfillRequest" />
<!-- vm package, writable: -->
@@ -69,12 +72,21 @@
<bean id="nimbus-repr.Usage" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultUsage" />
- <bean id="nimbus-repr.SpotRequest" scope="prototype"
- class="org.nimbustools.api.defaults.repr.DefaultSpotRequest" />
+ <bean id="nimbus-repr.RequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultRequestInfo" />
+
+ <bean id="nimbus-repr.SpotRequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotRequestInfo" />
<bean id="nimbus-repr.SpotPriceEntry" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultSpotPriceEntry" />
+ <bean id="nimbus-repr.BackfillRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultAsyncCreateRequest" />
+
+ <bean id="nimbus-repr.SpotCreateRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotCreateRequest" />
+
<!-- vm package beans: -->
<bean id="nimbus-repr.vm.Kernel" scope="prototype"
@@ -19,7 +19,7 @@
<constructor-arg ref="nimbus-repr.ReprFactory"/>
<constructor-arg ref="nimbus-rm.persistence.DataConvert"/>
<constructor-arg ref="nimbus-rm.loglevels" />
- <constructor-arg ref="nimbus-rm.spotinstances.manager" />
+ <constructor-arg ref="nimbus-rm.async.manager" />
<property name="accounting"
ref="nimbus-rm.accounting" />
@@ -102,7 +102,7 @@
<!-- set after object creation time to avoid circular dep -->
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
</bean>
@@ -408,7 +408,7 @@
<constructor-arg ref="other.MainDataSource" />
<constructor-arg ref="nimbus-rm.loglevels" />
<constructor-arg ref="nimbus-rm.persistence.dbloader" />
- <constructor-arg ref="nimbus-repr.ReprFactory"/>
+ <constructor-arg ref="nimbus-repr.ReprFactory"/>
</bean>
@@ -538,7 +538,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
<!-- definition of this bean is in "resource-locator-ACTIVE.xml" -->
<property name="slotManager"
ref="nimbus-rm.scheduler.SlotManagement" />
@@ -551,8 +551,8 @@
<bean id="nimbus-rm.spotinstances.pricingmodel"
class="$SI{si.pricingmodel}" />
- <bean id="nimbus-rm.spotinstances.manager"
- class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
+ <bean id="nimbus-rm.async.manager"
+ class="org.globus.workspace.spotinstances.AsyncRequestManagerImpl">
<constructor-arg ref="nimbus-rm.persistence.PersistenceAdapter" />
<constructor-arg ref="nimbus-rm.loglevels" />
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
@@ -26,8 +26,11 @@
<lookup-method name="_newCustomizationRequest" bean="nimbus-repr.CustomizationRequest"/>
<lookup-method name="_newShutdownTasks" bean="nimbus-repr.ShutdownTasks"/>
<lookup-method name="_newUsage" bean="nimbus-repr.Usage"/>
- <lookup-method name="_newSpotRequest" bean="nimbus-repr.SpotRequest" />
- <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newRequestInfo" bean="nimbus-repr.RequestInfo" />
+ <lookup-method name="_newSpotRequestInfo" bean="nimbus-repr.SpotRequestInfo" />
+ <lookup-method name="_newSpotPriceEntry" bean="nimbus-repr.SpotPriceEntry" />
+ <lookup-method name="_newSpotCreateRequest" bean="nimbus-repr.SpotCreateRequest" />
+ <lookup-method name="_newBackfillRequest" bean="nimbus-repr.BackfillRequest" />
<!-- vm package, writable: -->
@@ -69,12 +72,21 @@
<bean id="nimbus-repr.Usage" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultUsage" />
- <bean id="nimbus-repr.SpotRequest" scope="prototype"
- class="org.nimbustools.api.defaults.repr.DefaultSpotRequest" />
+ <bean id="nimbus-repr.RequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultRequestInfo" />
+
+ <bean id="nimbus-repr.SpotRequestInfo" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotRequestInfo" />
<bean id="nimbus-repr.SpotPriceEntry" scope="prototype"
class="org.nimbustools.api.defaults.repr.DefaultSpotPriceEntry" />
+ <bean id="nimbus-repr.BackfillRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultAsyncCreateRequest" />
+
+ <bean id="nimbus-repr.SpotCreateRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultSpotCreateRequest" />
+
<!-- vm package beans: -->
<bean id="nimbus-repr.vm.Kernel" scope="prototype"
@@ -19,7 +19,7 @@
<constructor-arg ref="nimbus-repr.ReprFactory"/>
<constructor-arg ref="nimbus-rm.persistence.DataConvert"/>
<constructor-arg ref="nimbus-rm.loglevels" />
- <constructor-arg ref="nimbus-rm.spotinstances.manager" />
+ <constructor-arg ref="nimbus-rm.async.manager" />
<property name="accounting"
ref="nimbus-rm.accounting" />
@@ -102,7 +102,7 @@
<!-- set after object creation time to avoid circular dep -->
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
</bean>
@@ -538,7 +538,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
<property name="siManager"
- ref="nimbus-rm.spotinstances.manager" />
+ ref="nimbus-rm.async.manager" />
<!-- definition of this bean is in "resource-locator-ACTIVE.xml" -->
<property name="slotManager"
ref="nimbus-rm.scheduler.SlotManagement" />
@@ -551,8 +551,8 @@
<bean id="nimbus-rm.spotinstances.pricingmodel"
class="$SI{si.pricingmodel}" />
- <bean id="nimbus-rm.spotinstances.manager"
- class="org.globus.workspace.spotinstances.SpotInstancesManagerImpl">
+ <bean id="nimbus-rm.async.manager"
+ class="org.globus.workspace.spotinstances.AsyncRequestManagerImpl">
<constructor-arg ref="nimbus-rm.persistence.PersistenceAdapter" />
<constructor-arg ref="nimbus-rm.loglevels" />
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
@@ -24,7 +24,7 @@
<!-- set after object creation time to avoid circular dep with home -->
<property name="home" ref="nimbus-rm.home.instance" />
- <property name="preempManager" ref="nimbus-rm.spotinstances.manager" />
+ <property name="preempManager" ref="nimbus-rm.async.manager" />
<property name="vmmpoolDirectoryResource"
value="$COMMON{conf.dir}/vmm-pools" />
<property name="selectionStrategy"
Oops, something went wrong.

0 comments on commit 939faa6

Please sign in to comment.