-
Notifications
You must be signed in to change notification settings - Fork 4
Add functional tests #16 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ChiuchiuSorin
wants to merge
30
commits into
xwikisas:main
Choose a base branch
from
ChiuchiuSorin:functional-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
14d2bba
Add functional tests #16
ChiuchiuSorin d07aae7
Add functional tests #16
ChiuchiuSorin d629057
Add functional tests #16 - draft
ChiuchiuSorin 1430526
Add functional tests #16
ChiuchiuSorin 9089388
Merge licensing into functional-tests
ChiuchiuSorin 441fb84
Add functional tests #16
ChiuchiuSorin c2116d0
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin 214479e
Add functional tests #16
ChiuchiuSorin 38d87f8
Add functional tests #16
ChiuchiuSorin d7a45e8
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin 1736eb5
Add functional tests #16
ChiuchiuSorin c8c295f
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin 27d5f75
Add functional tests #16
ChiuchiuSorin e0f69bd
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin d94abf8
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin 0dd9234
Add functional tests #16
ChiuchiuSorin 70cffc6
Merge remote-tracking branch 'origin/main' into functional-tests
ChiuchiuSorin 80c2439
Merge branch 'main' into functional-tests
ChiuchiuSorin 9d198d8
Merge branch 'main' into functional-tests
ChiuchiuSorin 5a6f418
Add functional tests #16
ChiuchiuSorin 292a560
Merge branch 'main' into functional-tests
ChiuchiuSorin eec7de8
Add functional tests #16
ChiuchiuSorin 035d5f5
Merge branch 'main' into functional-tests
ChiuchiuSorin 98de17c
Add functional tests #16
ChiuchiuSorin 2a58e5b
Merge branch 'main' into functional-tests
ChiuchiuSorin ffa9b92
Merge branch 'main' into functional-tests
ChiuchiuSorin 71ebc08
[MISC] Add functional tests #16
ChiuchiuSorin 14b883d
Add functional tests #16
ChiuchiuSorin 05f446d
[MISC] Add functional tests #16
ChiuchiuSorin 2c66f85
[MISC] Add functional tests #16
ChiuchiuSorin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
application-admintools-test/application-admintools-test-docker/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <!-- | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| --> | ||
|
|
||
| <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"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>com.xwiki.admintools</groupId> | ||
| <artifactId>application-admintools-test</artifactId> | ||
| <version>1.0.2-SNAPSHOT</version> | ||
| </parent> | ||
| <artifactId>application-admintools-test-docker</artifactId> | ||
| <name>Admin Tools Application - Tests - Functional Docker Tests</name> | ||
| <packaging>jar</packaging> | ||
| <properties> | ||
| <!-- Functional tests are allowed to output content to the console --> | ||
| <xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip> | ||
| </properties> | ||
| <dependencies> | ||
| <!-- Dependencies for tested features. --> | ||
| <dependency> | ||
| <groupId>${project.groupId}</groupId> | ||
| <artifactId>application-admintools-ui</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>xar</type> | ||
| <exclusions> | ||
| <!-- Run the functional tests without a license. --> | ||
| <exclusion> | ||
| <groupId>com.xwiki.licensing</groupId> | ||
| <artifactId>application-licensing-licensor-api</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <!-- Use a fake licensor script service while running the functional tests. --> | ||
| <dependency> | ||
| <groupId>com.xwiki.licensing</groupId> | ||
| <artifactId>application-licensing-test-api</artifactId> | ||
| <version>${licensing.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.xwiki.platform</groupId> | ||
| <artifactId>xwiki-platform-localization-rest-default</artifactId> | ||
| <version>${platform.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.xwiki.platform</groupId> | ||
| <artifactId>xwiki-platform-panels-ui</artifactId> | ||
| <version>${platform.version}</version> | ||
| <type>xar</type> | ||
| </dependency> | ||
| <!-- Remove when licensing application has the parent to 14.10. --> | ||
| <dependency> | ||
| <groupId>org.xwiki.platform</groupId> | ||
| <artifactId>xwiki-platform-model-api</artifactId> | ||
| <version>${platform.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.xwiki.commons</groupId> | ||
| <artifactId>xwiki-commons-extension-api</artifactId> | ||
| <version>${commons.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.code.findbugs</groupId> | ||
| <artifactId>jsr305</artifactId> | ||
| <version>3.0.2</version> | ||
| </dependency> | ||
| <!-- Remove to here --> | ||
| <!-- Test only dependencies. --> | ||
| <dependency> | ||
| <groupId>org.xwiki.platform</groupId> | ||
| <artifactId>xwiki-platform-test-docker</artifactId> | ||
| <version>${platform.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.xwiki.licensing</groupId> | ||
| <artifactId>application-licensing-test-dependencies</artifactId> | ||
| <version>${licensing.version}</version> | ||
| <type>pom</type> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>${project.groupId}</groupId> | ||
| <artifactId>application-admintools-test-pageobjects</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.xwiki.platform</groupId> | ||
| <artifactId>xwiki-platform-panels-test-pageobjects</artifactId> | ||
| <version>${platform.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| <build> | ||
| <testSourceDirectory>src/test/it</testSourceDirectory> | ||
| <plugins> | ||
| <!-- We need to explicitly include the failsafe plugin since it's not part of the default maven lifecycle --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <profiles> | ||
| <profile> | ||
| <id>clover</id> | ||
| <!-- Add the Clover JAR to the WAR so that it's available at runtime when XWiki executes. | ||
| It's needed because instrumented jars in the WAR will call Clover APIs at runtime when they execute. --> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.openclover</groupId> | ||
| <artifactId>clover</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| <configuration> | ||
| <systemProperties combine.children="append"> | ||
| <!-- Tell the Docker-based test to activate the Clover profile so that the Clover JAR is added to | ||
| WEB-INF/lib --> | ||
| <property> | ||
| <name>xwiki.test.ui.profiles</name> | ||
| <value>clover</value> | ||
| </property> | ||
| </systemProperties> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| </profiles> | ||
| </project> | ||
56 changes: 56 additions & 0 deletions
56
...ls-test-docker/src/test/it/com/xwiki/admintools/test/ui/AdminToolsExecutionCondition.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| */ | ||
| package com.xwiki.admintools.test.ui; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.junit.jupiter.api.extension.ConditionEvaluationResult; | ||
| import org.junit.jupiter.api.extension.ExecutionCondition; | ||
| import org.junit.jupiter.api.extension.ExtensionContext; | ||
| import org.xwiki.test.docker.internal.junit5.DockerTestUtils; | ||
| import org.xwiki.test.docker.junit5.TestConfiguration; | ||
| import org.xwiki.test.docker.junit5.servletengine.ServletEngine; | ||
|
|
||
| /** | ||
| * Prevent the execution of the PDF export tests from inside a Docker container (such as {@code xwiki-build}) when | ||
| * {@link ServletEngine#JETTY_STANDALONE} is used. | ||
| * | ||
| * @version $Id$ | ||
| * @since 1.0 | ||
| */ | ||
| public class AdminToolsExecutionCondition implements ExecutionCondition | ||
| { | ||
| private final List<ServletEngine> supportedServers = List.of(ServletEngine.TOMCAT); | ||
|
|
||
| @Override | ||
| public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) | ||
| { | ||
| if (DockerTestUtils.isInAContainer()) { | ||
| TestConfiguration configuration = DockerTestUtils.getTestConfiguration(context); | ||
| if (!supportedServers.contains(configuration.getServletEngine())) { | ||
| return ConditionEvaluationResult.disabled(String.format("Servlet engine [%s] is forbidden " | ||
| + "when the PDF export tests are executed inside a Docker container, skipping.", | ||
| configuration.getServletEngine())); | ||
| } | ||
| } | ||
|
|
||
| return ConditionEvaluationResult.enabled("The configured servlet engine is supported, continuing."); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.