-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #134 - Maven test should use options = "--errors" by default
- Loading branch information
1 parent
d80ab65
commit f19712d
Showing
11 changed files
with
1,008 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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
69 changes: 69 additions & 0 deletions
69
itf-examples/src/test/java/com/soebes/itf/examples/defaults/DefaultsForAllIT.java
This file contains 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,69 @@ | ||
package com.soebes.itf.examples.defaults; | ||
|
||
/* | ||
* 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. | ||
*/ | ||
|
||
import com.soebes.itf.jupiter.extension.MavenTest; | ||
import com.soebes.itf.jupiter.maven.MavenExecutionResult; | ||
|
||
import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat; | ||
|
||
|
||
@MavenJupiterExtensionWithDefaults | ||
class DefaultsForAllIT { | ||
|
||
@MavenTest | ||
void option_debug(MavenExecutionResult result) { | ||
assertThat(result) | ||
.isSuccessful() | ||
.out() | ||
.info() | ||
.containsSubsequence( | ||
"--- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven) @ kata-fraction ---", | ||
"--- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ kata-fraction ---", | ||
"--- maven-resources-plugin:3.1.0:resources (default-resources) @ kata-fraction ---", | ||
"--- maven-compiler-plugin:3.8.1:compile (default-compile) @ kata-fraction ---", | ||
"--- maven-resources-plugin:3.1.0:testResources (default-testResources) @ kata-fraction ---", | ||
"--- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ kata-fraction ---", | ||
"--- maven-surefire-plugin:3.0.0-M4:test (default-test) @ kata-fraction ---", | ||
"--- maven-jar-plugin:3.2.0:jar (default-jar) @ kata-fraction ---", | ||
"--- maven-site-plugin:3.9.1:attach-descriptor (attach-descriptor) @ kata-fraction ---" | ||
); | ||
assertThat(result) | ||
.isSuccessful() | ||
.out() | ||
.warn().isEmpty(); | ||
assertThat(result) | ||
.isSuccessful() | ||
.out() | ||
.debug() | ||
.containsSubsequence( | ||
"Goal: org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven)", | ||
"Goal: org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent (default)", | ||
"Goal: org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources (default-resources)", | ||
"Goal: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)", | ||
"Goal: org.apache.maven.plugins:maven-resources-plugin:3.1.0:testResources (default-testResources)", | ||
"Goal: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile)", | ||
"Goal: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test)", | ||
"Goal: org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar (default-jar)", | ||
"Goal: org.apache.maven.plugins:maven-site-plugin:3.9.1:attach-descriptor (attach-descriptor)" | ||
); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...les/src/test/java/com/soebes/itf/examples/defaults/MavenJupiterExtensionWithDefaults.java
This file contains 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,51 @@ | ||
package com.soebes.itf.examples.defaults; | ||
|
||
/* | ||
* 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. | ||
*/ | ||
|
||
import com.soebes.itf.jupiter.extension.MavenCLIOptions; | ||
import com.soebes.itf.jupiter.extension.MavenJupiterExtension; | ||
import com.soebes.itf.jupiter.extension.MavenOption; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* A meta annotation which defines the used default options for all | ||
* test classes which are annotated by this annotation instead of | ||
* {@code MavenJupiterExtension}. | ||
* | ||
* This makes it possible to override the defaults which are defined in | ||
* {@code MavenITExtension} code. | ||
* | ||
* @author Karl Heinz Marbaise | ||
*/ | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
@Retention(RUNTIME) | ||
@Inherited | ||
@MavenJupiterExtension | ||
@MavenOption(MavenCLIOptions.DEBUG) | ||
@MavenOption(MavenCLIOptions.ERRORS) | ||
@MavenOption(MavenCLIOptions.FAIL_AT_END) | ||
public @interface MavenJupiterExtensionWithDefaults { | ||
} |
This file contains 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
Oops, something went wrong.