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
