killbill-aplcache

work on NUTS test replication

3/5/2012 9:29:57 PM

Details

diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBasic.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBasic.java
index 22065ac..e565357 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBasic.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBasic.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.UUID;
 
 import com.ning.billing.account.api.AccountApiException;
+import com.ning.billing.catalog.api.PhaseType;
 import com.ning.billing.dbi.MysqlTestingHelper;
 import com.ning.billing.entitlement.api.user.EntitlementUserApiException;
 
@@ -266,7 +267,7 @@ public class TestBasic {
         Thread.sleep(600000);
     }
 
-    @Test(groups = "stress", enabled = true)
+    @Test(groups = "stress", enabled = false)
     public void stressTest() throws Exception {
         final int maxIterations = 7;
         for (int curIteration = 0; curIteration < maxIterations; curIteration++) {
@@ -481,7 +482,7 @@ public class TestBasic {
         log.info("TEST PASSED !");
     }
 
-    @Test(enabled=false)
+    @Test()
     public void testHappyPath() throws AccountApiException, EntitlementUserApiException {
         long DELAY = 5000 * 10;
 
@@ -518,6 +519,21 @@ public class TestBasic {
 
     }
 
+    @Test
+    public void testForMultipleRecurringPhases() throws AccountApiException, EntitlementUserApiException {
+        Account account = accountUserApi.createAccount(getAccountData(15), null, null);
+        UUID accountId = account.getId();
+
+        String productName = "Blowdart";
+        String planSetName = "DEFAULT";
+
+        SubscriptionBundle bundle = entitlementUserApi.createBundleForAccount(accountId, "testKey");
+        SubscriptionData subscription = (SubscriptionData) entitlementUserApi.createSubscription(bundle.getId(),
+                                        new PlanPhaseSpecifier(productName, ProductCategory.BASE,
+                                        BillingPeriod.NO_BILLING_PERIOD, planSetName, PhaseType.TRIAL), null);
+
+    }
+
     protected AccountData getAccountData(final int billingDay) {
 
         final String someRandomKey = RandomStringUtils.randomAlphanumeric(10);
diff --git a/beatrix/src/test/resources/catalogSample.xml b/beatrix/src/test/resources/catalogSample.xml
index c18816f..bd0e477 100644
--- a/beatrix/src/test/resources/catalogSample.xml
+++ b/beatrix/src/test/resources/catalogSample.xml
@@ -56,6 +56,9 @@ Use Cases to do:
 				<addonProduct>Laser-Scope</addonProduct>
 			</available>
 		</product>
+        <product name="Blowdart">
+            <category>BASE</category>
+        </product>
 		<product name="Shotgun">
 			<category>BASE</category>
 		</product>
@@ -197,6 +200,43 @@ Use Cases to do:
 				</recurringPrice>
 			</finalPhase>
 		</plan>
+        <plan name="blowdart-monthly-with-discount">
+			<product>Blowdart</product>
+			<initialPhases>
+				<phase type="TRIAL">
+					<duration>
+						<unit>DAYS</unit>
+						<number>30</number>
+					</duration>
+					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+					<fixedPrice>
+					</fixedPrice>
+				</phase>
+				<phase type="DISCOUNT">
+					<duration>
+						<unit>MONTHS</unit>
+						<number>6</number>
+					</duration>
+					<billingPeriod>MONTHLY</billingPeriod>
+					<recurringPrice>
+						<price><currency>USD</currency><value>9.95</value></price>
+						<price><currency>EUR</currency><value>9.95</value></price>
+						<price><currency>GBP</currency><value>9.95</value></price>
+					</recurringPrice>
+				</phase>
+			</initialPhases>
+			<finalPhase type="EVERGREEN">
+				<duration>
+					<unit>UNLIMITED</unit>
+				</duration>
+				<billingPeriod>MONTHLY</billingPeriod>
+				<recurringPrice>
+					<price><currency>USD</currency><value>29.95</value></price>
+					<price><currency>EUR</currency><value>29.95</value></price>
+					<price><currency>GBP</currency><value>29.95</value></price>
+				</recurringPrice>
+			</finalPhase>
+		</plan>
 		<plan name="pistol-monthly">
 			<product>Pistol</product>
 			<initialPhases>
@@ -604,9 +644,11 @@ Use Cases to do:
 			</finalPhase>
 		</plan>
 	</plans>
+
 	<priceLists>
 		<defaultPriceList name="DEFAULT"> 
 			<plans>
+                <plan>blowdart-monthly-with-discount</plan>
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
 				<plan>assault-rifle-monthly</plan>