From cfff4e942fcfec7a323fab6ac68ca30e469f9816 Mon Sep 17 00:00:00 2001 From: Dusan Petrovic Date: Tue, 30 Jul 2024 11:54:34 +0200 Subject: [PATCH] Adding container repository from Cloud Assets View --- .../modules/cloud/oracle/assets/DependenciesAnalyzer.java | 1 + .../netbeans/modules/cloud/oracle/assets/SuggestedItem.java | 5 ++++- .../modules/cloud/oracle/assets/CloudAssetsTest.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java index 717f39e5646e..3fd0013fb382 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/DependenciesAnalyzer.java @@ -62,6 +62,7 @@ public Set findSuggestions(Project[] projects) { } result.add(SuggestedItem.forPath("Cluster")); result.add(SuggestedItem.forPath("ComputeInstance")); + result.add(SuggestedItem.forPath("ContainerRepository")); return result; } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java index e207a18e3efb..3726f69f8503 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/assets/SuggestedItem.java @@ -33,7 +33,8 @@ "SelectVault=Select OCI Vault", "SelectBucket=Select Object Storage Bucket", "SelectCluster=Select Oracle Container Engine for Kubernetes", - "SelectCompute=Select Compute Instance" + "SelectCompute=Select Compute Instance", + "SelectContainerRepository=Select Container Repository" }) public final class SuggestedItem extends OCIItem { @@ -66,6 +67,8 @@ public static SuggestedItem forPath(String path) { return new SuggestedItem("Cluster", Bundle.SelectCluster(), Collections.singleton("ComputeInstance")); //NOI18N case "ComputeInstance": //NOI18N return new SuggestedItem("ComputeInstance", Bundle.SelectCompute(), Collections.singleton("Cluster")); //NOI18N + case "ContainerRepository": //NOI18N + return new SuggestedItem("ContainerRepository", Bundle.SelectContainerRepository(), Collections.singleton("ContainerRepository")); //NOI18N default: throw new IllegalArgumentException(""); } diff --git a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java index 1a8e085bb4ad..4f96801180a0 100644 --- a/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java +++ b/enterprise/cloud.oracle/test/unit/src/org/netbeans/modules/cloud/oracle/assets/CloudAssetsTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.*; import org.netbeans.modules.cloud.oracle.compute.ClusterItem; import org.netbeans.modules.cloud.oracle.database.DatabaseItem; +import org.netbeans.modules.cloud.oracle.developer.ContainerRepositoryItem; import org.netbeans.modules.cloud.oracle.items.OCID; /** @@ -37,6 +38,7 @@ public void testStoreLoad() throws URISyntaxException { instance.loadAssets(); instance.addItem(new DatabaseItem(OCID.of("db-ocid", "Databases"), "db-comp-id", "DB1", "http://test", "DB1")); instance.addItem(new ClusterItem(OCID.of("cluster-ocid", "Cluster"), "cluster-comp-id", "Cluster1")); + instance.addItem(new ContainerRepositoryItem(OCID.of("container-repo-ocid", "ContainerRepository"), "container-repo-comp-id", "Repo1", "reg", "namespace", true, 2)); instance.storeAssets(); CloudAssets instance1 = new CloudAssets();