asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject incubator-asterixdb git commit: Give names to parameterized JUnit tests
Date Thu, 07 Jan 2016 18:10:34 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master 09b2ad73d -> 25d1f073c


Give names to parameterized JUnit tests

Change-Id: Ifb53be6df9ad0efb1032b03ad8622c1bb7b7afbe
Reviewed-on: https://asterix-gerrit.ics.uci.edu/568
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/25d1f073
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/25d1f073
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/25d1f073

Branch: refs/heads/master
Commit: 25d1f073c3a1dc24157bb937eec903143e898d7d
Parents: 09b2ad7
Author: Till Westmann <tillw@apache.org>
Authored: Thu Jan 7 08:36:33 2016 -0800
Committer: Till Westmann <tillw@apache.org>
Committed: Thu Jan 7 10:05:47 2016 -0800

----------------------------------------------------------------------
 .../org/apache/asterix/test/metadata/MetadataTest.java  |  2 +-
 .../apache/asterix/test/optimizer/OptimizerTest.java    |  2 +-
 .../org/apache/asterix/test/runtime/ExecutionTest.java  |  2 +-
 .../org/apache/asterix/test/runtime/RepeatedTest.java   |  2 +-
 .../apache/asterix/test/runtime/SqlppExecutionTest.java |  2 +-
 .../apache/asterix/test/sqlpp/OptimizerParserTest.java  |  2 +-
 .../apache/asterix/test/sqlpp/RuntimeParserTest.java    |  2 +-
 .../org/apache/asterix/test/sqlpp/SmokeParserTest.java  |  2 +-
 .../asterix/testframework/context/TestCaseContext.java  | 12 ++++++++++++
 9 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/metadata/MetadataTest.java
----------------------------------------------------------------------
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 @@ public class MetadataTest {
         }
     }
 
-    @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();

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
----------------------------------------------------------------------
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 9eee818..538e7ca 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 @@ public class OptimizerTest {
         }
     }
 
-    @Parameters
+    @Parameters(name = "OptimizerTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/runtime/ExecutionTest.java
----------------------------------------------------------------------
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 922486f..199ae39 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
@@ -66,7 +66,7 @@ public class ExecutionTest {
         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) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/runtime/RepeatedTest.java
----------------------------------------------------------------------
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 @@ public class RepeatedTest extends ExecutionTest {
     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;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionTest.java
----------------------------------------------------------------------
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 @@ public class SqlppExecutionTest {
         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) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/OptimizerParserTest.java
----------------------------------------------------------------------
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 @@ public class OptimizerParserTest {
         }
     }
 
-    @Parameters
+    @Parameters(name = "OptimizerParserTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
----------------------------------------------------------------------
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 @@ public class RuntimeParserTest {
         }
     }
 
-    @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) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
----------------------------------------------------------------------
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 @@ public class SmokeParserTest {
         }
     }
 
-    @Parameters
+    @Parameters(name = "SmokeParserTest {index}: {0}")
     public static Collection<Object[]> tests() {
         Collection<Object[]> testArgs = new ArrayList<Object[]>();
         suiteBuild(new File(PATH_QUERIES), testArgs, "");

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/25d1f073/asterix-test-framework/src/main/java/org/apache/asterix/testframework/context/TestCaseContext.java
----------------------------------------------------------------------
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 @@ public class TestCaseContext {
                 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;


Mime
View raw message