Skip to content
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

Added flags to the AppDependency and simplified the AppModel #20070

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,23 @@ protected TsArtifact modelApp() {
protected void assertDeploymentDeps(List<AppDependency> deploymentDeps) throws Exception {
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-d-deployment", TsArtifact.DEFAULT_VERSION), "runtime"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-d-deployment", TsArtifact.DEFAULT_VERSION), "runtime",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-e-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-e-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-f-deployment", TsArtifact.DEFAULT_VERSION), "runtime"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-f-deployment", TsArtifact.DEFAULT_VERSION), "runtime",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ protected void assertAppModel(AppModel appModel) throws Exception {
final List<AppDependency> deploymentDeps = appModel.getDeploymentDependencies();
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ protected TsArtifact modelApp() {
protected void assertDeploymentDeps(List<AppDependency> deploymentDeps) throws Exception {
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-b-deployment", TsArtifact.DEFAULT_VERSION), "runtime",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-d-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-d-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ protected TsArtifact modelApp() {
protected void assertDeploymentDeps(List<AppDependency> deploymentDeps) throws Exception {
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-c-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile"));
new AppArtifact(TsArtifact.DEFAULT_GROUP_ID, "ext-a-deployment", TsArtifact.DEFAULT_VERSION), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected TsArtifact modelApp() {
final TsArtifact providedDep = TsArtifact.jar("provided-dep");

final TsArtifact optionalDep = TsArtifact.jar("optional-dep");
addToExpectedLib(optionalDep); // TODO should direct optional deps be included?
addToExpectedLib(optionalDep);

final TsArtifact directRtDep = TsArtifact.jar("runtime-dep");
addToExpectedLib(directRtDep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,23 @@ protected TsArtifact modelApp() {
protected void assertAppModel(AppModel appModel) throws Exception {
final Set<AppDependency> expectedDeployDeps = new HashSet<>();
expectedDeployDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment", "1"), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expectedDeployDeps, new HashSet<>(appModel.getDeploymentDependencies()));
final Set<AppDependency> expectedRuntimeDeps = new HashSet<>();
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-1", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-2", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b", "1"), "compile",
AppDependency.DIRECT_FLAG, AppDependency.RUNTIME_EXTENSION_ARTIFACT_FLAG, AppDependency.RUNTIME_CP_FLAG,
AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-1", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-2", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-trans-1", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-trans-1", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-trans-2", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-dep-trans-2", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expectedRuntimeDeps, new HashSet<>(appModel.getUserDependencies()));
final Set<AppDependency> expectedFullDeps = new HashSet<>();
expectedFullDeps.addAll(expectedDeployDeps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,23 @@ protected TsArtifact modelApp() {
protected void assertAppModel(AppModel appModel) throws Exception {
final Set<AppDependency> expectedDeployDeps = new HashSet<>();
expectedDeployDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expectedDeployDeps, new HashSet<>(appModel.getDeploymentDependencies()));
final Set<AppDependency> expectedRuntimeDeps = new HashSet<>();
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-1", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-2", "1"), "compile"));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a", "1"), "compile",
AppDependency.DIRECT_FLAG, AppDependency.RUNTIME_EXTENSION_ARTIFACT_FLAG, AppDependency.RUNTIME_CP_FLAG,
AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-1", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-2", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-trans-1", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-trans-1", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
expectedRuntimeDeps
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-trans-2", "1"), "compile"));
.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-dep-trans-2", "1"), "compile",
AppDependency.RUNTIME_CP_FLAG, AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expectedRuntimeDeps, new HashSet<>(appModel.getUserDependencies()));
final Set<AppDependency> expectedFullDeps = new HashSet<>();
expectedFullDeps.addAll(expectedDeployDeps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public Path getPath(Path workDir) throws IOException {
return platformPropsDep;
}

@SuppressWarnings("deprecation")
@Override
protected void testCreator(QuarkusBootstrap creator) throws Exception {
System.setProperty("quarkus.package.type", "legacy-jar");
Expand Down Expand Up @@ -193,6 +194,7 @@ protected void testCreator(QuarkusBootstrap creator) throws Exception {
}
}

@SuppressWarnings("deprecation")
private static void assertExtensionDependencies(AppModel appModel, String[] expectedExtensions) {
final Set<AppArtifact> expectedRuntime = new HashSet<>(expectedExtensions.length);
final Set<AppArtifact> expectedDeployment = new HashSet<>(expectedExtensions.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ protected TsArtifact modelApp() {
@Override
protected void assertDeploymentDeps(List<AppDependency> deploymentDeps) throws Exception {
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile", true));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile", true,
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(
new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment-dep", "1"), "compile", true));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment", "1"), "compile", true));
new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment-dep", "1"), "compile", true,
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-b-deployment", "1"), "compile", true,
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(
new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-d-deployment", "1"), "compile", false));
new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-d-deployment", "1"), "compile", false,
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ protected TsArtifact modelApp() {
@Override
protected void assertDeploymentDeps(List<AppDependency> deploymentDeps) throws Exception {
final Set<AppDependency> expected = new HashSet<>();
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile"));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment-dep", "1"), "compile"));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment", "1"), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
expected.add(new AppDependency(new AppArtifact("io.quarkus.bootstrap.test", "ext-a-deployment-dep", "1"), "compile",
AppDependency.DEPLOYMENT_CP_FLAG));
assertEquals(expected, new HashSet<>(deploymentDeps));
}
}
Loading