merge asterix_lsm_stabilization
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index 6339c07..dfbd305 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -15,12 +15,16 @@
package edu.uci.ics.asterix.test.metadata;
import java.io.File;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
import edu.uci.ics.asterix.common.config.GlobalConfig;
@@ -30,13 +34,15 @@
/**
* Executes the Metadata tests.
*/
+@RunWith(Parameterized.class)
public class MetadataTest {
+ private TestCaseContext tcCtx;
+
private static final String PATH_ACTUAL = "mdtest/";
private static final String PATH_BASE = "src/test/resources/metadata/";
private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
private static final String WEB_SERVER_PORT = "19002";
- private static List<TestCaseContext> testCaseCollection;
@BeforeClass
public static void setUp() throws Exception {
@@ -51,8 +57,7 @@
}
AsterixHyracksIntegrationUtil.init();
- TestCaseContext.Builder b = new TestCaseContext.Builder();
- testCaseCollection = b.build(new File(PATH_BASE));
+
}
@AfterClass
@@ -75,11 +80,23 @@
}
}
- @Test
- public void test() throws Exception {
- for (TestCaseContext testCaseCtx : testCaseCollection) {
- TestsUtils.executeTest(PATH_ACTUAL, testCaseCtx);
+ @Parameters
+ public static Collection<Object[]> tests() throws Exception {
+ Collection<Object[]> testArgs = new ArrayList<Object[]>();
+ TestCaseContext.Builder b = new TestCaseContext.Builder();
+ for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
+ testArgs.add(new Object[] { ctx });
}
+ return testArgs;
}
-}
+ public MetadataTest(TestCaseContext tcCtx) {
+ this.tcCtx = tcCtx;
+ }
+
+ @Test
+ public void test() throws Exception {
+ TestsUtils.executeTest(PATH_ACTUAL, tcCtx);
+ }
+
+}
\ No newline at end of file
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index bb66d0d..0f1f8b5 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -58,12 +58,12 @@
System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
File outdir = new File(PATH_ACTUAL);
outdir.mkdirs();
-
+
File log = new File("asterix_logs");
if (log.exists()) {
- FileUtils.deleteDirectory(log);
+ FileUtils.deleteDirectory(log);
}
-
+
AsterixHyracksIntegrationUtil.init();
// Set the node resolver to be the identity resolver that expects node names
// to be node controller ids; a valid assumption in test environment.
@@ -79,10 +79,10 @@
if (files == null || files.length == 0) {
outdir.delete();
}
-
+
File log = new File("asterix_logs");
if (log.exists()) {
- FileUtils.deleteDirectory(log);
+ FileUtils.deleteDirectory(log);
}
}
@@ -138,7 +138,7 @@
}
Assume.assumeTrue(!skipped);
- LOGGER.severe("RUN TEST: \"" + queryFile.getPath() + "\"");
+ LOGGER.info("RUN TEST: \"" + queryFile.getPath() + "\"");
Reader query = new BufferedReader(new InputStreamReader(new FileInputStream(queryFile), "UTF-8"));
PrintWriter plan = new PrintWriter(actualFile);
AsterixJavaClient asterix = new AsterixJavaClient(
@@ -180,7 +180,7 @@
throw new Exception("Result for " + queryFile + " changed at line " + num + ":\n< \n> "
+ lineActual);
}
- LOGGER.severe("Test \"" + queryFile.getPath() + "\" PASSED!");
+ LOGGER.info("Test \"" + queryFile.getPath() + "\" PASSED!");
actualFile.delete();
} finally {
readerExpected.close();
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 6478d0a..5ca397b 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -1,7 +1,8 @@
package edu.uci.ics.asterix.test.runtime;
import java.io.File;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
@@ -9,6 +10,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
import edu.uci.ics.asterix.common.config.GlobalConfig;
@@ -20,71 +22,76 @@
/**
* Runs the runtime test cases under 'asterix-app/src/test/resources/runtimets'.
*/
-//@RunWith(Parameterized.class)
+@RunWith(Parameterized.class)
public class ExecutionTest {
- private static final String PATH_ACTUAL = "rttest/";
- private static final String PATH_BASE = "src/test/resources/runtimets/";
+ private static final String PATH_ACTUAL = "rttest/";
+ private static final String PATH_BASE = "src/test/resources/runtimets/";
- private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
- private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data",
- "nc2data" };
+ private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
+ private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
- private static List<TestCaseContext> testCaseCollection;
+ @BeforeClass
+ public static void setUp() throws Exception {
+ System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
+ System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
+ File outdir = new File(PATH_ACTUAL);
+ outdir.mkdirs();
- @BeforeClass
- public static void setUp() throws Exception {
- System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY,
- TEST_CONFIG_FILE_NAME);
- System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002");
- File outdir = new File(PATH_ACTUAL);
- outdir.mkdirs();
+ File log = new File("asterix_logs");
+ if (log.exists()) {
+ FileUtils.deleteDirectory(log);
+ }
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ AsterixHyracksIntegrationUtil.init();
- AsterixHyracksIntegrationUtil.init();
+ // TODO: Uncomment when hadoop version is upgraded and adapters are
+ // ported.
+ HDFSCluster.getInstance().setup();
- // TODO: Uncomment when hadoop version is upgraded and adapters are
- // ported.
- HDFSCluster.getInstance().setup();
+ // Set the node resolver to be the identity resolver that expects node names
+ // to be node controller ids; a valid assumption in test environment.
+ System.setProperty(FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY,
+ IdentitiyResolverFactory.class.getName());
+ }
- // Set the node resolver to be the identity resolver that expects node
- // names
- // to be node controller ids; a valid assumption in test environment.
- System.setProperty(
- FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY,
- IdentitiyResolverFactory.class.getName());
- TestCaseContext.Builder b = new TestCaseContext.Builder();
- testCaseCollection = b.build(new File(PATH_BASE));
- }
+ @AfterClass
+ public static void tearDown() throws Exception {
+ AsterixHyracksIntegrationUtil.deinit();
+ File outdir = new File(PATH_ACTUAL);
+ File[] files = outdir.listFiles();
+ if (files == null || files.length == 0) {
+ outdir.delete();
+ }
+ // clean up the files written by the ASTERIX storage manager
+ for (String d : ASTERIX_DATA_DIRS) {
+ TestsUtils.deleteRec(new File(d));
+ }
- @AfterClass
- public static void tearDown() throws Exception {
- AsterixHyracksIntegrationUtil.deinit();
- File outdir = new File(PATH_ACTUAL);
- File[] files = outdir.listFiles();
- if (files == null || files.length == 0) {
- outdir.delete();
- }
- // clean up the files written by the ASTERIX storage manager
- for (String d : ASTERIX_DATA_DIRS) {
- TestsUtils.deleteRec(new File(d));
- }
+ File log = new File("asterix_logs");
+ if (log.exists()) {
+ FileUtils.deleteDirectory(log);
+ }
+ HDFSCluster.getInstance().cleanup();
+ }
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
- HDFSCluster.getInstance().cleanup();
- }
+ @Parameters
+ public static Collection<Object[]> tests() throws Exception {
+ Collection<Object[]> testArgs = new ArrayList<Object[]>();
+ TestCaseContext.Builder b = new TestCaseContext.Builder();
+ for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
+ testArgs.add(new Object[] { ctx });
+ }
+ return testArgs;
+ }
- @Test
- public void test() throws Exception {
- for (TestCaseContext testCaseCtx : testCaseCollection) {
- TestsUtils.executeTest(PATH_ACTUAL, testCaseCtx);
- }
+ private TestCaseContext tcCtx;
- }
-}
+ public ExecutionTest(TestCaseContext tcCtx) {
+ this.tcCtx = tcCtx;
+ }
+
+ @Test
+ public void test() throws Exception {
+ TestsUtils.executeTest(PATH_ACTUAL, tcCtx);
+ }
+}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/logging.properties b/asterix-app/src/test/resources/logging.properties
index a5935be..f04eb3de 100644
--- a/asterix-app/src/test/resources/logging.properties
+++ b/asterix-app/src/test/resources/logging.properties
@@ -61,6 +61,7 @@
# messages:
-#edu.uci.ics.asterix.level = FINEST
-#edu.uci.ics.hyracks.algebricks.level = FINEST
+edu.uci.ics.asterix.test.level = INFO
+#edu.uci.ics.asterix.level = FINE
+#edu.uci.ics.hyracks.algebricks.level = FINE
#edu.uci.ics.hyracks.level = INFO