Skip to content

Commit

Permalink
* Added flags to the AppDependency to indicate whether a dependency i…
Browse files Browse the repository at this point in the history
…s a direct one, an extension, belongs to the runtime and/or deployment CP

* Simplified the AppModel by mering all the dependencies into a single list
  • Loading branch information
aloubyansky committed Sep 12, 2021
1 parent b50a4de commit 0c85b27
Show file tree
Hide file tree
Showing 35 changed files with 474 additions and 369 deletions.
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

0 comments on commit 0c85b27

Please sign in to comment.