asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Give names to parameterized JUnit tests
Date Fri, 01 Jan 2016 17:35:05 GMT
Till Westmann has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/568

Change subject: Give names to parameterized JUnit tests
......................................................................

Give names to parameterized JUnit tests

Change-Id: Ifb53be6df9ad0efb1032b03ad8622c1bb7b7afbe
---
M asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
M asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
M asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
M asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java
M asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
M asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
M asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
M asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
M asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
9 files changed, 20 insertions(+), 9 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/68/568/1

diff --git a/asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
index 6c6e411..4089646 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
@@ -67,7 +67,7 @@
         }
     }
 
-    @Parameters
+    @Parameters(name = "MetadataTest {index}: {0}")
     public static Collection<Object[]> tests() throws Exception {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         TestCaseContext.Builder b = new TestCaseContext.Builder();
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
index 2f8a910..b886fee 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
@@ -111,7 +111,7 @@
         }
     }
 
-    @Parameters
+    @Parameters(name = "OptimizerTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
index 7a55c90..30c4d94 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
@@ -23,7 +23,6 @@
 import java.util.Collection;
 import java.util.logging.Logger;
 
-import org.apache.asterix.api.common.AsterixHyracksIntegrationUtil;
 import org.apache.asterix.common.config.AsterixTransactionProperties;
 import org.apache.asterix.test.aql.TestExecutor;
 import org.apache.asterix.testframework.context.TestCaseContext;
@@ -70,7 +69,7 @@
         ExecutionTestUtil.tearDown();
     }
 
-    @Parameters
+    @Parameters(name = "ExecutionTest {index}: {0}")
     public static Collection<Object[]> tests() throws Exception {
         Collection<Object[]> testArgs = buildTestsInXml(TestCaseContext.ONLY_TESTSUITE_XML_NAME);
         if (testArgs.size() == 0) {
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java b/asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java
index edb05d4..377dd69 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java
@@ -86,7 +86,7 @@
     private int count;
     private final TestExecutor testExecutor = new TestExecutor();
 
-    @Parameters
+    @Parameters(name = "RepeatedTest {index}: {0}")
     public static Collection<Object[]> tests() throws Exception {
         Collection<Object[]> testArgs = buildTestsInXml(TestCaseContext.DEFAULT_REPEADED_TESTSUITE_XML_NAME);
         return testArgs;
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
index 22a3ad7..cbb14c5 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
@@ -68,7 +68,7 @@
         AsterixHyracksIntegrationUtil.removeTestStorageFiles();
     }
 
-    @Parameters
+    @Parameters(name = "SqlppExecutionTest {index}: {0}")
     public static Collection<Object[]> tests() throws Exception {
         Collection<Object[]> testArgs = buildTestsInXml("only_sqlpp.xml");
         if (testArgs.size() == 0) {
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
index 61c6064..485d658 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
@@ -81,7 +81,7 @@
         }
     }
 
-    @Parameters
+    @Parameters(name = "OptimizerParserTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
index aca1e13..d9d03f9 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
@@ -62,7 +62,7 @@
         }
     }
 
-    @Parameters
+    @Parameters(name = "RuntimeParserTest {index}: {0}")
     public static Collection<Object[]> tests() throws Exception {
         Collection<Object[]> testArgs = buildTestsInXml(TestCaseContext.ONLY_TESTSUITE_XML_NAME);
         if (testArgs.size() == 0) {
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
index a924d7c..04213a8 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
@@ -81,7 +81,7 @@
         }
     }
 
-    @Parameters
+    @Parameters(name = "SmokeParserTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");
diff --git a/asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
b/asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
index 9f847f8..e192806 100644
--- a/asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
+++ b/asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
@@ -175,6 +175,18 @@
                 cUnit.getOutputDir().getValue() + "." + OutputFormat.forCompilationUnit(cUnit).extension());
     }
 
+    @Override
+    public String toString() {
+        final TestCase testCase = getTestCase();
+        StringBuilder sb = new StringBuilder(testCase.getFilePath());
+        sb.append(':');
+        for (CompilationUnit cu : testCase.getCompilationUnit()) {
+            sb.append(' ');
+            sb.append(cu.getName());
+        }
+        return sb.toString();
+    }
+
     public static class Builder {
         private final boolean m_doSlow;
         private final Pattern m_re;

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/568
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb53be6df9ad0efb1032b03ad8622c1bb7b7afbe
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>

Mime
View raw message