This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit d5bcff788cc5ac58cf1b5d226033f160f22ad2ed Author: juanpablo <juanpa...@apache.org> AuthorDate: Tue Mar 17 21:59:32 2020 +0100 move test adaptees to src/test + generate test-jar in order to not have to exclude coverage metrics from jspwiki-210-test-adaptees (it doesn't make sense, it's test code) --- jspwiki-210-adapters/pom.xml | 5 ++-- jspwiki-210-test-adaptees/pom.xml | 25 ++++++++++++++++ .../java/com/example/filters/TwoXFilter.java | 0 .../java/com/example/filters/TwoXFilterTest.java | 34 ---------------------- .../java/com/example/plugins/TwoXPlugin.java | 0 .../java/com/example/plugins/TwoXPluginTest.java | 33 --------------------- 6 files changed, 28 insertions(+), 69 deletions(-) diff --git a/jspwiki-210-adapters/pom.xml b/jspwiki-210-adapters/pom.xml index cde8e1c..fb4b58b 100644 --- a/jspwiki-210-adapters/pom.xml +++ b/jspwiki-210-adapters/pom.xml @@ -27,7 +27,7 @@ <modelVersion>4.0.0</modelVersion> <artifactId>jspwiki-210-adapters</artifactId> - <name>Apache JSPWiki adapters for extensions not using public api</name> + <name>Apache JSPWiki adapters for pre-public api</name> <dependencies> <dependency> @@ -67,8 +67,9 @@ <dependency> <groupId>${project.groupId}</groupId> <artifactId>jspwiki-210-test-adaptees</artifactId> - <scope>test</scope> <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> </dependency> <dependency> diff --git a/jspwiki-210-test-adaptees/pom.xml b/jspwiki-210-test-adaptees/pom.xml index f8b1a4f..2512784 100644 --- a/jspwiki-210-test-adaptees/pom.xml +++ b/jspwiki-210-test-adaptees/pom.xml @@ -67,4 +67,29 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + <phase>package</phase> + <configuration> + <excludes> + <exclude>**/test*/**</exclude> + <exclude>**/*Test.class</exclude> + <exclude>**/*Test$*.class</exclude> + <exclude>**/*Tests.class</exclude> + </excludes> + <skipIfEmpty>true</skipIfEmpty> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/jspwiki-210-test-adaptees/src/main/java/com/example/filters/TwoXFilter.java b/jspwiki-210-test-adaptees/src/test/java/com/example/filters/TwoXFilter.java similarity index 100% rename from jspwiki-210-test-adaptees/src/main/java/com/example/filters/TwoXFilter.java rename to jspwiki-210-test-adaptees/src/test/java/com/example/filters/TwoXFilter.java diff --git a/jspwiki-210-test-adaptees/src/test/java/com/example/filters/TwoXFilterTest.java b/jspwiki-210-test-adaptees/src/test/java/com/example/filters/TwoXFilterTest.java deleted file mode 100644 index cb682c0..0000000 --- a/jspwiki-210-test-adaptees/src/test/java/com/example/filters/TwoXFilterTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - 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 com.example.filters; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -public class TwoXFilterTest { - - @Test - public void testFilter() throws Exception { - final TwoXFilter txf = new TwoXFilter(); - txf.initialize( null, null ); - Assertions.assertEquals("see how I care about yor content - hmmm...", txf.postTranslate( null, null ) ); - } - -} diff --git a/jspwiki-210-test-adaptees/src/main/java/com/example/plugins/TwoXPlugin.java b/jspwiki-210-test-adaptees/src/test/java/com/example/plugins/TwoXPlugin.java similarity index 100% rename from jspwiki-210-test-adaptees/src/main/java/com/example/plugins/TwoXPlugin.java rename to jspwiki-210-test-adaptees/src/test/java/com/example/plugins/TwoXPlugin.java diff --git a/jspwiki-210-test-adaptees/src/test/java/com/example/plugins/TwoXPluginTest.java b/jspwiki-210-test-adaptees/src/test/java/com/example/plugins/TwoXPluginTest.java deleted file mode 100644 index 6d54680..0000000 --- a/jspwiki-210-test-adaptees/src/test/java/com/example/plugins/TwoXPluginTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - 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 com.example.plugins; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -public class TwoXPluginTest { - - @Test - public void testPlugin() throws Exception { - final TwoXPlugin txp = new TwoXPlugin(); - Assertions.assertEquals("hakuna matata", txp.execute( null, null ) ); - } - -}