Skip to content

Commit b0f3da3

Browse files
gluser1357sremartin-g
authored
WICKET-7072 wicket tester and core tests without test jar (#666)
* WICKET-7072 Remove maven-site-plugin related files Wicket does not use maven-site-plugin since a long time Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Update end year for Copyright to 2023 Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Remove more maven-site-plugin artifacts Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Cleanup pom.xml files Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Move back the JS tests to wicket-core/src/test/js Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Move WebSocketTester to wicket-native-websocket-tester module Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * revert test-jar from wicket-util (see WICKET-7072 26/Sept/23 comment) * removed one unused dependency * added JUnit as non-test dependency in wicket-native-websocket-tester * removed commented-out code * removed unused dependency * reverted requires jakarta.servlet (was not related to test-jar) * added requires jakarta.servlet to support default Eclipse test compile * WICKET-7072: Do not deploy wicket-core-tests artifacts This module is just tests for wicket-core Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Use the fully qualified name of TestFilterConfig class Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * WICKET-7072 Fix the ApacheLicenceHeaderTest for wicket-core Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --------- Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> Co-authored-by: sre <[email protected]> Co-authored-by: gluser1357 <[email protected]> Co-authored-by: Martin Tzvetanov Grigorov <[email protected]>
1 parent c17cd45 commit b0f3da3

File tree

2,346 files changed

+25412
-24973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,346 files changed

+25412
-24973
lines changed

NOTICE

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache Wicket
2-
Copyright 2006-2016 The Apache Software Foundation
2+
Copyright 2006-2023 The Apache Software Foundation
33

44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).
@@ -15,7 +15,7 @@ NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE
1515
src/./wicket-guice
1616
---------------------------------------------------------------------------
1717
Apache Wicket
18-
Copyright 2006-2012 Apache Software Foundation
18+
Copyright 2006-2023 Apache Software Foundation
1919

2020
This product includes software developed at
2121
The Apache Software Foundation (http://www.apache.org/).
@@ -26,7 +26,7 @@ src/./wicket-guice
2626
src/./wicket-examples
2727
---------------------------------------------------------------------------
2828
Apache Wicket Examples
29-
Copyright 2006-2012 Apache Software Foundation
29+
Copyright 2006-2023 Apache Software Foundation
3030

3131
This product includes software developed at
3232
The Apache Software Foundation (http://www.apache.org/).
@@ -66,7 +66,7 @@ src/./wicket-examples
6666
src/./wicket-core
6767
---------------------------------------------------------------------------
6868
Apache Wicket
69-
Copyright 2006-2012 Apache Software Foundation
69+
Copyright 2006-2023 Apache Software Foundation
7070

7171
This product includes software developed at
7272
The Apache Software Foundation (http://www.apache.org/).
@@ -102,7 +102,7 @@ src/./wicket-metrics
102102
---------------------------------------------------------------------------
103103

104104
Apache Wicket Metrics
105-
Copyright 2006-2016 Apache Software Foundation
105+
Copyright 2006-2023 Apache Software Foundation
106106

107107
This product includes software developed at
108108
The Apache Software Foundation (http://www.apache.org/).

pom.xml

+10-3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
<!-- wicket-eclipse-settings is separate released -->
100100
<module>wicket</module>
101101
<module>wicket-core</module>
102+
<module>wicket-tester</module>
103+
<module>wicket-core-tests</module>
102104
<module>wicket-util</module>
103105
<module>wicket-request</module>
104106
<module>wicket-devutils</module>
@@ -184,7 +186,7 @@
184186
<maven-archetype-plugin.version>3.2.1</maven-archetype-plugin.version>
185187
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
186188
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
187-
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
189+
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
188190
<maven-deploy-plugin.version>3.1.0</maven-deploy-plugin.version>
189191
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
190192
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
@@ -374,6 +376,12 @@
374376
<version>10.0.0-M2-SNAPSHOT</version>
375377
<type>jar</type>
376378
</dependency>
379+
<dependency>
380+
<groupId>org.apache.wicket</groupId>
381+
<artifactId>wicket-core-tests</artifactId>
382+
<version>10.0.0-M2-SNAPSHOT</version>
383+
<type>jar</type>
384+
</dependency>
377385
<dependency>
378386
<groupId>org.apache.wicket</groupId>
379387
<artifactId>wicket-devutils</artifactId>
@@ -582,9 +590,8 @@
582590
</dependency>
583591
<dependency>
584592
<groupId>org.apache.wicket</groupId>
585-
<artifactId>wicket-util</artifactId>
593+
<artifactId>wicket-tester</artifactId>
586594
<version>10.0.0-M2-SNAPSHOT</version>
587-
<type>test-jar</type>
588595
<scope>test</scope>
589596
</dependency>
590597
<dependency>

testing/wicket-js-tests/Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ module.exports = function(grunt) {
128128
server: {
129129
options: {
130130
port: 38887,
131-
// debug: true,
131+
debug: true,
132132
middleware: function(connect, options, middlewares) {
133133
middlewares.unshift(function(req, res, next) {
134134
if (req.url.indexOf('submitNestedForm') > 0) {

wicket-auth-roles/pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
</dependency>
4242
<dependency>
4343
<groupId>org.apache.wicket</groupId>
44-
<artifactId>wicket-util</artifactId>
45-
<type>test-jar</type>
44+
<artifactId>wicket-tester</artifactId>
4645
</dependency>
4746
</dependencies>
4847
</project>

wicket-auth-roles/src/test/java/org/apache/wicket/authroles/util/license/ApacheLicenceHeaderTest.java

+16
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package org.apache.wicket.authroles.util.license;
1818

1919
import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2022

2123
/**
2224
* Test that the license headers are in place in this project. The tests are run from
@@ -34,4 +36,18 @@ public ApacheLicenceHeaderTest()
3436
// addHeaders = true;
3537
htmlIgnore.add("src/main/java/org/apache/wicket/authroles/authentication/pages");
3638
}
39+
40+
@BeforeEach
41+
@Override
42+
public void before()
43+
{
44+
super.before();
45+
}
46+
47+
@Test
48+
@Override
49+
public void licenseHeaders()
50+
{
51+
super.licenseHeaders();
52+
}
3753
}

wicket-bean-validation/pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
</dependency>
5757
<dependency>
5858
<groupId>org.apache.wicket</groupId>
59-
<artifactId>wicket-util</artifactId>
60-
<type>test-jar</type>
59+
<artifactId>wicket-tester</artifactId>
6160
</dependency>
6261
<dependency>
6362
<groupId>org.glassfish</groupId>

wicket-bean-validation/src/test/java/org/apache/wicket/bean/validation/util/license/ApacheLicenceHeaderTest.java

+17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package org.apache.wicket.bean.validation.util.license;
1818

1919
import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase;
20+
import org.junit.jupiter.api.BeforeEach;
21+
import org.junit.jupiter.api.Test;
2022

2123
/**
2224
* Test that the license headers are in place in this project. The tests are run from
@@ -34,4 +36,19 @@ public ApacheLicenceHeaderTest()
3436
// addHeaders = true;
3537
htmlIgnore.add("src/main/java/org/apache/wicket/authroles/authentication/pages");
3638
}
39+
40+
@BeforeEach
41+
@Override
42+
public void before()
43+
{
44+
super.before();
45+
}
46+
47+
@Test
48+
@Override
49+
public void licenseHeaders()
50+
{
51+
super.licenseHeaders();
52+
}
53+
3754
}

wicket-cdi/pom.xml

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
<dependencies>
4040
<dependency>
4141
<groupId>org.apache.wicket</groupId>
42-
<artifactId>wicket-util</artifactId>
43-
<type>test-jar</type>
42+
<artifactId>wicket-tester</artifactId>
4443
</dependency>
4544
<dependency>
4645
<groupId>jakarta.annotation</groupId>
@@ -50,6 +49,10 @@
5049
<groupId>jakarta.enterprise</groupId>
5150
<artifactId>jakarta.enterprise.cdi-api</artifactId>
5251
</dependency>
52+
<dependency>
53+
<groupId>jakarta.servlet</groupId>
54+
<artifactId>jakarta.servlet-api</artifactId>
55+
</dependency>
5356
<dependency>
5457
<groupId>org.apache.wicket</groupId>
5558
<artifactId>wicket-core</artifactId>

wicket-cdi/src/main/java/module-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
requires org.apache.wicket.request;
2525
requires org.apache.wicket.core;
2626
requires org.slf4j;
27+
requires static jakarta.servlet;
2728

2829
exports org.apache.wicket.cdi;
2930
}

wicket-cdi/src/test/java/org/apache/wicket/cdi/ApacheLicenceHeaderTest.java

+17
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.Arrays;
2020

2121
import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase;
22+
import org.junit.jupiter.api.BeforeEach;
23+
import org.junit.jupiter.api.Test;
2224

2325
/**
2426
* Test that the license headers are in place in this project. The tests are run
@@ -39,4 +41,19 @@ public ApacheLicenceHeaderTest()
3941
xmlIgnore.add("src/test/java/simplelogger.properties");
4042
xmlPrologIgnore = Arrays.asList("src");
4143
}
44+
45+
@BeforeEach
46+
@Override
47+
public void before()
48+
{
49+
super.before();
50+
}
51+
52+
@Test
53+
@Override
54+
public void licenseHeaders()
55+
{
56+
super.licenseHeaders();
57+
}
58+
4259
}

wicket-core-tests/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

wicket-core-tests/pom.xml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<parent>
21+
<groupId>org.apache.wicket</groupId>
22+
<artifactId>wicket-parent</artifactId>
23+
<version>10.0.0-M2-SNAPSHOT</version>
24+
<relativePath>../pom.xml</relativePath>
25+
</parent>
26+
<artifactId>wicket-core-tests</artifactId>
27+
<packaging>jar</packaging>
28+
<name>Wicket Core Tests</name>
29+
<description>
30+
Internal JUnit Tests for Wicket Core (and Tester).
31+
</description>
32+
<properties>
33+
<osgi.export.package>org.apache.wicket.core.tests*;-noimport:=true</osgi.export.package>
34+
<osgi.import.package>!java*,!kotlin*,!sun.nio.ch,org.slf4j*;version="[1.7,3)",*</osgi.import.package>
35+
<maven.deploy.skip>true</maven.deploy.skip>
36+
</properties>
37+
<dependencies>
38+
<dependency>
39+
<groupId>jakarta.servlet</groupId>
40+
<artifactId>jakarta.servlet-api</artifactId>
41+
<scope>test</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.apache.commons</groupId>
45+
<artifactId>commons-lang3</artifactId>
46+
<scope>test</scope>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.wicket</groupId>
50+
<artifactId>wicket-tester</artifactId>
51+
<scope>test</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.bouncycastle</groupId>
55+
<artifactId>bcprov-jdk18on</artifactId>
56+
<scope>test</scope>
57+
<optional>true</optional>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.hamcrest</groupId>
61+
<artifactId>hamcrest</artifactId>
62+
<scope>test</scope>
63+
</dependency>
64+
</dependencies>
65+
66+
<!--
67+
WICKET-7072:
68+
To run this project successfully we need two things:
69+
(1) no module-info,
70+
otherwise error "The package org.apache.wicket conflicts with a package accessible from another module")
71+
(2) useModulePath=false for maven-compiler plugin available for 3.11+ (see also WICKET-7019),
72+
otherwise error "Can't compile test sources when main sources are missing a module descriptor")
73+
see https://maven.apache.org/plugins/maven-compiler-plugin/plugin-info.html
74+
-->
75+
<build>
76+
<plugins>
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-compiler-plugin</artifactId>
80+
<executions>
81+
<execution>
82+
<id>test-compile</id>
83+
<goals>
84+
<goal>testCompile</goal>
85+
</goals>
86+
<configuration>
87+
<useModulePath>false</useModulePath>
88+
</configuration>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
</plugins>
93+
</build>
94+
95+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file's name contains spaces to ensure proper decoding of MockServletContext#getRealPath()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// static test resource
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.apache.wicket.filetype.TestFileTypeDetector

0 commit comments

Comments
 (0)