ctubbsii closed pull request #1050: Fix #871 Use regular jar for ITs module
URL: https://github.com/apache/fluo/pull/1050
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/AccumuloProps.java
b/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/AccumuloProps.java
index c67b7822..cc63d6f3 100644
---
a/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/AccumuloProps.java
+++
b/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/AccumuloProps.java
@@ -17,12 +17,13 @@
public class AccumuloProps {
- public static final String VFS_CONTEXT_CLASSPATH_PROPERTY =
"general.vfs.context.classpath.";
- public static final String TABLE_CLASSPATH = "table.classpath.context";
public static final String TABLE_BLOCKCACHE_ENABLED =
"table.cache.block.enable";
+ public static final String TABLE_CLASSPATH = "table.classpath.context";
public static final String TABLE_FORMATTER_CLASS = "table.formatter";
- public static final String TABLE_GROUP_PREFIX = "table.group.";
public static final String TABLE_GROUPS_ENABLED = "table.groups.enabled";
- public static final Object TABLE_ITERATOR_PREFIX = "table.iterator.";
+ public static final String TABLE_GROUP_PREFIX = "table.group.";
+ public static final String TABLE_ITERATOR_PREFIX = "table.iterator.";
+ public static final String TABLE_MAJC_RATIO = "table.compaction.major.ratio";
+ public static final String VFS_CONTEXT_CLASSPATH_PROPERTY =
"general.vfs.context.classpath.";
}
diff --git a/modules/integration/pom.xml b/modules/integration-tests/pom.xml
similarity index 81%
rename from modules/integration/pom.xml
rename to modules/integration-tests/pom.xml
index bf464b7e..73714717 100644
--- a/modules/integration/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -21,95 +21,80 @@
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <artifactId>fluo-integration</artifactId>
- <name>Apache Fluo Integration</name>
+ <artifactId>fluo-integration-tests</artifactId>
+ <name>Apache Fluo Integration Tests</name>
<description>This module contains Apache Fluo integration tests</description>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-core</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-minicluster</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
<artifactId>fluo-accumulo</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
<artifactId>fluo-api</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
<artifactId>fluo-core</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
<artifactId>fluo-mini</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
</dependency>
</dependencies>
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+
<testSourceDirectory>${project.basedir}/src/main/java/</testSourceDirectory>
+
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
<profiles>
<profile>
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/BankUtil.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/BankUtil.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/BankUtil.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/BankUtil.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/ITBase.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBase.java
similarity index 93%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/ITBase.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBase.java
index b7f3a00a..d5af1c09 100644
--- a/modules/integration/src/test/java/org/apache/fluo/integration/ITBase.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBase.java
@@ -39,12 +39,12 @@
*/
public class ITBase {
- protected final static String USER = "root";
- protected final static String PASSWORD = "ITSecret";
- protected final static String TABLE_BASE = "table";
- protected final static String IT_INSTANCE_NAME_PROP =
+ protected static final String USER = "root";
+ protected static final String PASSWORD = "ITSecret";
+ protected static final String TABLE_BASE = "table";
+ protected static final String IT_INSTANCE_NAME_PROP =
FluoConfiguration.FLUO_PREFIX + ".it.instance.name";
- protected final static String IT_INSTANCE_CLEAR_PROP =
+ protected static final String IT_INSTANCE_CLEAR_PROP =
FluoConfiguration.FLUO_PREFIX + ".it.instance.clear";
protected static String instanceName;
@@ -59,7 +59,7 @@
private static AtomicInteger tableCounter = new AtomicInteger(1);
protected static AtomicInteger testCounter = new AtomicInteger();
- private final static long JUNIT_TIMEOUT_SECONDS = 120;
+ private static final long JUNIT_TIMEOUT_SECONDS = 120;
/**
* Gets the duration a test will run before timing out under the JUnit rule.
This value is in
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/ITBaseImpl.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBaseImpl.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/ITBaseImpl.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBaseImpl.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/ITBaseMini.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBaseMini.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/ITBaseMini.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/ITBaseMini.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/TestTransaction.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/TestTransaction.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/TestTransaction.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/TestTransaction.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/TestUtil.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/TestUtil.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/TestUtil.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/TestUtil.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/accumulo/Skip100StampsIterator.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/accumulo/Skip100StampsIterator.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/accumulo/Skip100StampsIterator.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/accumulo/Skip100StampsIterator.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/accumulo/TimeskippingIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/accumulo/TimeskippingIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/accumulo/TimeskippingIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/accumulo/TimeskippingIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
similarity index 99%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
index f3052dd5..63d64721 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoAdminImplIT.java
@@ -76,6 +76,7 @@ public void testInitializeTwiceFails() throws Exception {
admin.initialize(opts);
fail("This should have failed");
} catch (AlreadyInitializedException e) {
+ // expected
}
opts.setClearZookeeper(false).setClearTable(true);
@@ -83,6 +84,7 @@ public void testInitializeTwiceFails() throws Exception {
admin.initialize(opts);
fail("This should have failed");
} catch (AlreadyInitializedException e) {
+ // expected
}
opts.setClearZookeeper(true).setClearTable(false);
@@ -90,6 +92,7 @@ public void testInitializeTwiceFails() throws Exception {
admin.initialize(opts);
fail("This should have failed");
} catch (TableExistsException e) {
+ // expected
}
}
@@ -153,6 +156,7 @@ public void testInitializeWithNoChroot() throws Exception {
fluoAdmin.initialize(opts);
fail("This should have failed");
} catch (IllegalArgumentException e) {
+ // expected
}
}
}
@@ -200,6 +204,7 @@ public void testRemove() throws Exception {
admin.remove();
fail("This should fail with the oracle server running");
} catch (FluoException e) {
+ // expected
}
// write/verify some data
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/client/FluoClientIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoClientIT.java
similarity index 94%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/client/FluoClientIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoClientIT.java
index 2ae0ae3f..da5271ca 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/client/FluoClientIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/client/FluoClientIT.java
@@ -61,9 +61,9 @@ public void testBasic() {
@Test
public void testFailures() {
// we are expecting errors in this test
- Level clientLevel = Logger.getLogger(FluoClientImpl.class).getLevel();
+ final Level clientLevel =
Logger.getLogger(FluoClientImpl.class).getLevel();
Logger.getLogger(FluoClientImpl.class).setLevel(Level.FATAL);
- Level factoryLevel = Logger.getLogger(FluoFactory.class).getLevel();
+ final Level factoryLevel = Logger.getLogger(FluoFactory.class).getLevel();
Logger.getLogger(FluoFactory.class).setLevel(Level.FATAL);
FluoConfiguration fluoConfig = new FluoConfiguration();
@@ -71,11 +71,13 @@ public void testFailures() {
FluoFactory.newClient(fluoConfig);
Assert.fail();
} catch (FluoException e) {
+ // expected
}
try (FluoClientImpl impl = new FluoClientImpl(fluoConfig)) {
Assert.fail("FluoClientImpl was " + impl);
} catch (IllegalArgumentException e) {
+ // expected
}
Logger.getLogger(FluoClientImpl.class).setLevel(clientLevel);
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/client/LoaderExecutorIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/client/LoaderExecutorIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/client/LoaderExecutorIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/client/LoaderExecutorIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ApiBehaviorIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ApiBehaviorIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ApiBehaviorIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ApiBehaviorIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/AppConfigIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/AppConfigIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/AppConfigIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/AppConfigIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ClientExceptionIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ClientExceptionIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ClientExceptionIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ClientExceptionIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/CollisionIT.java
similarity index 97%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/CollisionIT.java
index 4fcf98a3..951f6a22 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/CollisionIT.java
@@ -47,11 +47,10 @@
/**
* Run end to end test with lots of collisions and verify the following :
*
- * <p>
* <ul>
- * <li/>LoaderExecutor works correctly w/ lots of collisions
- * <li/>Observers work correctly w/ lots of collisions
- * <li/>Fluo GC works correctly after lots of collisions
+ * <li>LoaderExecutor works correctly w/ lots of collisions
+ * <li>Observers work correctly w/ lots of collisions
+ * <li>Fluo GC works correctly after lots of collisions
* </ul>
*
*/
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ColumnVisIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ColumnVisIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ColumnVisIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ColumnVisIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FailureIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
similarity index 98%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/FailureIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
index 519274d2..05b5ebb0 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FailureIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
@@ -81,15 +81,15 @@ public void provide(Registry or, Context ctx) {
@Test
public void testRollbackMany() throws Exception {
- testRollbackMany(true);
+ testRollbackManyImpl(true);
}
@Test
public void testRollbackManyTimeout() throws Exception {
- testRollbackMany(false);
+ testRollbackManyImpl(false);
}
- private void testRollbackMany(boolean killTransactor) throws Exception {
+ private void testRollbackManyImpl(boolean killTransactor) throws Exception {
// test writing lots of columns that need to be rolled back
@@ -146,15 +146,15 @@ private void testRollbackMany(boolean killTransactor)
throws Exception {
@Test
public void testRollforwardMany() throws Exception {
- testRollforwardMany(true);
+ testRollforwardManyImpl(true);
}
@Test
public void testRollforwardManyTimeout() throws Exception {
- testRollforwardMany(false);
+ testRollforwardManyImpl(false);
}
- private void testRollforwardMany(boolean killTransactor) throws Exception {
+ private void testRollforwardManyImpl(boolean killTransactor) throws
Exception {
// test writing lots of columns that need to be rolled forward
Column col1 = new Column("fam1", "q1");
@@ -601,8 +601,7 @@ public void testRollbackSelf() throws Exception {
tx1.done();
-
- TestTransaction tx2 = new TestTransaction(env, "jill", BALANCE, 1);
+ final TestTransaction tx2 = new TestTransaction(env, "jill", BALANCE, 1);
TestTransaction tx3 = new TestTransaction(env);
TestUtil.increment(tx3, "bob", BALANCE, 5);
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FaultyConfig.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FaultyConfig.java
similarity index 96%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/FaultyConfig.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FaultyConfig.java
index 625323ef..62c48dd1 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FaultyConfig.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FaultyConfig.java
@@ -58,10 +58,11 @@
while (mutations.hasNext()) {
ConditionalMutation cm = mutations.next();
- if (rand.nextDouble() <= up && rand.nextDouble() > wp)
+ if (rand.nextDouble() <= up && rand.nextDouble() > wp) {
resultList.add(new Result(Status.UNKNOWN, cm, null));
- else
+ } else {
writes.add(cm);
+ }
}
if (writes.size() > 0) {
@@ -70,8 +71,9 @@
while (results.hasNext()) {
Result result = results.next();
- if (rand.nextDouble() <= up && rand.nextDouble() <= wp)
+ if (rand.nextDouble() <= up && rand.nextDouble() <= wp) {
result = new Result(Status.UNKNOWN, result.getMutation(),
result.getTabletServer());
+ }
resultList.add(result);
}
}
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FluoIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FluoIT.java
similarity index 82%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/FluoIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FluoIT.java
index 4299fabe..696497e2 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/FluoIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FluoIT.java
@@ -94,7 +94,7 @@ public void testOverlap1() throws Exception {
// TX2 commits -- succeeds
// TX1 commits -- fails
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -102,15 +102,15 @@ public void testOverlap1() throws Exception {
tx.done();
- tx = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
- Assert.assertEquals("10", tx.gets("bob", BALANCE));
- Assert.assertEquals("20", tx.gets("joe", BALANCE));
+ Assert.assertEquals("10", tx1.gets("bob", BALANCE));
+ Assert.assertEquals("20", tx1.gets("joe", BALANCE));
- TestUtil.increment(tx, "bob", BALANCE, -5);
- TestUtil.increment(tx, "joe", BALANCE, 5);
+ TestUtil.increment(tx1, "bob", BALANCE, -5);
+ TestUtil.increment(tx1, "joe", BALANCE, 5);
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
Assert.assertEquals("10", tx2.gets("bob", BALANCE));
Assert.assertEquals("60", tx2.gets("jill", BALANCE));
@@ -119,9 +119,9 @@ public void testOverlap1() throws Exception {
TestUtil.increment(tx2, "jill", BALANCE, 5);
tx2.done();
- assertCommitFails(tx);
+ assertCommitFails(tx1);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertEquals("5", tx3.gets("bob", BALANCE));
Assert.assertEquals("20", tx3.gets("joe", BALANCE));
@@ -134,6 +134,7 @@ private void assertCommitFails(TestTransaction tx) {
tx.done();
Assert.fail();
} catch (CommitException ce) {
+ // expected
}
}
@@ -142,6 +143,7 @@ private void assertAAck(TestTransaction tx) {
tx.done();
Assert.fail();
} catch (AlreadyAcknowledgedException ce) {
+ // expected
}
}
@@ -154,7 +156,7 @@ public void testSnapshots() throws Exception {
// TX2 commits
// TX1 reads -- should not see TX2 writes
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -163,9 +165,9 @@ public void testSnapshots() throws Exception {
tx.done();
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
TestUtil.increment(tx2, "bob", BALANCE, -5);
TestUtil.increment(tx2, "joe", BALANCE, -5);
@@ -175,7 +177,7 @@ public void testSnapshots() throws Exception {
tx2.done();
- TestTransaction txd = new TestTransaction(env);
+ final TestTransaction txd = new TestTransaction(env);
txd.delete("jane", BALANCE);
txd.done();
@@ -188,9 +190,9 @@ public void testSnapshots() throws Exception {
assertCommitFails(tx1);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
- TestTransaction tx4 = new TestTransaction(env);
+ final TestTransaction tx4 = new TestTransaction(env);
tx4.set("jane", BALANCE, "3");
tx4.done();
@@ -200,7 +202,7 @@ public void testSnapshots() throws Exception {
Assert.assertNull(tx3.gets("jane", BALANCE));
tx3.done();
- TestTransaction tx5 = new TestTransaction(env);
+ final TestTransaction tx5 = new TestTransaction(env);
Assert.assertEquals("5", tx5.gets("bob", BALANCE));
Assert.assertEquals("15", tx5.gets("joe", BALANCE));
@@ -213,7 +215,7 @@ public void testSnapshots() throws Exception {
public void testAck() throws Exception {
// when two transactions run against the same observed column, only one
should commit
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -221,18 +223,18 @@ public void testAck() throws Exception {
tx.done();
- TestTransaction tx1 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx1 = new TestTransaction(env, "joe", BALANCE);
tx1.gets("joe", BALANCE);
tx1.set("jill", BALANCE, "61");
- TestTransaction tx2 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx2 = new TestTransaction(env, "joe", BALANCE);
tx2.gets("joe", BALANCE);
tx2.set("bob", BALANCE, "11");
tx1.done();
assertAAck(tx2);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertEquals("10", tx3.gets("bob", BALANCE));
Assert.assertEquals("20", tx3.gets("joe", BALANCE));
@@ -243,21 +245,21 @@ public void testAck() throws Exception {
tx3.done();
- TestTransaction tx4 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx4 = new TestTransaction(env, "joe", BALANCE);
tx4.gets("joe", BALANCE);
tx4.set("jill", BALANCE, "62");
- TestTransaction tx5 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx5 = new TestTransaction(env, "joe", BALANCE);
tx5.gets("joe", BALANCE);
tx5.set("bob", BALANCE, "11");
- TestTransaction tx7 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx7 = new TestTransaction(env, "joe", BALANCE);
// make the 2nd transaction to start commit 1st
tx5.done();
assertAAck(tx4);
- TestTransaction tx6 = new TestTransaction(env);
+ final TestTransaction tx6 = new TestTransaction(env);
Assert.assertEquals("11", tx6.gets("bob", BALANCE));
Assert.assertEquals("21", tx6.gets("joe", BALANCE));
@@ -270,7 +272,7 @@ public void testAck() throws Exception {
assertAAck(tx7);
- TestTransaction tx8 = new TestTransaction(env);
+ final TestTransaction tx8 = new TestTransaction(env);
Assert.assertEquals("11", tx8.gets("bob", BALANCE));
Assert.assertEquals("21", tx8.gets("joe", BALANCE));
@@ -280,9 +282,9 @@ public void testAck() throws Exception {
@Test
public void testAck2() throws Exception {
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
- Column addrCol = new Column("account", "addr");
+ final Column addrCol = new Column("account", "addr");
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -290,9 +292,9 @@ public void testAck2() throws Exception {
tx.done();
- TestTransaction tx1 = new TestTransaction(env, "bob", BALANCE);
- TestTransaction tx2 = new TestTransaction(env, "bob", BALANCE);
- TestTransaction tx3 = new TestTransaction(env, "bob", BALANCE);
+ final TestTransaction tx1 = new TestTransaction(env, "bob", BALANCE);
+ final TestTransaction tx2 = new TestTransaction(env, "bob", BALANCE);
+ final TestTransaction tx3 = new TestTransaction(env, "bob", BALANCE);
tx1.gets("bob", BALANCE);
tx2.gets("bob", BALANCE);
@@ -321,7 +323,7 @@ public void testAck2() throws Exception {
@Test
public void testAck3() throws Exception {
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -332,7 +334,7 @@ public void testAck3() throws Exception {
long notTS1 = TestTransaction.getNotificationTS(env, "bob", BALANCE);
// this transaction should create a second notification
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
tx1.set("bob", BALANCE, "11");
tx1.done();
@@ -344,16 +346,16 @@ public void testAck3() throws Exception {
// should execute
// google paper calls this message collapsing
- TestTransaction tx3 = new TestTransaction(env, "bob", BALANCE, notTS1);
+ final TestTransaction tx3 = new TestTransaction(env, "bob", BALANCE,
notTS1);
- TestTransaction tx2 = new TestTransaction(env, "bob", BALANCE, notTS1);
+ final TestTransaction tx2 = new TestTransaction(env, "bob", BALANCE,
notTS1);
Assert.assertEquals("11", tx2.gets("bob", BALANCE));
tx2.done();
Assert.assertEquals("11", tx3.gets("bob", BALANCE));
assertAAck(tx3);
- TestTransaction tx4 = new TestTransaction(env, "bob", BALANCE, notTS2);
+ final TestTransaction tx4 = new TestTransaction(env, "bob", BALANCE,
notTS2);
Assert.assertEquals("11", tx4.gets("bob", BALANCE));
assertAAck(tx4);
}
@@ -363,7 +365,7 @@ public void testWriteObserved() throws Exception {
// setting an acknowledged observed column in a transaction should not
affect acknowledged
// status
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", BALANCE, "10");
tx.set("joe", BALANCE, "20");
@@ -371,19 +373,19 @@ public void testWriteObserved() throws Exception {
tx.done();
- TestTransaction tx2 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx2 = new TestTransaction(env, "joe", BALANCE);
tx2.gets("joe", BALANCE);
tx2.set("joe", BALANCE, "21");
tx2.set("bob", BALANCE, "11");
- TestTransaction tx1 = new TestTransaction(env, "joe", BALANCE);
+ final TestTransaction tx1 = new TestTransaction(env, "joe", BALANCE);
tx1.gets("joe", BALANCE);
tx1.set("jill", BALANCE, "61");
tx1.done();
assertAAck(tx2);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertEquals("10", tx3.gets("bob", BALANCE));
Assert.assertEquals("20", tx3.gets("joe", BALANCE));
@@ -401,7 +403,7 @@ public void testVisibility() throws Exception {
Column balanceCol = new Column("account", "balance", "A|B");
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("bob", balanceCol, "10");
tx.set("joe", balanceCol, "20");
@@ -413,7 +415,7 @@ public void testVisibility() throws Exception {
Environment env2 = new Environment(fc);
env2.setAuthorizations(new Authorizations("B"));
- TestTransaction tx2 = new TestTransaction(env2);
+ final TestTransaction tx2 = new TestTransaction(env2);
Assert.assertEquals("10", tx2.gets("bob", balanceCol));
Assert.assertEquals("20", tx2.gets("joe", balanceCol));
Assert.assertEquals("60", tx2.gets("jill", balanceCol));
@@ -423,7 +425,7 @@ public void testVisibility() throws Exception {
Environment env3 = new Environment(fc);
env3.setAuthorizations(new Authorizations("C"));
- TestTransaction tx3 = new TestTransaction(env3);
+ final TestTransaction tx3 = new TestTransaction(env3);
Assert.assertNull(tx3.gets("bob", balanceCol));
Assert.assertNull(tx3.gets("joe", balanceCol));
Assert.assertNull(tx3.gets("jill", balanceCol));
@@ -436,7 +438,7 @@ public void testRange() throws Exception {
// setting an acknowledged observed column in a transaction should not
affect acknowledged
// status
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
tx.set("d00001", new Column("data", "content"),
"blah blah, blah http://a.com. Blah blah http://b.com. Blah
http://c.com");
tx.set("d00001", new Column("outlink", "http://a.com"), "");
@@ -451,9 +453,9 @@ public void testRange() throws Exception {
tx.done();
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
tx3.set("d00001", new Column("data", "content"),
"blah blah, blah http://a.com. Blah http://c.com . Blah
http://z.com");
@@ -480,7 +482,7 @@ public void testRange() throws Exception {
Assert.assertEquals(expected, columns);
- TestTransaction tx4 = new TestTransaction(env);
+ final TestTransaction tx4 = new TestTransaction(env);
columns.clear();
cellScanner = tx4.scanner().over("d00001").fetch(new
Column("outlink")).build();
for (RowColumnValue rcv : cellScanner) {
@@ -495,7 +497,7 @@ public void testRange() throws Exception {
@Test
public void testStringMethods() {
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
Column ccol = new Column("doc", "content");
Column tcol = new Column("doc", "time");
@@ -509,7 +511,7 @@ public void testStringMethods() {
tx.done();
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
Map<String, Map<Column, String>> map1 =
tx2.gets(Arrays.asList("d:0001", "d:0002"),
Collections.singleton(ccol));
@@ -529,7 +531,7 @@ public void testStringMethods() {
tx2.done();
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertNull(tx3.gets("d:0003", ccol));
Assert.assertNull(tx3.gets("d:0003", tcol));
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
similarity index 91%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
index fc553f50..c250de1c 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/GarbageCollectionIteratorIT.java
@@ -62,7 +62,7 @@ private void waitForGcTime(long expectedTime) throws
Exception {
public void testVerifyAfterGC() throws Exception {
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
BankUtil.setBalance(tx1, "bob", 10);
BankUtil.setBalance(tx1, "joe", 20);
BankUtil.setBalance(tx1, "jill", 60);
@@ -73,7 +73,7 @@ public void testVerifyAfterGC() throws Exception {
BankUtil.transfer(env, "bob", "joe", 2);
BankUtil.transfer(env, "jill", "joe", 2);
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
waitForGcTime(tx2.getStartTimestamp());
long oldestTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
@@ -84,7 +84,7 @@ public void testVerifyAfterGC() throws Exception {
verify(oldestTs);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertEquals(9, BankUtil.getBalance(tx3, "bob"));
Assert.assertEquals(22, BankUtil.getBalance(tx3, "joe"));
Assert.assertEquals(59, BankUtil.getBalance(tx3, "jill"));
@@ -97,17 +97,17 @@ public void testDeletedDataIsDropped() throws Exception {
final Column docUri = new Column("doc", "uri");
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
tx1.set("001", docUri, "file:///abc.txt");
tx1.done();
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
tx3.delete("001", docUri);
tx3.done();
- TestTransaction tx4 = new TestTransaction(env);
+ final TestTransaction tx4 = new TestTransaction(env);
waitForGcTime(tx2.getStartTimestamp());
@@ -138,7 +138,7 @@ public void testRolledBackDataIsDropped() throws Exception {
Column col2 = new Column("fam1", "q2");
TransactorNode t2 = new TransactorNode(env);
- TestTransaction tx2 = new TestTransaction(env, t2);
+ final TestTransaction tx2 = new TestTransaction(env, t2);
for (int r = 0; r < 10; r++) {
tx2.set(r + "", col1, "1" + r + "0");
@@ -151,7 +151,7 @@ public void testRolledBackDataIsDropped() throws Exception {
t2.close();
// rollback data
- TestTransaction tx3 = new TestTransaction(env, t2);
+ final TestTransaction tx3 = new TestTransaction(env, t2);
for (int r = 0; r < 10; r++) {
tx3.gets(r + "", col1);
tx3.gets(r + "", col2);
@@ -187,7 +187,7 @@ public void testReadLocks() throws Exception {
final Column altIdCol = new Column("info", "altId");
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
for (int i = 0; i < 10; i++) {
tx1.set(String.format("n:%03d", i), altIdCol, "" + (19 * (1 + i)));
}
@@ -197,7 +197,7 @@ public void testReadLocks() throws Exception {
for (int i = 0; i < 50; i++) {
String row = String.format("n:%03d", i % 10);
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
String altId = tx.withReadLock().gets(row, altIdCol);
increment(tx, "a:" + altId, new Column("count", row));
@@ -208,7 +208,7 @@ public void testReadLocks() throws Exception {
Assert.assertEquals(50, countInTable("-DEL_RLOCK"));
Assert.assertEquals(50, countInTable("-RLOCK"));
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
for (int i = 0; i < 10; i++) {
String row = String.format("n:%03d", i);
String newAltId = (13 * (i + 1)) + "";
@@ -233,7 +233,7 @@ public void testReadLocks() throws Exception {
for (int i = 0; i < 50; i++) {
String row = String.format("n:%03d", i % 10);
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
String altId = tx.withReadLock().gets(row, altIdCol);
increment(tx, "a:" + altId, new Column("count", row));
@@ -241,7 +241,7 @@ public void testReadLocks() throws Exception {
tx.done();
}
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
for (int i = 0; i < 10; i++) {
String row = String.format("n:%03d", i);
String currAltId = tx3.gets(row, altIdCol);
@@ -274,7 +274,7 @@ private int countInTable(String str) throws
TableNotFoundException {
@Test
public void testGetOldestTimestamp() throws Exception {
// we are expecting an error in this test
- Level curLevel = Logger.getLogger(ZookeeperUtil.class).getLevel();
+ final Level curLevel = Logger.getLogger(ZookeeperUtil.class).getLevel();
Logger.getLogger(ZookeeperUtil.class).setLevel(Level.FATAL);
// verify that oracle initial current ts
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/MiniIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/MiniIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/MiniIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/MiniIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/NotificationGcIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/NotificationGcIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/NotificationGcIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/NotificationGcIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
similarity index 98%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
index e7928684..bbcbbd3b 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ObserverConfigIT.java
@@ -53,7 +53,7 @@
public void init(Context context) {
SimpleConfiguration myConfig = context.getObserverConfiguration();
- String ocTokens[] = myConfig.getString("observedCol").split(":");
+ String[] ocTokens = myConfig.getString("observedCol").split(":");
observedColumn = new ObservedColumn(new Column(ocTokens[0], ocTokens[1]),
NotificationType.valueOf(ocTokens[2]));
outputCQ = Bytes.of(myConfig.getString("outputCQ"));
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/OracleIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/OracleIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/OracleIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/OracleIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
similarity index 92%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
index f314e8a7..65a3136c 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ParallelScannerIT.java
@@ -39,7 +39,7 @@
@Test
public void testRowColumn() {
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
tx1.set("node1", new Column("edge", "node2"), "");
tx1.set("node1", new Column("edge", "node3"), "");
@@ -50,7 +50,7 @@ public void testRowColumn() {
tx1.done();
- TestTransaction tx2 = new TestTransaction(env);
+ final TestTransaction tx2 = new TestTransaction(env);
ArrayList<RowColumn> newEdges = new ArrayList<>();
@@ -61,7 +61,7 @@ public void testRowColumn() {
newEdges.add(new RowColumn("node8", new Column("edge", "node3")));
newEdges.add(new RowColumn("node5", new Column("edge", "node7")));
- Map<RowColumn, String> existing = tx2.gets(newEdges);
+ final Map<RowColumn, String> existing = tx2.gets(newEdges);
tx2.done();
@@ -77,7 +77,7 @@ public void testRowColumn() {
public void testConcurrentParallelScan() throws Exception {
// have one transaction lock a row/cole and another attempt to read that
row/col as part of a
// parallel scan
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
tx1.set("bob9", new Column("vote", "election1"), "N");
tx1.set("bob9", new Column("vote", "election2"), "Y");
@@ -114,7 +114,7 @@ public void testConcurrentParallelScan() throws Exception {
Thread commitThread = new Thread(finishCommitTask);
commitThread.start();
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Column e1Col = new Column("vote", "election1");
@@ -143,7 +143,7 @@ public void testParallelScanRecovery2() throws Exception {
private static final Column COL = new Column("7", "7");
private void runParallelRecoveryTest(boolean closeTransID) throws Exception {
- TestTransaction tx1 = new TestTransaction(env);
+ final TestTransaction tx1 = new TestTransaction(env);
tx1.set("5", COL, "3");
tx1.set("12", COL, "10");
@@ -157,7 +157,7 @@ private void runParallelRecoveryTest(boolean closeTransID)
throws Exception {
TransactorNode tNode1 = new TransactorNode(env);
- TestTransaction tx2 = new TestTransaction(env, tNode1);
+ final TestTransaction tx2 = new TestTransaction(env, tNode1);
tx2.set("5", COL, "7");
tx2.set("12", COL, "14");
@@ -166,7 +166,7 @@ private void runParallelRecoveryTest(boolean closeTransID)
throws Exception {
CommitData cd2 = tx2.createCommitData();
Assert.assertTrue(tx2.preCommit(cd2));
- TestTransaction tx3 = new TestTransaction(env, tNode1);
+ final TestTransaction tx3 = new TestTransaction(env, tNode1);
tx3.set("26", COL, "28");
tx3.set("33", COL, "35");
@@ -190,7 +190,7 @@ private void runParallelRecoveryTest(boolean closeTransID)
throws Exception {
}
private void check() throws Exception {
- TestTransaction tx = new TestTransaction(env);
+ final TestTransaction tx = new TestTransaction(env);
Map<String, Map<Column, String>> votes =
tx.gets(Arrays.asList("5", "12", "19", "26", "33", "40", "47"),
Sets.newHashSet(COL));
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
similarity index 99%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
index 24d7cd45..ba93b6da 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockFailureIT.java
@@ -63,7 +63,7 @@ private void expectCommitException(Consumer<Transaction>
retryAction) {
tx.commit();
Assert.fail();
} catch (CommitException ce) {
-
+ // expected
}
}
@@ -385,7 +385,7 @@ public void testFailDeletesReadLocks() throws Exception {
tx2.commit();
Assert.fail();
} catch (CommitException e) {
-
+ // expected
}
}
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockIT.java
similarity index 98%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockIT.java
index 00d01af2..d93d3985 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ReadLockIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ReadLockIT.java
@@ -150,6 +150,7 @@ public void testConcurrentReadlocks() throws Exception {
tx1.commit();
Assert.fail("Expected exception");
} catch (CommitException ce) {
+ // expected
}
Assert.assertEquals(ImmutableSet.of("bob:joe", "joe:bob", "bob:alice",
"alice:bob"),
@@ -180,6 +181,7 @@ public void testWriteCausesReadLockToFail() throws
Exception {
tx2.commit();
Assert.fail("Expected exception");
} catch (CommitException ce) {
+ // expected
}
// ensure the failed read lock on node1 is cleaned up
@@ -236,9 +238,9 @@ public void testWriteAfterReadLock() throws Exception {
@Test
public void testRandom() throws Exception {
- int numNodes = 100;
- int numEdges = 1000;
- int numAliasChanges = 25;
+ final int numNodes = 100;
+ final int numEdges = 1000;
+ final int numAliasChanges = 25;
Random rand = new Random();
@@ -398,7 +400,7 @@ public void testReadAndDeleteInSameTx() {
private static final Column c2 = new Column("f1", "q2");
private static final Column invCol = new Column("f1", "inv");
- final private void ensureReadLocksSet(Consumer<TransactionBase>
readLockOperation) {
+ private final void ensureReadLocksSet(Consumer<TransactionBase>
readLockOperation) {
try (Transaction txi = client.newTransaction()) {
txi.set("test1", c1, "45");
@@ -436,6 +438,7 @@ final private void
ensureReadLocksSet(Consumer<TransactionBase> readLockOperatio
wtx.commit();
Assert.fail();
} catch (CommitException ce) {
+ // expected
}
}
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ScannerIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ScannerIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ScannerIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ScannerIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/SelfNotificationIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/SelfNotificationIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/SelfNotificationIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/SelfNotificationIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/StochasticBankIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/StochasticBankIT.java
similarity index 96%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/StochasticBankIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/StochasticBankIT.java
index 8a767d9f..b0d6bd13 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/StochasticBankIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/StochasticBankIT.java
@@ -31,9 +31,8 @@
import com.google.common.collect.Iterables;
import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.Stat;
import org.apache.fluo.accumulo.format.FluoFormatter;
+import org.apache.fluo.accumulo.util.AccumuloProps;
import org.apache.fluo.api.data.Column;
import org.apache.fluo.api.data.RowColumnValue;
import org.apache.fluo.api.exceptions.CommitException;
@@ -62,8 +61,8 @@
@Test
public void testConcurrency() throws Exception {
- conn.tableOperations().setProperty(table,
Property.TABLE_MAJC_RATIO.getKey(), "1");
- conn.tableOperations().setProperty(table,
Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
+ conn.tableOperations().setProperty(table, AccumuloProps.TABLE_MAJC_RATIO,
"1");
+ conn.tableOperations().setProperty(table,
AccumuloProps.TABLE_BLOCKCACHE_ENABLED, "true");
int numAccounts = 5000;
@@ -195,7 +194,7 @@ private static void runVerifier(Environment env, int
numAccounts, int num) {
long t1 = System.currentTimeMillis();
TestTransaction tx = new TestTransaction(env);
- Stat stat = new Stat();
+ org.apache.accumulo.core.util.Stat stat = new
org.apache.accumulo.core.util.Stat();
for (RowColumnValue rcv : tx.scanner().build()) {
int amt = Integer.parseInt(rcv.getValue().toString());
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/StrongNotificationIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/StrongNotificationIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/StrongNotificationIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/StrongNotificationIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
similarity index 92%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
index 349a5717..7db1866a 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/TimestampTrackerIT.java
@@ -50,13 +50,13 @@ public void testTrackingWithNoUpdate() throws Exception {
TimestampTracker tracker = new TimestampTracker(env, new
TransactorID(env));
Assert.assertTrue(tracker.isEmpty());
Assert.assertFalse(zkNodeExists(tracker));
- long ts1 = tracker.allocateTimestamp().getTxTimestamp();
+ final long ts1 = tracker.allocateTimestamp().getTxTimestamp();
Assert.assertFalse(tracker.isEmpty());
Assert.assertTrue(zkNodeExists(tracker));
Assert.assertTrue(ts1 > zkNodeValue(tracker));
Assert.assertEquals(tracker.getZookeeperTimestamp(), zkNodeValue(tracker));
Assert.assertEquals(ts1, tracker.getOldestActiveTimestamp());
- long ts2 = tracker.allocateTimestamp().getTxTimestamp();
+ final long ts2 = tracker.allocateTimestamp().getTxTimestamp();
Assert.assertEquals(ts1, tracker.getOldestActiveTimestamp());
tracker.removeTimestamp(ts1);
Assert.assertFalse(tracker.isEmpty());
@@ -73,14 +73,14 @@ public void testTrackingWithNoUpdate() throws Exception {
@Test
public void testTrackingWithZkUpdate() throws Exception {
TimestampTracker tracker = new TimestampTracker(env, new
TransactorID(env), 5);
- long ts1 = tracker.allocateTimestamp().getTxTimestamp();
+ final long ts1 = tracker.allocateTimestamp().getTxTimestamp();
Thread.sleep(15);
Assert.assertNotNull(ts1);
Assert.assertTrue(zkNodeExists(tracker));
Assert.assertNotNull(zkNodeValue(tracker));
Assert.assertEquals(tracker.getZookeeperTimestamp(), zkNodeValue(tracker));
Assert.assertEquals(ts1, tracker.getOldestActiveTimestamp());
- long ts2 = tracker.allocateTimestamp().getTxTimestamp();
+ final long ts2 = tracker.allocateTimestamp().getTxTimestamp();
Assert.assertEquals(ts1, tracker.getOldestActiveTimestamp());
Thread.sleep(15);
tracker.removeTimestamp(ts1);
@@ -98,13 +98,13 @@ public void testTrackingWithZkUpdate() throws Exception {
public void testTimestampUtilGetOldestTs() throws Exception {
Assert.assertEquals(0, getOldestTs());
TimestampTracker tr1 = new TimestampTracker(env, new TransactorID(env), 5);
- long ts1 = tr1.allocateTimestamp().getTxTimestamp();
+ final long ts1 = tr1.allocateTimestamp().getTxTimestamp();
Thread.sleep(15);
Assert.assertEquals(tr1.getZookeeperTimestamp(), getOldestTs());
TimestampTracker tr2 = new TimestampTracker(env, new TransactorID(env), 5);
- long ts2 = tr2.allocateTimestamp().getTxTimestamp();
+ final long ts2 = tr2.allocateTimestamp().getTxTimestamp();
TimestampTracker tr3 = new TimestampTracker(env, new TransactorID(env), 5);
- long ts3 = tr3.allocateTimestamp().getTxTimestamp();
+ final long ts3 = tr3.allocateTimestamp().getTxTimestamp();
Thread.sleep(15);
Assert.assertEquals(ts1, getOldestTs());
tr1.removeTimestamp(ts1);
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/TransactorIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/TransactorIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/TransactorIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/TransactorIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/WeakNotificationIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WeakNotificationIT.java
similarity index 100%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/WeakNotificationIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WeakNotificationIT.java
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
similarity index 86%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
index 2efb087d..1b5cf1a0 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WeakNotificationOverlapIT.java
@@ -75,14 +75,14 @@ public void testOverlap() throws Exception {
// this test ensures that processing of weak notification deletes based on
startTs and not
// commitTs
- TestTransaction ttx1 = new TestTransaction(env);
+ final TestTransaction ttx1 = new TestTransaction(env);
TestUtil.increment(ttx1, "1", STAT_TOTAL, 1);
ttx1.setWeakNotification("1", STAT_CHANGED);
ttx1.done();
- TestTransaction ttx2 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx2 = new TestTransaction(env, "1", STAT_CHANGED);
- TestTransaction ttx3 = new TestTransaction(env);
+ final TestTransaction ttx3 = new TestTransaction(env);
TestUtil.increment(ttx3, "1", STAT_TOTAL, 1);
ttx3.setWeakNotification("1", STAT_CHANGED);
ttx3.done();
@@ -93,26 +93,26 @@ public void testOverlap() throws Exception {
// should not delete notification created by ttx3
ttx2.done();
- TestTransaction snap1 = new TestTransaction(env);
+ final TestTransaction snap1 = new TestTransaction(env);
Assert.assertEquals("1", snap1.gets("all", STAT_TOTAL));
snap1.done();
Assert.assertEquals(1, countNotifications());
- TestTransaction ttx4 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx4 = new TestTransaction(env, "1", STAT_CHANGED);
TOTAL_OBSERVER.process(ttx4, Bytes.of("1"), STAT_CHANGED);
ttx4.done();
Assert.assertEquals(0, countNotifications());
- TestTransaction snap2 = new TestTransaction(env);
+ final TestTransaction snap2 = new TestTransaction(env);
Assert.assertEquals("2", snap2.gets("all", STAT_TOTAL));
snap2.done();
// the following code is a repeat of the above with a slight diff. The
following tx creates a
// notification, but deletes the data so there is no work for the
// observer. This test the case where a observer deletes a notification
w/o making any updates.
- TestTransaction ttx5 = new TestTransaction(env);
+ final TestTransaction ttx5 = new TestTransaction(env);
ttx5.delete("1", STAT_TOTAL);
ttx5.delete("1", STAT_PROCESSED);
ttx5.setWeakNotification("1", STAT_CHANGED);
@@ -120,9 +120,9 @@ public void testOverlap() throws Exception {
Assert.assertEquals(1, countNotifications());
- TestTransaction ttx6 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx6 = new TestTransaction(env, "1", STAT_CHANGED);
- TestTransaction ttx7 = new TestTransaction(env);
+ final TestTransaction ttx7 = new TestTransaction(env);
TestUtil.increment(ttx7, "1", STAT_TOTAL, 1);
ttx7.setWeakNotification("1", STAT_CHANGED);
ttx7.done();
@@ -135,17 +135,17 @@ public void testOverlap() throws Exception {
Assert.assertEquals(1, countNotifications());
- TestTransaction snap3 = new TestTransaction(env);
+ final TestTransaction snap3 = new TestTransaction(env);
Assert.assertEquals("2", snap3.gets("all", STAT_TOTAL));
snap3.done();
- TestTransaction ttx8 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx8 = new TestTransaction(env, "1", STAT_CHANGED);
TOTAL_OBSERVER.process(ttx8, Bytes.of("1"), STAT_CHANGED);
ttx8.done();
Assert.assertEquals(0, countNotifications());
- TestTransaction snap4 = new TestTransaction(env);
+ final TestTransaction snap4 = new TestTransaction(env);
Assert.assertEquals("3", snap4.gets("all", STAT_TOTAL));
snap4.done();
}
@@ -154,14 +154,14 @@ public void testOverlap() throws Exception {
public void testOverlap2() throws Exception {
// this test ensures that setting weak notification is based on commitTs
and not startTs
- TestTransaction ttx1 = new TestTransaction(env);
+ final TestTransaction ttx1 = new TestTransaction(env);
TestUtil.increment(ttx1, "1", STAT_TOTAL, 1);
ttx1.setWeakNotification("1", STAT_CHANGED);
ttx1.done();
Assert.assertEquals(1, countNotifications());
- TestTransaction ttx2 = new TestTransaction(env);
+ final TestTransaction ttx2 = new TestTransaction(env);
TestUtil.increment(ttx2, "1", STAT_TOTAL, 1);
ttx2.setWeakNotification("1", STAT_CHANGED);
CommitData cd2 = ttx2.createCommitData();
@@ -170,7 +170,7 @@ public void testOverlap2() throws Exception {
// simulate an observer processing the notification created by ttx1 while
ttx2 is in the middle
// of committing. Processing this observer should not delete
// the notification for ttx2. It should delete the notification for ttx1.
- TestTransaction ttx3 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx3 = new TestTransaction(env, "1", STAT_CHANGED);
Stamp commitTs = env.getSharedResources().getOracleClient().getStamp();
Assert.assertTrue(ttx2.commitPrimaryColumn(cd2, commitTs));
@@ -187,7 +187,7 @@ public void testOverlap2() throws Exception {
Assert.assertEquals("1", snapshot.gets("all", STAT_TOTAL));
}
- TestTransaction ttx4 = new TestTransaction(env, "1", STAT_CHANGED);
+ final TestTransaction ttx4 = new TestTransaction(env, "1", STAT_CHANGED);
TOTAL_OBSERVER.process(ttx4, Bytes.of("1"), STAT_CHANGED);
ttx4.done();
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/WorkerIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WorkerIT.java
similarity index 95%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/WorkerIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WorkerIT.java
index d454d908..f4e34504 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/WorkerIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/WorkerIT.java
@@ -90,7 +90,7 @@ public void provide(Registry or, Context ctx) {
@Test
public void test1() throws Exception {
- Environment env = new Environment(config);
+ final Environment env = new Environment(config);
addLink("N0003", "N0040");
addLink("N0003", "N0020");
@@ -98,7 +98,7 @@ public void test1() throws Exception {
miniFluo.waitForObservers();
// verify observer updated degree index
- TestTransaction tx3 = new TestTransaction(env);
+ final TestTransaction tx3 = new TestTransaction(env);
Assert.assertEquals("2", tx3.gets("N0003", DEGREE));
Assert.assertEquals("", tx3.gets("IDEG2", new Column("node", "N0003")));
@@ -111,18 +111,18 @@ public void test1() throws Exception {
// verify observer updated degree index. Should have deleted old index
entry
// and added a new one
- TestTransaction tx4 = new TestTransaction(env);
+ final TestTransaction tx4 = new TestTransaction(env);
Assert.assertEquals("3", tx4.gets("N0003", DEGREE));
Assert.assertNull("", tx4.gets("IDEG2", new Column("node", "N0003")));
Assert.assertEquals("", tx4.gets("IDEG3", new Column("node", "N0003")));
// test rollback
- TestTransaction tx5 = new TestTransaction(env);
+ final TestTransaction tx5 = new TestTransaction(env);
tx5.set("N0003", new Column("link", "N0030"), "");
tx5.set("N0003", LAST_UPDATE, System.currentTimeMillis() + "");
tx5.done();
- TestTransaction tx6 = new TestTransaction(env);
+ final TestTransaction tx6 = new TestTransaction(env);
tx6.set("N0003", new Column("link", "N0050"), "");
tx6.set("N0003", LAST_UPDATE, System.currentTimeMillis() + "");
CommitData cd = tx6.createCommitData();
@@ -130,7 +130,7 @@ public void test1() throws Exception {
miniFluo.waitForObservers();
- TestTransaction tx7 = new TestTransaction(env);
+ final TestTransaction tx7 = new TestTransaction(env);
Assert.assertEquals("4", tx7.gets("N0003", DEGREE));
Assert.assertNull("", tx7.gets("IDEG3", new Column("node", "N0003")));
Assert.assertEquals("", tx7.gets("IDEG4", new Column("node", "N0003")));
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ZKSecretIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ZKSecretIT.java
similarity index 97%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/impl/ZKSecretIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ZKSecretIT.java
index 9786fd1f..7c702079 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/impl/ZKSecretIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/ZKSecretIT.java
@@ -132,12 +132,14 @@ public void testZKAcls() throws Exception {
zk.delete(ZookeeperPath.ORACLE_GC_TIMESTAMP, -1);
Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
try {
zk.setData(ZookeeperPath.ORACLE_GC_TIMESTAMP, "foo".getBytes(), -1);
Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
// try accessing a few random nodes in ZK... All should fail.
@@ -148,23 +150,28 @@ public void testZKAcls() throws Exception {
zk.getData(path, false, null);
Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
try {
zk.getChildren(path, false);
+ Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
try {
zk.delete(path, -1);
Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
try {
zk.setData(path, "foo".getBytes(), -1);
Assert.fail();
} catch (NoAuthException nae) {
+ // expected
}
}
diff --git
a/modules/integration/src/test/java/org/apache/fluo/integration/log/LogIT.java
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/log/LogIT.java
similarity index 89%
rename from
modules/integration/src/test/java/org/apache/fluo/integration/log/LogIT.java
rename to
modules/integration-tests/src/main/java/org/apache/fluo/integration/log/LogIT.java
index 900592c4..092021cf 100644
---
a/modules/integration/src/test/java/org/apache/fluo/integration/log/LogIT.java
+++
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/log/LogIT.java
@@ -78,16 +78,16 @@ public void load(TransactionBase tx, Context context)
throws Exception {
static class TriggerLoader implements Loader {
- int r;
+ int row;
TriggerLoader(int row) {
- r = row;
+ this.row = row;
}
@Override
public void load(TransactionBase tx, Context context) throws Exception {
- tx.set(r + "", STAT_COUNT, "1");
- tx.setWeakNotification(r + "", STAT_COUNT);
+ tx.set(row + "", STAT_COUNT, "1");
+ tx.setWeakNotification(row + "", STAT_COUNT);
}
}
@@ -222,16 +222,21 @@ public void testSummaryLogging() throws Exception {
String logMsgs = writer.toString();
logMsgs = logMsgs.replace('\n', ' ');
- Assert.assertTrue(logMsgs.matches(
- ".*txid: \\d+ thread : \\d+ time: \\d+ \\(\\d+ \\d+\\) #ret: 0 #set: 1
#collisions: 0 waitTime: \\d+ committed: true class: TriggerLoader.*"));
- Assert.assertTrue(logMsgs.matches(
- ".*txid: \\d+ thread : \\d+ time: \\d+ \\(\\d+ \\d+\\) #ret: 1 #set: 1
#collisions: 0 waitTime: \\d+ committed: true class: SimpleLoader.*"));
- Assert.assertTrue(logMsgs.matches(
- ".*txid: \\d+ thread : \\d+ time: \\d+ \\(\\d+ \\d+\\) #ret: 1 #set: 1
#collisions: 1 waitTime: \\d+ committed: false class: SimpleLoader.*"));
- Assert.assertTrue(logMsgs.matches(
- ".*txid: \\d+ thread : \\d+ time: \\d+ \\(\\d+ \\d+\\) #ret: 2 #set: 1
#collisions: 0 waitTime: \\d+ committed: true class: TestObserver.*"));
- Assert.assertTrue(logMsgs.matches(
- ".*txid: \\d+ thread : \\d+ time: \\d+ \\(\\d+ \\d+\\) #ret: 2 #set: 1
#collisions: 1 waitTime: \\d+ committed: false class: TestObserver.*"));
+ Assert.assertTrue(logMsgs.matches(".*txid: \\d+ thread : \\d+ "
+ + "time: \\d+ \\(\\d+ \\d+\\) #ret: 0 #set: 1 #collisions: 0 waitTime:
\\d+ "
+ + "committed: true class: TriggerLoader.*"));
+ Assert.assertTrue(logMsgs.matches(".*txid: \\d+ thread : \\d+ "
+ + "time: \\d+ \\(\\d+ \\d+\\) #ret: 1 #set: 1 #collisions: 0 waitTime:
\\d+ "
+ + "committed: true class: SimpleLoader.*"));
+ Assert.assertTrue(logMsgs.matches(".*txid: \\d+ thread : \\d+ "
+ + "time: \\d+ \\(\\d+ \\d+\\) #ret: 1 #set: 1 #collisions: 1 waitTime:
\\d+ "
+ + "committed: false class: SimpleLoader.*"));
+ Assert.assertTrue(logMsgs.matches(".*txid: \\d+ thread : \\d+ "
+ + "time: \\d+ \\(\\d+ \\d+\\) #ret: 2 #set: 1 #collisions: 0 waitTime:
\\d+ "
+ + "committed: true class: TestObserver.*"));
+ Assert.assertTrue(logMsgs.matches(".*txid: \\d+ thread : \\d+ "
+ + "time: \\d+ \\(\\d+ \\d+\\) #ret: 2 #set: 1 #collisions: 1 waitTime:
\\d+ "
+ + "committed: false class: TestObserver.*"));
}
@Test
@@ -364,15 +369,15 @@ public void testGetMethods() {
logger.setLevel(level);
}
- String origLogMsgs = writer.toString();
- String logMsgs = origLogMsgs.replace('\n', ' ');
-
String pattern = ".*txid: (\\d+) begin\\(\\) thread: \\d+";
pattern += ".*txid: \\1 \\Qget([r1 f1 q1 , r2 f1 q2 ]) -> [r2 f1 q2 =v4,
r1 f1 q1 =v1]\\E";
pattern += ".*txid: \\1 \\Qget([r1, r2], [f1 q1 ]) -> [r1=[f1 q1 =v1],
r2=[f1 q1 =v3]]\\E";
pattern += ".*txid: \\1 \\Qget(r1, [f1 q1 , f1 q2 ]) -> [f1 q1 =v1, f1 q2
=v2]\\E";
pattern += ".*txid: \\1 \\Qget(r1, f1 q1 ) -> v1\\E";
pattern += ".*txid: \\1 close\\(\\).*";
+
+ String origLogMsgs = writer.toString();
+ String logMsgs = origLogMsgs.replace('\n', ' ');
Assert.assertTrue(logMsgs.matches(pattern));
}
@@ -418,9 +423,6 @@ public void testBinaryLogging() throws Exception {
miniFluo.waitForObservers();
- String origLogMsgs = writer.toString();
- String logMsgs = origLogMsgs.replace('\n', ' ');
-
String pattern = ".*txid: (\\d+) begin\\(\\) thread: \\d+";
pattern += ".*txid: \\1 class:
org.apache.fluo.integration.log.LogIT\\$BinaryLoader1";
pattern += ".*txid: \\1 \\Qdelete(r\\x051, c\\x021 c\\xf51 )\\E";
@@ -433,21 +435,23 @@ public void testBinaryLogging() throws Exception {
pattern += ".*txid: \\1 \\QsetWeakNotification(r\\x062, c\\x092 c\\xe52
)\\E";
pattern += ".*txid: \\1 \\Qcommit()\\E -> SUCCESSFUL commitTs: \\d+";
pattern += ".*";
+
+ String origLogMsgs = writer.toString();
+ String logMsgs = origLogMsgs.replace('\n', ' ');
Assert.assertTrue(origLogMsgs, logMsgs.matches(pattern));
waitForClose(writer, pattern);
- String v1 = "\\Qr\\x051=[c\\x092 c\\xe52 =v\\x992]\\E";
- String v2 = "\\Qr\\x062=[c\\x092 c\\xe52 =v\\xd91]\\E";
+ final String v1 = "\\Qr\\x051=[c\\x092 c\\xe52 =v\\x992]\\E";
+ final String v2 = "\\Qr\\x062=[c\\x092 c\\xe52 =v\\xd91]\\E";
pattern = ".*txid: (\\d+) begin\\(\\) thread: \\d+";
pattern += ".*txid: \\1 \\Qtrigger: r\\x062 c\\x092 c\\xe52 4\\E";
pattern += ".*txid: \\1 \\Qclass:
org.apache.fluo.integration.log.LogIT$BinaryObserver\\E";
pattern += ".*txid: \\1 \\Qget(r\\x051, c\\x092 c\\xe52 ) -> v\\x992\\E";
- pattern +=
- ".*txid: \\1 \\Qget(r\\x062, [c\\x021 c\\xf51 , c\\x092 c\\xe52 ])
-> [c\\x092 c\\xe52 =v\\xd91]\\E";
- pattern +=
- ".*txid: \\1 \\Qget([r\\x051, r\\x062], [c\\x021 c\\xf51 , c\\x092
c\\xe52 ]) -> [\\E("
- + v1 + "|" + v2 + ")\\, (" + v1 + "|" + v2 + ")\\]";
+ pattern += ".*txid: \\1 \\Qget(r\\x062, [c\\x021 c\\xf51 , c\\x092
c\\xe52 ]) -> "
+ + "[c\\x092 c\\xe52 =v\\xd91]\\E";
+ pattern += ".*txid: \\1 \\Qget([r\\x051, r\\x062], [c\\x021 c\\xf51 ,
c\\x092 c\\xe52 ]) -> "
+ + "[\\E(" + v1 + "|" + v2 + ")\\, (" + v1 + "|" + v2 + ")\\]";
pattern += ".*txid: \\1 \\Qcommit() -> SUCCESSFUL commitTs: -1\\E";
pattern += ".*";
Assert.assertTrue(origLogMsgs, logMsgs.matches(pattern));
@@ -545,50 +549,48 @@ public void testScanLogging() {
logger.setLevel(level);
}
- String origLogMsgs = writer.toString();
- String logMsgs = origLogMsgs.replace('\n', ' ');
-
String pattern = "";
-
pattern += ".*txid: (\\d+) begin\\(\\) thread: \\d+";
pattern +=
- ".*txid: \\1 scanId: ([0-9a-f]+)
\\Qscanner().over((-inf,+inf)).fetch([]).build()\\E";
+ ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over((-inf,+inf))" +
".fetch([]).build()\\E";
pattern += ".*txid: \\1 scanId: \\2 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\1 scanId: \\2 \\Qnext()-> r1 f1 q2 v2\\E";
pattern += ".*txid: \\1 scanId: \\2 \\Qnext()-> r2 f1 q1 v3\\E";
pattern += ".*txid: \\1 scanId: \\2 \\Qnext()-> r2 f1 q2 v4\\E";
- pattern +=
- ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over([r1 ,r1\\x00
)).fetch([]).build()\\E";
+ pattern += ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over([r1
,r1\\x00 ))"
+ + ".fetch([]).build()\\E";
pattern += ".*txid: \\1 scanId: \\3 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\1 scanId: \\3 \\Qnext()-> r1 f1 q2 v2\\E";
- pattern +=
- ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over([r1 ,r1\\x00
)).fetch([f1 q1 ]).build()\\E";
+ pattern += ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over([r1
,r1\\x00 ))"
+ + ".fetch([f1 q1 ]).build()\\E";
pattern += ".*txid: \\1 scanId: \\4 \\Qnext()-> r1 f1 q1 v1\\E";
- pattern +=
- ".*txid: \\1 scanId: ([0-9a-f]+)
\\Qscanner().over((-inf,+inf)).fetch([f1 q1 ]).build()\\E";
+ pattern += ".*txid: \\1 scanId: ([0-9a-f]+) \\Qscanner().over((-inf,+inf))"
+ + ".fetch([f1 q1 ]).build()\\E";
pattern += ".*txid: \\1 scanId: \\5 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\1 scanId: \\5 \\Qnext()-> r2 f1 q1 v3\\E";
pattern += ".*txid: \\1 \\Qclose()\\E";
pattern += ".*txid: (\\d+) begin\\(\\) thread: \\d+";
- pattern +=
- ".*txid: \\6 scanId: ([0-9a-f]+)
\\Qscanner().over((-inf,+inf)).fetch([]).byRow().build()\\E";
+ pattern += ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over((-inf,+inf))"
+ + ".fetch([]).byRow().build()\\E";
pattern += ".*txid: \\6 scanId: \\7 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\6 scanId: \\7 \\Qnext()-> r1 f1 q2 v2\\E";
pattern += ".*txid: \\6 scanId: \\7 \\Qnext()-> r2 f1 q1 v3\\E";
pattern += ".*txid: \\6 scanId: \\7 \\Qnext()-> r2 f1 q2 v4\\E";
- pattern +=
- ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over([r1 ,r1\\x00
)).fetch([]).byRow().build()\\E";
+ pattern += ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over([r1
,r1\\x00 ))"
+ + ".fetch([]).byRow().build()\\E";
pattern += ".*txid: \\6 scanId: \\8 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\6 scanId: \\8 \\Qnext()-> r1 f1 q2 v2\\E";
- pattern +=
- ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over([r1 ,r1\\x00
)).fetch([f1 q1 ]).byRow().build()\\E";
+ pattern += ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over([r1
,r1\\x00 ))"
+ + ".fetch([f1 q1 ]).byRow().build()\\E";
pattern += ".*txid: \\6 scanId: \\9 \\Qnext()-> r1 f1 q1 v1\\E";
- pattern +=
- ".*txid: \\6 scanId: ([0-9a-f]+)
\\Qscanner().over((-inf,+inf)).fetch([f1 q1 ]).byRow().build()\\E";
+ pattern += ".*txid: \\6 scanId: ([0-9a-f]+) \\Qscanner().over((-inf,+inf))"
+ + ".fetch([f1 q1 ]).byRow().build()\\E";
pattern += ".*txid: \\6 scanId: \\10 \\Qnext()-> r1 f1 q1 v1\\E";
pattern += ".*txid: \\6 scanId: \\10 \\Qnext()-> r2 f1 q1 v3\\E";
pattern += ".*txid: \\6 \\Qclose()\\E.*";
+ String origLogMsgs = writer.toString();
+ String logMsgs = origLogMsgs.replace('\n', ' ');
Assert.assertTrue(origLogMsgs, logMsgs.matches(pattern));
}
@@ -642,22 +644,20 @@ public void testReadLocks() {
logger.setLevel(level);
}
- String origLogMsgs = writer.toString();
- String logMsgs = origLogMsgs.replace('\n', ' ');
-
String pattern = "";
-
pattern += ".*txid: (\\d+) begin\\(\\) thread: \\d+";
pattern += ".*txid: \\1 \\QwithReadLock().get(r1, f1 q1 ) -> v1\\E";
pattern +=
".*txid: \\1 \\QwithReadLock().get(r2, [f1 q1 , f1 q2 ]) -> [f1 q1
=v3, f1 q2 =v4]\\E";
pattern += ".*txid: \\1 \\QwithReadLock().get([r1 f1 q2 ]) -> [r1 f1 q2
=v2]\\E";
- pattern +=
- ".*txid: \\1 \\QwithReadLock().get([r1, r2], [f1 q1 ]) -> [r1=[f1 q1
=v1], r2=[f1 q1 =v3]]\\E";
+ pattern += ".*txid: \\1 \\QwithReadLock().get([r1, r2], [f1 q1 ]) -> "
+ + "[r1=[f1 q1 =v1], r2=[f1 q1 =v3]]\\E";
pattern += ".*txid: \\1 \\Qset(r3, f1 q1 , 345)\\E";
pattern += ".*txid: \\1 \\Qcommit()\\E -> SUCCESSFUL commitTs: \\d+";
pattern += ".*txid: \\1 \\Qclose()\\E.*";
+ String origLogMsgs = writer.toString();
+ String logMsgs = origLogMsgs.replace('\n', ' ');
Assert.assertTrue(origLogMsgs, logMsgs.matches(pattern));
}
}
diff --git a/modules/integration/src/test/resources/log4j.properties
b/modules/integration-tests/src/main/resources/log4j.properties
similarity index 100%
rename from modules/integration/src/test/resources/log4j.properties
rename to modules/integration-tests/src/main/resources/log4j.properties
diff --git a/modules/mapreduce/pom.xml b/modules/mapreduce/pom.xml
index 092f770b..034fa4f6 100644
--- a/modules/mapreduce/pom.xml
+++ b/modules/mapreduce/pom.xml
@@ -58,8 +58,7 @@
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
- <artifactId>fluo-integration</artifactId>
- <type>test-jar</type>
+ <artifactId>fluo-integration-tests</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/pom.xml b/pom.xml
index e320cde2..f4073b78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,10 +36,10 @@
<module>modules/accumulo</module>
<module>modules/api</module>
<module>modules/cluster</module>
- <module>modules/core</module>
<module>modules/command</module>
+ <module>modules/core</module>
<module>modules/distribution</module>
- <module>modules/integration</module>
+ <module>modules/integration-tests</module>
<module>modules/mapreduce</module>
<module>modules/mini</module>
</modules>
@@ -180,9 +180,8 @@
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
- <artifactId>fluo-integration</artifactId>
+ <artifactId>fluo-integration-tests</artifactId>
<version>${project.version}</version>
- <type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services