Skip to content

Commit

Permalink
WIP: Second step.
Browse files Browse the repository at this point in the history
  • Loading branch information
khmarbaise committed Dec 20, 2023
1 parent cb10624 commit 43c6baa
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,39 @@
import com.soebes.itf.jupiter.extension.MavenJupiterExtension;
import com.soebes.itf.jupiter.extension.MavenProfile;
import com.soebes.itf.jupiter.extension.MavenTest;
import com.soebes.itf.jupiter.extension.condition.EnabledForMavenVersion;
import com.soebes.itf.jupiter.maven.MavenExecutionResult;
import org.junit.jupiter.api.DisplayName;

import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat;
import static com.soebes.itf.jupiter.extension.MavenVersion.M3_6;
import static com.soebes.itf.jupiter.extension.MavenVersion.M3_8;
import static com.soebes.itf.jupiter.extension.MavenVersion.M3_9;
import static com.soebes.itf.jupiter.extension.MavenVersion.M4_0;

@MavenJupiterExtension
@MavenProfile({"profile-1", "profile-2", "profile-3"})
class ProfileOnClassIT {

@MavenTest
@EnabledForMavenVersion({M3_6,M3_8})
void profile_1_2_3(MavenExecutionResult result) {
assertThat(result)
.isSuccessful()
.out()
.info()
.containsSubsequence(
"--- echo-maven-plugin:0.5.0:echo (echo-in-profile-1) @ kata-fraction ---",
"--- echo-maven-plugin:0.5.0:echo (echo-in-profile-2) @ kata-fraction ---",
"--- echo-maven-plugin:0.5.0:echo (echo-in-profile-3) @ kata-fraction ---"
);
assertThat(result)
.isSuccessful()
.out()
.warn().containsExactly("Message for Profile 1", "Message for Profile 2", "Message for Profile 3");
}
@MavenTest
@EnabledForMavenVersion({M3_9,M4_0})
void profile_1_2_3(MavenExecutionResult result) {
assertThat(result)
.isSuccessful()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,97 @@
@API(status = EXPERIMENTAL, since = "0.1.0")
public enum MavenVersion {
UNKNOWN("UNKOWN"), //TODO: Need to reconsider?
/**
* Apache Maven Version 3.0.X
* Do not use those, because Maven 3.0.X is very old!
*/
@Deprecated
M3_0("3.0"),
@Deprecated
M3_0_5("3.0.5"),
/**
* Apache Maven Version 3.2.X
*/
@Deprecated
M3_1("3.1"),
@Deprecated
M3_1_0("3.1.0"),
@Deprecated
M3_1_1("3.1.1"),
/**
* Apache Maven Version 3.2.X
*/
@Deprecated
M3_2("3.2"),
@Deprecated
M3_2_1("3.2.1"),
@Deprecated
M3_2_2("3.2.2"),
@Deprecated
M3_2_3("3.2.3"),
@Deprecated
M3_2_5("3.2.5"),
/**
* Apache Maven Version 3.3.X
*/
@Deprecated
M3_3("3.3"),
@Deprecated
M3_3_1("3.3.1"),
@Deprecated
M3_3_3("3.3.3"),
@Deprecated
M3_3_9("3.3.9"),
/**
* Apache Maven Version 3.5.X
*/
@Deprecated
M3_5("3.5"),
@Deprecated
M3_5_0("3.5.0"),
@Deprecated
M3_5_2("3.5.2"),
@Deprecated
M3_5_3("3.5.3"),
@Deprecated
M3_5_4("3.5.4"),
/**
* Apache Maven Version 3.6.X
*/
M3_6("3.6"),
M3_6_0("3.6.0"),
M3_6_1("3.6.1"),
M3_6_2("3.6.2"),
M3_6_3("3.6.3"),
/**
* Apache Maven Version 3.8.X
*/
M3_8("3.8"),
M3_8_1("3.8.1"),
M3_8_2("3.8.2"),
M3_8_3("3.8.3"),
M3_8_4("3.8.4"),
M3_8_5("3.8.5"),
M3_8_6("3.8.6"),
M3_9_0("3.9.0");
M3_8_7("3.8.7"),
M3_8_8("3.8.8"),
/**
* Apache Maven Version 3.9.X
*/
M3_9("3.9"),
M3_9_0("3.9.0"),
M3_9_1("3.9.1"),
M3_9_2("3.9.2"),
M3_9_3("3.9.3"),
M3_9_4("3.9.4"),
M3_9_5("3.9.5"),
M3_9_6("3.9.6"),
/**
* Apache Maven Version 4.0.X
*/
M4_0("4.0"),
M4_0_0("4.0.0"),
M4_0_1("4.0.1");

private static final MavenVersion CURRENT_MAVEN_VERSION = determineCurrentVersion();

Expand Down

0 comments on commit 43c6baa

Please sign in to comment.