diff --git a/pkg/cmd/pulumi-language-java/language_test.go b/pkg/cmd/pulumi-language-java/language_test.go index 57df49465eb..5fdcc1a0819 100644 --- a/pkg/cmd/pulumi-language-java/language_test.go +++ b/pkg/cmd/pulumi-language-java/language_test.go @@ -179,7 +179,6 @@ var expectedFailures = map[string]string{ "l2-ref-ref": "unimplemented for Java", "l2-resource-asset-archive": "unimplemented for Java", "l2-resource-config": "unimplemented for Java", - "l2-resource-parent-inheritance": "unimplemented for Java", "l2-resource-primitives": "unimplemented for Java", "l2-resource-secret": "unimplemented for Java", "l2-target-up-with-new-dependency": "unimplemented for Java", diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/Pulumi.yaml new file mode 100644 index 00000000000..fc8a925f4dd --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l2-resource-parent-inheritance +runtime: java diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/pom.xml new file mode 100644 index 00000000000..f7a7e7a7505 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/pom.xml @@ -0,0 +1,99 @@ + + + 4.0.0 + + com.pulumi + l2-resource-parent-inheritance + 1.0-SNAPSHOT + + + UTF-8 + 11 + 11 + 11 + generated_program.App + + + + + + repository-0 + REPOSITORY + + + + + + com.pulumi + pulumi + CORE.VERSION + + + com.pulumi + simple + 2.0.0 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + ${mainClass} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + true + ${mainClass} + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + ${mainClass} + ${mainArgs} + + + + org.apache.maven.plugins + maven-wrapper-plugin + 3.1.1 + + 3.8.5 + + + + + \ No newline at end of file diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/src/main/java/generated_program/App.java new file mode 100644 index 00000000000..63ec92d8c58 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l2-resource-parent-inheritance/src/main/java/generated_program/App.java @@ -0,0 +1,58 @@ +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.simple.Provider; +import com.pulumi.simple.Resource; +import com.pulumi.simple.ResourceArgs; +import com.pulumi.resources.CustomResourceOptions; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var provider = new Provider("provider"); + + var parent1 = new Resource("parent1", ResourceArgs.builder() + .value(true) + .build(), CustomResourceOptions.builder() + .provider(provider) + .build()); + + var child1 = new Resource("child1", ResourceArgs.builder() + .value(true) + .build(), CustomResourceOptions.builder() + .parent(parent1) + .build()); + + var orphan1 = new Resource("orphan1", ResourceArgs.builder() + .value(true) + .build()); + + var parent2 = new Resource("parent2", ResourceArgs.builder() + .value(true) + .build(), CustomResourceOptions.builder() + .protect(true) + .build()); + + var child2 = new Resource("child2", ResourceArgs.builder() + .value(true) + .build(), CustomResourceOptions.builder() + .parent(parent2) + .build()); + + var orphan2 = new Resource("orphan2", ResourceArgs.builder() + .value(true) + .build()); + + } +}