killbill-memoizeit

usage: update tests to new conventions See #38. Signed-off-by:

2/18/2013 3:16:40 AM

Details

diff --git a/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleNoDB.java b/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleNoDB.java
new file mode 100644
index 0000000..57ee1bf
--- /dev/null
+++ b/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleNoDB.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2010-2013 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.usage.glue;
+
+import com.ning.billing.GuicyKillbillTestNoDBModule;
+
+public class TestUsageModuleNoDB extends TestUsageModule {
+
+    @Override
+    public void configure() {
+        super.configure();
+
+        install(new GuicyKillbillTestNoDBModule());
+    }
+}
diff --git a/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleWithEmbeddedDB.java b/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleWithEmbeddedDB.java
new file mode 100644
index 0000000..8a3b6ac
--- /dev/null
+++ b/usage/src/test/java/com/ning/billing/usage/glue/TestUsageModuleWithEmbeddedDB.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2010-2013 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.usage.glue;
+
+import com.ning.billing.GuicyKillbillTestWithEmbeddedDBModule;
+
+public class TestUsageModuleWithEmbeddedDB extends TestUsageModule {
+
+    @Override
+    public void configure() {
+        super.configure();
+
+        install(new GuicyKillbillTestWithEmbeddedDBModule());
+    }
+}
diff --git a/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteNoDB.java b/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteNoDB.java
new file mode 100644
index 0000000..0721f7a
--- /dev/null
+++ b/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteNoDB.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2010-2013 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.usage;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+
+import com.ning.billing.GuicyKillbillTestSuiteNoDB;
+import com.ning.billing.usage.glue.TestUsageModuleNoDB;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+public class UsageTestSuiteNoDB extends GuicyKillbillTestSuiteNoDB {
+
+    @BeforeClass(groups = "fast")
+    protected void setup() throws Exception {
+        final Injector injector = Guice.createInjector(new TestUsageModuleNoDB());
+        injector.injectMembers(this);
+    }
+
+    @BeforeMethod(groups = "fast")
+    public void setupTest() {
+    }
+
+    @AfterMethod(groups = "fast")
+    public void cleanupTest() {
+    }
+}
diff --git a/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteWithEmbeddedDB.java b/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteWithEmbeddedDB.java
index 831e946..28ee828 100644
--- a/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteWithEmbeddedDB.java
+++ b/usage/src/test/java/com/ning/billing/usage/UsageTestSuiteWithEmbeddedDB.java
@@ -16,8 +16,29 @@
 
 package com.ning.billing.usage;
 
-import com.ning.billing.KillbillTestSuiteWithEmbeddedDB;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
 
-public class UsageTestSuiteWithEmbeddedDB extends KillbillTestSuiteWithEmbeddedDB {
+import com.ning.billing.GuicyKillbillTestSuiteWithEmbeddedDB;
+import com.ning.billing.usage.glue.TestUsageModuleWithEmbeddedDB;
 
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+public class UsageTestSuiteWithEmbeddedDB extends GuicyKillbillTestSuiteWithEmbeddedDB {
+
+    @BeforeClass(groups = "slow")
+    protected void setup() throws Exception {
+        final Injector injector = Guice.createInjector(new TestUsageModuleWithEmbeddedDB());
+        injector.injectMembers(this);
+    }
+
+    @BeforeMethod(groups = "fast")
+    public void setupTest() {
+    }
+
+    @AfterMethod(groups = "fast")
+    public void cleanupTest() {
+    }
 }