JENA-923: jena-base now used in testing
Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/b06ed195 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/b06ed195 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/b06ed195 Branch: refs/heads/master Commit: b06ed195677975477d778791d69f041504e2479d Parents: 9eedadc Author: Andy Seaborne <[email protected]> Authored: Wed Apr 29 13:04:15 2015 +0100 Committer: Andy Seaborne <[email protected]> Committed: Wed Apr 29 13:04:15 2015 +0100 ---------------------------------------------------------------------- jena-arq/pom.xml | 8 +++ jena-base/pom.xml | 12 ++++ .../org/apache/jena/atlas/junit/BaseTest.java | 21 +++--- .../apache/jena/atlas/junit/TextListener2.java | 69 ++++++++++++++++++++ jena-core/pom.xml | 8 +++ jena-csv/pom.xml | 3 +- jena-fuseki1/pom.xml | 10 +++ jena-fuseki2/jena-fuseki-core/pom.xml | 4 +- jena-sdb/pom.xml | 16 +++-- jena-spatial/pom.xml | 3 +- jena-tdb/pom.xml | 6 +- jena-text/pom.xml | 3 +- 12 files changed, 139 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-arq/pom.xml ---------------------------------------------------------------------- diff --git a/jena-arq/pom.xml b/jena-arq/pom.xml index 399a42e..8120dbc 100644 --- a/jena-arq/pom.xml +++ b/jena-arq/pom.xml @@ -67,6 +67,14 @@ <dependency> <groupId>org.apache.jena</groupId> + <artifactId>jena-base</artifactId> + <classifier>tests</classifier> + <version>3.0.0-SNAPSHOT</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.jena</groupId> <artifactId>jena-shaded-guava</artifactId> <version>3.0.0-SNAPSHOT</version> </dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-base/pom.xml ---------------------------------------------------------------------- diff --git a/jena-base/pom.xml b/jena-base/pom.xml index 0acf545..f8e2fe4 100644 --- a/jena-base/pom.xml +++ b/jena-base/pom.xml @@ -71,6 +71,18 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <includes> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-base/src/test/java/org/apache/jena/atlas/junit/BaseTest.java ---------------------------------------------------------------------- diff --git a/jena-base/src/test/java/org/apache/jena/atlas/junit/BaseTest.java b/jena-base/src/test/java/org/apache/jena/atlas/junit/BaseTest.java index 6d5f15a..847dc38 100644 --- a/jena-base/src/test/java/org/apache/jena/atlas/junit/BaseTest.java +++ b/jena-base/src/test/java/org/apache/jena/atlas/junit/BaseTest.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.jena.atlas.junit; +package org.apache.jena.atlas.junit ; import java.util.ArrayList ; import java.util.List ; @@ -24,22 +24,27 @@ import java.util.Locale ; import org.junit.Assert ; -public class BaseTest extends Assert -{ - public static void assertEqualsIgnoreCase(String msg, String a, String b) - { +public class BaseTest extends Assert { + public static void assertEqualsIgnoreCase(String a, String b) { + a = a.toLowerCase(Locale.ROOT) ; + b = b.toLowerCase(Locale.ROOT) ; + assertEquals(a, b) ; + } + + public static void assertEqualsIgnoreCase(String msg, String a, String b) { a = a.toLowerCase(Locale.ROOT) ; b = b.toLowerCase(Locale.ROOT) ; assertEquals(msg, a, b) ; } - + public static <T> void assertEqualsUnordered(List<T> list1, List<T> list2) { if ( list1.size() != list2.size() ) - fail("Expected: "+list1+" : Actual: "+list2) ; + fail("Expected: " + list1 + " : Actual: " + list2) ; List<T> list2a = new ArrayList<>(list2) ; for ( T elt : list1 ) list2a.remove(elt) ; if ( list2a.size() != 0 ) - fail("Expected: "+list1+" : Actual: "+list2) ; + fail("Expected: " + list1 + " : Actual: " + list2) ; } + } http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-base/src/test/java/org/apache/jena/atlas/junit/TextListener2.java ---------------------------------------------------------------------- diff --git a/jena-base/src/test/java/org/apache/jena/atlas/junit/TextListener2.java b/jena-base/src/test/java/org/apache/jena/atlas/junit/TextListener2.java new file mode 100644 index 0000000..5bd338b --- /dev/null +++ b/jena-base/src/test/java/org/apache/jena/atlas/junit/TextListener2.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.jena.atlas.junit; + +import java.io.PrintStream ; + +import org.junit.internal.TextListener ; +import org.junit.runner.Description ; +import org.junit.runner.notification.Failure ; + +public class TextListener2 extends TextListener +{ + private PrintStream out ; + int count = 0 ; + + public TextListener2(PrintStream writer) + { + super(writer) ; + this.out = writer ; + } + + @Override + public void testRunStarted(Description description) + { + //count = 0 ; + } + + @Override + public void testStarted(Description description) { + newline() ; + out.append('.'); + } + + private void newline() + { + if ( count != 0 && count%50 == 0 ) + out.println(); + count++ ; + } + + @Override + public void testFailure(Failure failure) { + newline() ; + out.append('E'); + } + + @Override + public void testIgnored(Description description) { + newline() ; + out.append('I'); + } + +} http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-core/pom.xml ---------------------------------------------------------------------- diff --git a/jena-core/pom.xml b/jena-core/pom.xml index e8d26dd..6cb0722 100644 --- a/jena-core/pom.xml +++ b/jena-core/pom.xml @@ -44,6 +44,14 @@ <artifactId>jena-base</artifactId> <version>3.0.0-SNAPSHOT</version> </dependency> + + <dependency> + <groupId>org.apache.jena</groupId> + <artifactId>jena-base</artifactId> + <version>3.0.0-SNAPSHOT</version> + <scope>test</scope> + <classifier>tests</classifier> + </dependency> <dependency> <groupId>org.apache.jena</groupId> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-csv/pom.xml ---------------------------------------------------------------------- diff --git a/jena-csv/pom.xml b/jena-csv/pom.xml index 6bbcfde..2b1344a 100644 --- a/jena-csv/pom.xml +++ b/jena-csv/pom.xml @@ -63,9 +63,8 @@ <!-- Testing support --> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> + <artifactId>jena-base</artifactId> <version>3.0.0-SNAPSHOT</version> - <type>jar</type> <classifier>tests</classifier> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-fuseki1/pom.xml ---------------------------------------------------------------------- diff --git a/jena-fuseki1/pom.xml b/jena-fuseki1/pom.xml index f60e17a..6fe2050 100644 --- a/jena-fuseki1/pom.xml +++ b/jena-fuseki1/pom.xml @@ -92,10 +92,20 @@ <groupId>org.apache.jena</groupId> <artifactId>jena-core</artifactId> <version>3.0.0-SNAPSHOT</version> + <classifier>tests</classifier> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.jena</groupId> + <artifactId>jena-base</artifactId> + <version>3.0.0-SNAPSHOT</version> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.jena</groupId> <artifactId>jena-tdb</artifactId> <version>3.0.0-SNAPSHOT</version> </dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-fuseki2/jena-fuseki-core/pom.xml ---------------------------------------------------------------------- diff --git a/jena-fuseki2/jena-fuseki-core/pom.xml b/jena-fuseki2/jena-fuseki-core/pom.xml index 2db15fb..cda4426 100644 --- a/jena-fuseki2/jena-fuseki-core/pom.xml +++ b/jena-fuseki2/jena-fuseki-core/pom.xml @@ -62,8 +62,10 @@ <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-core</artifactId> + <artifactId>jena-base</artifactId> <version>3.0.0-SNAPSHOT</version> + <classifier>tests</classifier> + <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-sdb/pom.xml ---------------------------------------------------------------------- diff --git a/jena-sdb/pom.xml b/jena-sdb/pom.xml index a1dd72d..6371236 100644 --- a/jena-sdb/pom.xml +++ b/jena-sdb/pom.xml @@ -39,33 +39,35 @@ </properties> <dependencies> + <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-core</artifactId> + <artifactId>jena-arq</artifactId> <version>3.0.0-SNAPSHOT</version> </dependency> <!-- Need the tests as well --> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-core</artifactId> - <classifier>tests</classifier> + <artifactId>jena-arq</artifactId> <version>3.0.0-SNAPSHOT</version> + <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> + <artifactId>jena-core</artifactId> + <classifier>tests</classifier> <version>3.0.0-SNAPSHOT</version> + <scope>test</scope> </dependency> - <!-- Need the tests as well --> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> - <version>3.0.0-SNAPSHOT</version> + <artifactId>jena-base</artifactId> <classifier>tests</classifier> + <version>3.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-spatial/pom.xml ---------------------------------------------------------------------- diff --git a/jena-spatial/pom.xml b/jena-spatial/pom.xml index 1b8c644..e932a66 100644 --- a/jena-spatial/pom.xml +++ b/jena-spatial/pom.xml @@ -50,9 +50,8 @@ <!-- Testing support --> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> + <artifactId>jena-base</artifactId> <version>3.0.0-SNAPSHOT</version> - <type>jar</type> <classifier>tests</classifier> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-tdb/pom.xml ---------------------------------------------------------------------- diff --git a/jena-tdb/pom.xml b/jena-tdb/pom.xml index 9b7348c..194a9c7 100644 --- a/jena-tdb/pom.xml +++ b/jena-tdb/pom.xml @@ -65,15 +65,17 @@ <scope>test</scope> </dependency> - <dependency> + <dependency> <groupId>org.apache.jena</groupId> <artifactId>jena-core</artifactId> + <classifier>tests</classifier> <version>3.0.0-SNAPSHOT</version> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-core</artifactId> + <artifactId>jena-base</artifactId> <classifier>tests</classifier> <version>3.0.0-SNAPSHOT</version> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/jena/blob/b06ed195/jena-text/pom.xml ---------------------------------------------------------------------- diff --git a/jena-text/pom.xml b/jena-text/pom.xml index af5b671..9b28c18 100644 --- a/jena-text/pom.xml +++ b/jena-text/pom.xml @@ -48,9 +48,8 @@ <!-- Testing support --> <dependency> <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> + <artifactId>jena-base</artifactId> <version>3.0.0-SNAPSHOT</version> - <type>jar</type> <classifier>tests</classifier> <scope>test</scope> </dependency>
