Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjohn.r.misinco2011-06-02 17:46:24 -0400
committerRyan D. Brooks2011-06-02 17:46:24 -0400
commit1d3371c60f951506e8588d1767484ce442a9db72 (patch)
tree61631ea3bce580aa862e8a500b1303750d3486eb /plugins/org.eclipse.osee.framework.skynet.core.test
parent454d214bdc54d64c553b890bf6d0f8fc948fccb6 (diff)
downloadorg.eclipse.osee-1d3371c60f951506e8588d1767484ce442a9db72.tar.gz
org.eclipse.osee-1d3371c60f951506e8588d1767484ce442a9db72.tar.xz
org.eclipse.osee-1d3371c60f951506e8588d1767484ce442a9db72.zip
feature[bgz_348142]: Add getOrCreate method to ArtifactQuery
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactQueryTestDemo.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactQueryTestDemo.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactQueryTestDemo.java
index d93ad95a47..b1dcd3f60e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactQueryTestDemo.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactQueryTestDemo.java
@@ -18,6 +18,8 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -92,4 +94,15 @@ public class ArtifactQueryTestDemo {
}
Assert.assertTrue("No artifacts on multiple branches found", pass);
}
+
+ @Test
+ public void testGetOrCreate() throws OseeCoreException {
+ String guid = GUID.create();
+ Branch branch = BranchManager.createTopLevelBranch("test branch");
+ Artifact artifact1 = ArtifactQuery.getOrCreate(guid, null, CoreArtifactTypes.GeneralData, branch);
+ Assert.assertNotNull(artifact1);
+ Artifact artifact2 = ArtifactQuery.getOrCreate(guid, null, CoreArtifactTypes.GeneralData, branch);
+ Assert.assertEquals(artifact1, artifact2);
+ BranchManager.deleteBranch(branch);
+ }
} \ No newline at end of file

Back to the top