killbill-uncached
Changes
.travis.yml 6(+6 -0)
account/pom.xml 27(+6 -21)
analytics/pom.xml 25(+10 -15)
api/pom.xml 1(+0 -1)
beatrix/pom.xml 25(+4 -21)
catalog/pom.xml 2(+1 -1)
entitlement/pom.xml 52(+14 -38)
entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationMemory.java 1(+1 -0)
invoice/pom.xml 32(+10 -22)
invoice/src/test/java/com/ning/billing/invoice/notification/TestNextBillingDateNotifier.java 2(+1 -1)
payment/pom.xml 18(+9 -9)
pom.xml 73(+52 -21)
util/pom.xml 42(+17 -25)
Details
.travis.yml 6(+6 -0)
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..93b1a6e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,6 @@
+language: java
+script: mvn clean install -Ptravis
+
+notifications:
+ email:
+ - ri-dev@ning.com
account/pom.xml 27(+6 -21)
diff --git a/account/pom.xml b/account/pom.xml
index 28c7a7a..c48b8b2 100644
--- a/account/pom.xml
+++ b/account/pom.xml
@@ -25,14 +25,6 @@
<artifactId>jdbi</artifactId>
</dependency>
<dependency>
- <groupId>com.ning.jdbi</groupId>
- <artifactId>jdbi-metrics</artifactId>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </dependency>
- <dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<scope>provided</scope>
@@ -77,18 +69,18 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -101,13 +93,6 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <groups>setup,fast</groups>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
diff --git a/account/src/test/java/com/ning/billing/account/dao/TestSimpleAccountDao.java b/account/src/test/java/com/ning/billing/account/dao/TestSimpleAccountDao.java
index 8c0e3c2..fd99ec5 100644
--- a/account/src/test/java/com/ning/billing/account/dao/TestSimpleAccountDao.java
+++ b/account/src/test/java/com/ning/billing/account/dao/TestSimpleAccountDao.java
@@ -380,7 +380,7 @@ public class TestSimpleAccountDao extends AccountDaoTestBase {
accountDao.update(updatedAccount);
}
- @Test(groups={"slow"},enabled=true)
+ @Test
public void testDelete() throws AccountApiException, EntityPersistenceException {
Account a = createTestAccountBuilder().build();
analytics/pom.xml 25(+10 -15)
diff --git a/analytics/pom.xml b/analytics/pom.xml
index 8a655ca..d5fff4c 100644
--- a/analytics/pom.xml
+++ b/analytics/pom.xml
@@ -31,16 +31,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.ning.billing</groupId>
<artifactId>killbill-api</artifactId>
</dependency>
@@ -54,11 +44,6 @@
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>org.antlr</groupId>
<artifactId>stringtemplate</artifactId>
<scope>runtime</scope>
@@ -108,6 +93,16 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
</build>
diff --git a/analytics/src/test/java/com/ning/billing/analytics/dao/TestAnalyticsDao.java b/analytics/src/test/java/com/ning/billing/analytics/dao/TestAnalyticsDao.java
index e31d562..b7613cc 100644
--- a/analytics/src/test/java/com/ning/billing/analytics/dao/TestAnalyticsDao.java
+++ b/analytics/src/test/java/com/ning/billing/analytics/dao/TestAnalyticsDao.java
@@ -118,13 +118,13 @@ public class TestAnalyticsDao
}
}
- @AfterClass(alwaysRun = true)
+ @AfterClass(groups = "slow")
public void stopMysql()
{
helper.stopMysql();
}
- @BeforeMethod
+ @BeforeMethod(groups = "slow")
public void cleanup() throws Exception
{
helper.cleanupTable("bst");
api/pom.xml 1(+0 -1)
diff --git a/api/pom.xml b/api/pom.xml
index de14404..ac7f6c9 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -58,7 +58,6 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
-
</dependencies>
<build>
</build>
beatrix/pom.xml 25(+4 -21)
diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index 032ae4a..28f478f 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -68,11 +68,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.ning.jdbi</groupId>
- <artifactId>jdbi-metrics</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
<scope>test</scope>
@@ -94,32 +89,20 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <groups>fast,slow, stress</groups>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
index 8b4cd27..9fca2bf 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegration.java
@@ -76,6 +76,7 @@ import com.ning.billing.invoice.api.InvoiceUserApi;
import com.ning.billing.util.clock.ClockMock;
import com.ning.billing.util.bus.BusService;
+@Test(groups = "slow")
@Guice(modules = {MockModule.class})
public class TestIntegration {
private static final int NUMBER_OF_DECIMALS = 4;
@@ -141,7 +142,7 @@ public class TestIntegration {
helper.initDb(utilDdl);
}
- @BeforeSuite(alwaysRun = true)
+ @BeforeSuite(groups = "slow")
public void setup() throws Exception{
setupMySQL();
@@ -164,7 +165,7 @@ public class TestIntegration {
accountUserApi = accountService.getAccountUserApi();
}
- @AfterSuite(alwaysRun = true)
+ @AfterSuite(groups = "slow")
public void tearDown() throws Exception {
lifecycle.fireShutdownSequencePriorEventUnRegistration();
busService.getBus().unregister(busHandler);
@@ -173,7 +174,7 @@ public class TestIntegration {
}
- @BeforeMethod(alwaysRun = true)
+ @BeforeMethod(groups = "slow")
public void setupTest() {
log.warn("\n");
@@ -183,7 +184,7 @@ public class TestIntegration {
cleanupData();
}
- @AfterMethod(alwaysRun = true)
+ @AfterMethod(groups = "slow")
public void cleanupTest() {
log.warn("DONE WITH TEST\n");
}
@@ -276,7 +277,7 @@ public class TestIntegration {
Thread.sleep(600000);
}
- @Test(groups = "stress", enabled = false)
+ @Test(groups = {"slow", "stress"}, enabled = false)
public void stressTest() throws Exception {
final int maxIterations = 7;
for (int curIteration = 0; curIteration < maxIterations; curIteration++) {
catalog/pom.xml 2(+1 -1)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index bf0d550..dee138d 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -27,7 +27,7 @@
<dependency>
<groupId>com.ning.billing</groupId>
<artifactId>killbill-api</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>com.ning.billing</groupId>
<artifactId>killbill-util</artifactId>
diff --git a/catalog/src/test/java/com/ning/billing/catalog/TestVersionedCatalog.java b/catalog/src/test/java/com/ning/billing/catalog/TestVersionedCatalog.java
index fbc99df..fb61be7 100644
--- a/catalog/src/test/java/com/ning/billing/catalog/TestVersionedCatalog.java
+++ b/catalog/src/test/java/com/ning/billing/catalog/TestVersionedCatalog.java
@@ -49,7 +49,7 @@ public class TestVersionedCatalog {
private final VersionedCatalogLoader loader = new VersionedCatalogLoader(new DefaultClock());
private VersionedCatalog vc;
- @BeforeClass(groups={"setup"})
+ @BeforeClass(groups={"fast"})
public void setUp() throws ServiceException {
vc = loader.load(Resources.getResource("versionedCatalog").toString());
}
entitlement/pom.xml 52(+14 -38)
diff --git a/entitlement/pom.xml b/entitlement/pom.xml
index 176e14b..cccf568 100644
--- a/entitlement/pom.xml
+++ b/entitlement/pom.xml
@@ -25,10 +25,6 @@
<artifactId>jdbi</artifactId>
</dependency>
<dependency>
- <groupId>com.ning.jdbi</groupId>
- <artifactId>jdbi-metrics</artifactId>
- </dependency>
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
@@ -67,22 +63,14 @@
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
+ <!-- Same here, this is really debatable whether or not we should keep that here -->
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-account</artifactId>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
@@ -120,18 +108,21 @@
<artifactId>stringtemplate</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <groups>fast,slow</groups>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
@@ -143,19 +134,4 @@
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>test-stress</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <groups>stress</groups>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationMemory.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationMemory.java
index e0de602..6ea53bc 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationMemory.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationMemory.java
@@ -23,6 +23,7 @@ import com.google.inject.Injector;
import com.google.inject.Stage;
import com.ning.billing.entitlement.glue.MockEngineModuleMemory;
+@Test(groups = "fast")
public class TestMigrationMemory extends TestMigration {
@Override
protected Injector getInjector() {
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationSql.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationSql.java
index c395fed..587ca46 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationSql.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/migration/TestMigrationSql.java
@@ -23,6 +23,7 @@ import com.google.inject.Injector;
import com.google.inject.Stage;
import com.ning.billing.entitlement.glue.MockEngineModuleSql;
+@Test(groups = "slow")
public class TestMigrationSql extends TestMigration {
@Override
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/api/TestApiBase.java b/entitlement/src/test/java/com/ning/billing/entitlement/api/TestApiBase.java
index 9bcb002..6a5520d 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/api/TestApiBase.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/api/TestApiBase.java
@@ -114,7 +114,7 @@ public abstract class TestApiBase {
protected abstract Injector getInjector();
- @AfterClass(alwaysRun=true)
+ @AfterClass(alwaysRun = true)
public void tearDown() {
try {
((DefaultBusService) busService).stopBus();
@@ -127,7 +127,7 @@ public abstract class TestApiBase {
//if(helper != null) { helper.stopMysql(); }
}
- @BeforeClass(alwaysRun=true)
+ @BeforeClass(alwaysRun = true)
public void setup() {
loadSystemPropertiesFromClasspath("/entitlement.properties");
@@ -181,7 +181,7 @@ public abstract class TestApiBase {
migrationApi = entitlementService.getMigrationApi();
}
- @BeforeMethod(alwaysRun=true)
+ @BeforeMethod(alwaysRun = true)
public void setupTest() {
log.warn("RESET TEST FRAMEWORK\n\n");
@@ -202,7 +202,7 @@ public abstract class TestApiBase {
((Engine)entitlementService).start();
}
- @AfterMethod(alwaysRun=true)
+ @AfterMethod(alwaysRun = true)
public void cleanupTest() {
try {
busService.getBus().unregister(testListener);
@@ -213,11 +213,6 @@ public abstract class TestApiBase {
log.warn("DONE WITH TEST\n");
}
- @AfterMethod
- public void am(ITestResult result) {
- System.out.println("CURRENT METHOD NAME :" + result.getMethod().getMethodName());
- }
-
protected SubscriptionData createSubscription(final String productName, final BillingPeriod term, final String planSet) throws EntitlementUserApiException {
return createSubscriptionWithBundle(bundle.getId(), productName, term, planSet);
}
invoice/pom.xml 32(+10 -22)
diff --git a/invoice/pom.xml b/invoice/pom.xml
index 9d68110..ccef93e 100644
--- a/invoice/pom.xml
+++ b/invoice/pom.xml
@@ -65,20 +65,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
@@ -93,23 +79,25 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </dependency>
- <dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
</build>
diff --git a/invoice/src/test/java/com/ning/billing/invoice/notification/TestNextBillingDateNotifier.java b/invoice/src/test/java/com/ning/billing/invoice/notification/TestNextBillingDateNotifier.java
index d82c2d9..0b2a456 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/notification/TestNextBillingDateNotifier.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/notification/TestNextBillingDateNotifier.java
@@ -106,7 +106,7 @@ public class TestNextBillingDateNotifier {
}
- @BeforeClass(groups={"setup"})
+ @BeforeClass(groups={"slow"})
public void setup() throws ServiceException, IOException, ClassNotFoundException, SQLException {
//TestApiBase.loadSystemPropertiesFromClasspath("/entitlement.properties");
final Injector g = Guice.createInjector(Stage.PRODUCTION, new AbstractModule() {
diff --git a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
index 26983fc..87b29ba 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
@@ -61,6 +61,7 @@ import com.ning.billing.util.bus.BusService;
import com.ning.billing.util.bus.DefaultBusService;
import com.ning.billing.util.globallocker.GlobalLocker;
+@Test(groups = "slow")
@Guice(modules = {MockModule.class})
public class TestInvoiceDispatcher {
Logger log = LoggerFactory.getLogger(TestInvoiceDispatcher.class);
@@ -85,9 +86,9 @@ public class TestInvoiceDispatcher {
- @BeforeSuite(alwaysRun = true)
- public void setup() throws IOException
- {
+ @BeforeSuite(groups = "slow")
+ public void setup() throws IOException
+ {
final String entitlementDdl = IOUtils.toString(TestInvoiceDispatcher.class.getResourceAsStream("/com/ning/billing/entitlement/ddl.sql"));
@@ -114,16 +115,15 @@ public class TestInvoiceDispatcher {
} catch (Exception e) {
log.warn("Failed to tearDown test properly ", e);
}
-
- }
-
- @Test(groups={"fast"}, enabled=true)
- public void testDryrunInvoice() throws InvoiceApiException {
- UUID accountId = UUID.randomUUID();
- UUID subscriptionId = UUID.randomUUID();
+ }
+ @Test(groups={"slow"}, enabled=true)
+ public void testDryrunInvoice() throws InvoiceApiException {
+ UUID accountId = UUID.randomUUID();
+ UUID subscriptionId = UUID.randomUUID();
AccountUserApi accountUserApi = BrainDeadProxyFactory.createBrainDeadProxyFor(AccountUserApi.class);
Account account = BrainDeadProxyFactory.createBrainDeadProxyFor(Account.class);
+
((ZombieControl)accountUserApi).addResult("getAccountById", account);
((ZombieControl)account).addResult("getCurrency", Currency.USD);
((ZombieControl)account).addResult("getId", accountId);
payment/pom.xml 18(+9 -9)
diff --git a/payment/pom.xml b/payment/pom.xml
index 398a6cc..fc660f7 100644
--- a/payment/pom.xml
+++ b/payment/pom.xml
@@ -102,14 +102,14 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
- <scope>test</scope>
- </dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
pom.xml 73(+52 -21)
diff --git a/pom.xml b/pom.xml
index 9a6662e..c0c46a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,7 @@
<artifactId>killbill-api</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -71,6 +72,7 @@
<artifactId>killbill-account</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -82,6 +84,7 @@
<artifactId>killbill-entitlement</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -93,6 +96,7 @@
<artifactId>killbill-payment</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -104,6 +108,7 @@
<artifactId>killbill-catalog</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -115,6 +120,7 @@
<artifactId>killbill-invoice</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
@@ -126,6 +132,7 @@
<artifactId>killbill-util</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
@@ -177,33 +184,18 @@
<version>1.2.0</version>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <version>5.0.11</version>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
+ <version>5.0.12</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
- <version>5.0.11</version>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <version>5.0.12</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.yammer.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- <version>2.0.0-BETA17</version>
- </dependency>
- <dependency>
- <groupId>com.yammer.metrics</groupId>
- <artifactId>metrics-guice</artifactId>
- <version>2.0.0-BETA17</version>
- </dependency>
- <dependency>
- <groupId>com.ning.jdbi</groupId>
- <artifactId>jdbi-metrics</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0.1</version>
@@ -403,6 +395,7 @@
<exclude>**/*.dont-let-git-remove-this-directory</exclude>
<exclude>**/test-output/**</exclude>
<exclude>**/bin/**</exclude>
+ <exclude>.travis.yml</exclude>
</excludes>
</configuration>
</execution>
@@ -440,6 +433,7 @@
<version>2.11</version>
<configuration>
<useManifestOnlyJar>false</useManifestOnlyJar>
+ <groups>fast,slow</groups>
<systemPropertyVariables>
<log4j.configuration>file:${project.basedir}/src/test/resources/log4j.xml</log4j.configuration>
</systemPropertyVariables>
@@ -480,11 +474,14 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
+ <groups>fast,slow</groups>
<useManifestOnlyJar>false</useManifestOnlyJar>
<systemPropertyVariables>
<log4j.configuration>file:${project.basedir}/src/test/resources/log4j.xml</log4j.configuration>
<com.ning.billing.dbi.test.useLocalDb>true</com.ning.billing.dbi.test.useLocalDb>
<com.ning.billing.dbi.jdbc.url>jdbc:mysql://127.0.0.1:3306/test_killbill</com.ning.billing.dbi.jdbc.url>
+ <file.encoding>UTF-8</file.encoding>
+ <user.timezone>GMT</user.timezone>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -492,6 +489,40 @@
</build>
</profile>
<profile>
+ <id>travis</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.11</version>
+ <configuration>
+ <groups>fast</groups>
+ <systemPropertyVariables>
+ <file.encoding>UTF-8</file.encoding>
+ <user.timezone>GMT</user.timezone>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>test-stress</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.11</version>
+ <configuration>
+ <groups>stress</groups>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
util/pom.xml 42(+17 -25)
diff --git a/util/pom.xml b/util/pom.xml
index 10cb192..dc5c251 100644
--- a/util/pom.xml
+++ b/util/pom.xml
@@ -8,7 +8,8 @@
OR CONDITIONS OF ANY KIND, either express or implied. See the ~ License for
the specific language governing permissions and limitations ~ under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ning.billing</groupId>
@@ -33,44 +34,35 @@
<artifactId>jdbi</artifactId>
</dependency>
<dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>org.skife.config</groupId>
- <artifactId>config-magic</artifactId>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>com.ning.jdbi</groupId>
- <artifactId>jdbi-metrics</artifactId>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-mxj</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
+ <artifactId>mysql-connector-mxj-db-files</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.antlr</groupId>
- <artifactId>stringtemplate</artifactId>
- <scope>runtime</scope>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
</dependency>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
+ <groupId>org.skife.config</groupId>
+ <artifactId>config-magic</artifactId>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management</artifactId>
- <scope>test</scope>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>management-dbfiles</artifactId>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/util/src/test/java/com/ning/billing/dbi/DBIProvider.java b/util/src/test/java/com/ning/billing/dbi/DBIProvider.java
index 68566d2..1f22d5d 100644
--- a/util/src/test/java/com/ning/billing/dbi/DBIProvider.java
+++ b/util/src/test/java/com/ning/billing/dbi/DBIProvider.java
@@ -20,10 +20,6 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import com.jolbox.bonecp.BoneCPConfig;
import com.jolbox.bonecp.BoneCPDataSource;
-import com.ning.jdbi.metrics.JdbiGroupStrategy;
-import com.ning.jdbi.metrics.MetricsTimingCollector;
-import com.ning.jdbi.metrics.SqlJdbiGroupStrategy;
-import com.yammer.metrics.core.MetricsRegistry;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.IDBI;
import org.skife.jdbi.v2.TimingCollector;
@@ -34,13 +30,11 @@ import java.util.concurrent.TimeUnit;
public class DBIProvider implements Provider<IDBI>
{
- private final MetricsRegistry metricsRegistry;
private final DbiConfig config;
@Inject
- public DBIProvider(final MetricsRegistry metricsRegistry, final DbiConfig config)
+ public DBIProvider(final DbiConfig config)
{
- this.metricsRegistry = metricsRegistry;
this.config = config;
}
@@ -64,10 +58,6 @@ public class DBIProvider implements Provider<IDBI>
final SQLLog log = new Log4JLog();
dbi.setSQLLog(log);
- final JdbiGroupStrategy jdbiGroupStrategy = new SqlJdbiGroupStrategy();
- final TimingCollector timingCollector = new MetricsTimingCollector(metricsRegistry, jdbiGroupStrategy, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
- dbi.setTimingCollector(timingCollector);
-
return dbi;
}
-}
\ No newline at end of file
+}
diff --git a/util/src/test/java/com/ning/billing/util/bus/TestEventBus.java b/util/src/test/java/com/ning/billing/util/bus/TestEventBus.java
index 85849c5..2310f1c 100644
--- a/util/src/test/java/com/ning/billing/util/bus/TestEventBus.java
+++ b/util/src/test/java/com/ning/billing/util/bus/TestEventBus.java
@@ -31,13 +31,13 @@ public class TestEventBus {
private Bus eventBus;
- @BeforeClass
+ @BeforeClass(groups = "slow")
public void setup() {
eventBus = new InMemoryBus();
eventBus.start();
}
- @AfterClass
+ @AfterClass(groups = "slow")
public void tearDown() {
eventBus.stop();
}
@@ -97,7 +97,7 @@ public class TestEventBus {
}
}
- @Test
+ @Test(groups = "slow")
public void testSimple() {
try {
@@ -116,7 +116,7 @@ public class TestEventBus {
}
}
- @Test
+ @Test(groups = "slow")
public void testDifferentType() {
try {
diff --git a/util/src/test/java/com/ning/billing/util/customfield/TestFieldStore.java b/util/src/test/java/com/ning/billing/util/customfield/TestFieldStore.java
index f7c16e4..9bc67dd 100644
--- a/util/src/test/java/com/ning/billing/util/customfield/TestFieldStore.java
+++ b/util/src/test/java/com/ning/billing/util/customfield/TestFieldStore.java
@@ -34,13 +34,13 @@ import com.ning.billing.util.customfield.dao.FieldStoreDao;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
-@Test(groups={"util"})
+@Test(groups = {"util", "slow"})
public class TestFieldStore {
Logger log = LoggerFactory.getLogger(TestFieldStore.class);
private final MysqlTestingHelper helper = new MysqlTestingHelper();
private IDBI dbi;
- @BeforeClass(alwaysRun = true)
+ @BeforeClass(groups = {"util", "slow"})
protected void setup() throws IOException {
// Health check test to make sure MySQL is setup properly
try {
@@ -57,7 +57,7 @@ public class TestFieldStore {
}
}
- @AfterClass(alwaysRun = true)
+ @AfterClass(groups = {"util", "slow"})
public void stopMysql()
{
helper.stopMysql();
diff --git a/util/src/test/java/com/ning/billing/util/globallocker/TestMysqlGlobalLocker.java b/util/src/test/java/com/ning/billing/util/globallocker/TestMysqlGlobalLocker.java
index 9f60162..6f2facd 100644
--- a/util/src/test/java/com/ning/billing/util/globallocker/TestMysqlGlobalLocker.java
+++ b/util/src/test/java/com/ning/billing/util/globallocker/TestMysqlGlobalLocker.java
@@ -39,6 +39,7 @@ import com.ning.billing.util.globallocker.LockFailedException;
import com.ning.billing.util.globallocker.MySqlGlobalLocker;
import com.ning.billing.util.globallocker.GlobalLocker.LockerService;
+@Test(groups = "slow")
@Guice(modules=TestMysqlGlobalLocker.TestMysqlGlobalLockerModule.class)
public class TestMysqlGlobalLocker {
@@ -48,14 +49,14 @@ public class TestMysqlGlobalLocker {
@Inject
private MysqlTestingHelper helper;
- @BeforeClass(alwaysRun=true)
+ @BeforeClass(groups = "slow")
public void setup() throws IOException {
final String testDdl = IOUtils.toString(TestMysqlGlobalLocker.class.getResourceAsStream("/com/ning/billing/util/ddl_test.sql"));
helper.startMysql();
helper.initDb(testDdl);
}
- @AfterClass(alwaysRun=true)
+ @AfterClass(groups = "slow")
public void tearDown() {
helper.stopMysql();
}
diff --git a/util/src/test/java/com/ning/billing/util/notificationq/dao/TestNotificationSqlDao.java b/util/src/test/java/com/ning/billing/util/notificationq/dao/TestNotificationSqlDao.java
index 4c812cb..891cadf 100644
--- a/util/src/test/java/com/ning/billing/util/notificationq/dao/TestNotificationSqlDao.java
+++ b/util/src/test/java/com/ning/billing/util/notificationq/dao/TestNotificationSqlDao.java
@@ -45,6 +45,7 @@ import com.ning.billing.util.notificationq.dao.NotificationSqlDao.NotificationSq
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
+@Test(groups = "slow")
@Guice(modules = TestNotificationSqlDao.TestNotificationSqlDaoModule.class)
public class TestNotificationSqlDao {
@@ -64,7 +65,7 @@ public class TestNotificationSqlDao {
helper.initDb(ddl);
}
- @BeforeSuite(alwaysRun = true)
+ @BeforeSuite(groups = "slow")
public void setup() {
try {
startMysql();
@@ -74,14 +75,14 @@ public class TestNotificationSqlDao {
}
}
- @AfterSuite(alwaysRun = true)
+ @AfterSuite(groups = "slow")
public void stopMysql()
{
helper.stopMysql();
}
- @BeforeTest
+ @BeforeTest(groups = "slow")
public void cleanupDb() {
dbi.withHandle(new HandleCallback<Void>() {
diff --git a/util/src/test/java/com/ning/billing/util/notificationq/TestNotificationQueue.java b/util/src/test/java/com/ning/billing/util/notificationq/TestNotificationQueue.java
index 1e319d7..f9e874e 100644
--- a/util/src/test/java/com/ning/billing/util/notificationq/TestNotificationQueue.java
+++ b/util/src/test/java/com/ning/billing/util/notificationq/TestNotificationQueue.java
@@ -56,6 +56,7 @@ import com.ning.billing.util.clock.ClockMock;
import com.ning.billing.util.notificationq.NotificationQueueService.NotificationQueueHandler;
import com.ning.billing.util.notificationq.dao.NotificationSqlDao;
+@Test(groups = "slow")
@Guice(modules = TestNotificationQueue.TestNotificationQueueModule.class)
public class TestNotificationQueue {
Logger log = LoggerFactory.getLogger(TestNotificationQueue.class);
@@ -82,18 +83,18 @@ public class TestNotificationQueue {
helper.initDb(testDdl);
}
- @BeforeSuite(alwaysRun = true)
+ @BeforeSuite(groups="slow")
public void setup() throws Exception {
startMysql();
dao = dbi.onDemand(DummySqlTest.class);
}
- @AfterClass(alwaysRun = true)
+ @AfterClass(groups="slow")
public void tearDown() {
helper.stopMysql();
}
- @BeforeTest
+ @BeforeTest(groups="slow")
public void beforeTest() {
dbi.withHandle(new HandleCallback<Void>() {
@@ -116,7 +117,7 @@ public class TestNotificationQueue {
* callback with the correct key when the time is ready
* @throws Exception
*/
- @Test(groups={"fast"}, enabled = true)
+ @Test(groups={"slow"}, enabled = true)
public void testSimpleNotification() throws Exception {
final Map<String, Boolean> expectedNotifications = new TreeMap<String, Boolean>();
@@ -181,7 +182,7 @@ public class TestNotificationQueue {
queue.stopQueue();
}
- @Test
+ @Test(groups="slow")
public void testManyNotifications() throws InterruptedException {
final Map<String, Boolean> expectedNotifications = new TreeMap<String, Boolean>();
@@ -269,7 +270,7 @@ public class TestNotificationQueue {
* callback with the correct key when the time is ready
* @throws Exception
*/
- @Test(groups={"fast"}, enabled = true)
+ @Test(groups={"slow"}, enabled = true)
public void testMultipleHandlerNotification() throws Exception {
final Map<String, Boolean> expectedNotificationsFred = new TreeMap<String, Boolean>();
diff --git a/util/src/test/java/com/ning/billing/util/tag/TestTagStore.java b/util/src/test/java/com/ning/billing/util/tag/TestTagStore.java
index 0952388..90ccaea 100644
--- a/util/src/test/java/com/ning/billing/util/tag/TestTagStore.java
+++ b/util/src/test/java/com/ning/billing/util/tag/TestTagStore.java
@@ -47,7 +47,6 @@ import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
-
@Test(groups={"slow"})
@Guice(modules = TagStoreModuleMock.class)
public class TestTagStore {
@@ -74,7 +73,7 @@ public class TestTagStore {
private final Logger log = LoggerFactory.getLogger(TestTagStore.class);
- @BeforeClass(alwaysRun = true)
+ @BeforeClass(groups="slow")
protected void setup() throws IOException {
// Health check test to make sure MySQL is setup properly
try {
@@ -95,7 +94,7 @@ public class TestTagStore {
}
}
- @AfterClass(alwaysRun = true)
+ @AfterClass(groups="slow")
public void stopMysql()
{
helper.stopMysql();
@@ -128,7 +127,7 @@ public class TestTagStore {
} catch (Throwable ignore) {
}
}
- @Test
+ @Test(groups="slow")
public void testTagCreationAndRetrieval() {
UUID accountId = UUID.randomUUID();
@@ -150,7 +149,7 @@ public class TestTagStore {
}
- @Test
+ @Test(groups="slow")
public void testControlTagCreation() {
UUID accountId = UUID.randomUUID();
TagStore tagStore = new DefaultTagStore(accountId, ACCOUNT_TYPE);
@@ -172,7 +171,7 @@ public class TestTagStore {
assertEquals(tagStore.generateInvoice(), false);
}
- @Test
+ @Test(groups="slow")
public void testDescriptiveTagCreation() {
UUID accountId = UUID.randomUUID();
TagStore tagStore = new DefaultTagStore(accountId, ACCOUNT_TYPE);
@@ -202,7 +201,7 @@ public class TestTagStore {
assertEquals(tagStore.generateInvoice(), true);
}
- @Test
+ @Test(groups="slow")
public void testMixedTagCreation() {
UUID accountId = UUID.randomUUID();
TagStore tagStore = new DefaultTagStore(accountId, ACCOUNT_TYPE);
@@ -236,7 +235,7 @@ public class TestTagStore {
assertEquals(tagStore.generateInvoice(), false);
}
- @Test
+ @Test(groups="slow")
public void testControlTags() {
UUID accountId = UUID.randomUUID();
TagStore tagStore = new DefaultTagStore(accountId, ACCOUNT_TYPE);
@@ -254,13 +253,13 @@ public class TestTagStore {
assertEquals(tagStore.processPayment(), false);
}
- @Test(expectedExceptions = TagDefinitionApiException.class)
+ @Test(groups="slow", expectedExceptions = TagDefinitionApiException.class)
public void testTagDefinitionCreationWithControlTagName() throws TagDefinitionApiException {
String definitionName = ControlTagType.AUTO_PAY_OFF.toString();
tagDefinitionDao.create(definitionName, "This should break", "test");
}
- @Test
+ @Test(groups="slow")
public void testTagDefinitionDeletionForUnusedDefinition() throws TagDefinitionApiException {
String definitionName = "TestTag1234";
tagDefinitionDao.create(definitionName, "Some test tag", "test");
@@ -273,7 +272,7 @@ public class TestTagStore {
assertNull(tagDefinition);
}
- @Test(expectedExceptions = TagDefinitionApiException.class)
+ @Test(groups="slow", expectedExceptions = TagDefinitionApiException.class)
public void testTagDefinitionDeletionForDefinitionInUse() throws TagDefinitionApiException {
String definitionName = "TestTag12345";
tagDefinitionDao.create(definitionName, "Some test tag", "test");
@@ -295,7 +294,7 @@ public class TestTagStore {
tagDefinitionDao.deleteTagDefinition(definitionName);
}
- @Test
+ @Test(groups="slow")
public void testDeleteAllTagsForDefinitionInUse() {
String definitionName = "TestTag1234567";
try {
@@ -331,7 +330,7 @@ public class TestTagStore {
}
}
- @Test
+ @Test(groups="slow")
public void testDeleteAllTagsForDefinitionNotInUse() {
String definitionName = "TestTag4321";
try {
@@ -356,7 +355,7 @@ public class TestTagStore {
}
}
- @Test(expectedExceptions = TagDefinitionApiException.class)
+ @Test(groups="slow", expectedExceptions = TagDefinitionApiException.class)
public void testDeleteAllTagsForDefinitionWithWrongName() throws TagDefinitionApiException {
String definitionName = "TestTag654321";
String wrongDefinitionName = "TestTag564321";
@@ -378,7 +377,7 @@ public class TestTagStore {
}
}
- @Test
+ @Test(groups="slow")
public void testGetTagDefinitions() {
List<TagDefinition> definitionList = tagDefinitionDao.getTagDefinitions();
assertTrue(definitionList.size() >= ControlTagType.values().length);
diff --git a/util/src/test/java/com/ning/billing/util/validation/TestValidationManager.java b/util/src/test/java/com/ning/billing/util/validation/TestValidationManager.java
index bb7ac85..1848950 100644
--- a/util/src/test/java/com/ning/billing/util/validation/TestValidationManager.java
+++ b/util/src/test/java/com/ning/billing/util/validation/TestValidationManager.java
@@ -41,8 +41,8 @@ public class TestValidationManager {
private static final String TABLE_NAME = "validation_test";
private ValidationManager vm;
-
- @BeforeClass(alwaysRun = true)
+
+ @BeforeClass(groups = "slow")
public void setup() throws IOException {
setupDatabase();
setupDao();
@@ -61,7 +61,7 @@ public class TestValidationManager {
helper.initDb(testDdl);
}
- @AfterClass(alwaysRun = true)
+ @AfterClass(groups = "slow")
public void tearDown() {
stopDatabase();
}
@@ -70,7 +70,7 @@ public class TestValidationManager {
helper.stopMysql();
}
- @Test
+ @Test(groups = "slow")
public void testRetrievingColumnInfo() {
Collection<ColumnInfo> columnInfoList = vm.getTableInfo(TABLE_NAME);
assertEquals(columnInfoList.size(), 4);
@@ -83,7 +83,7 @@ public class TestValidationManager {
assertEquals(numericColumnInfo.getPrecision(), 10);
}
- @Test
+ @Test(groups = "slow")
public void testSimpleConfiguration() {
String STRING_FIELD_2 = "column2";
String STRING_FIELD_2_PROPERTY = "stringField2";