Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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/FrameworkCore_Demo_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/artifact/ArtifactTest.java73
2 files changed, 75 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
index 37b2f27721..9548b7e96f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.test;
import static org.junit.Assert.assertTrue;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.skynet.core.test.artifact.ArtifactTest;
import org.eclipse.osee.framework.skynet.core.test.artifact.AttributePurgeTest;
import org.eclipse.osee.framework.skynet.core.test.branch.BranchTestSuite;
import org.eclipse.osee.framework.skynet.core.test.cases.ArtifactLoaderTest;
@@ -56,6 +57,7 @@ import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
+ ArtifactTest.class,
ReplaceWithAttributeTest.class,
AttributePurgeTest.class,
CrossBranchLinkTest.class,
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/artifact/ArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/artifact/ArtifactTest.java
new file mode 100644
index 0000000000..5b2d63ac30
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/artifact/ArtifactTest.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osee.framework.skynet.core.test.artifact;
+
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.support.test.util.DemoArtifactTypes;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.eclipse.osee.support.test.util.TestUtil;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public final class ArtifactTest {
+
+ private static SevereLoggingMonitor monitorLog;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ monitorLog = TestUtil.severeLoggingStart();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ TestUtil.severeLoggingEnd(monitorLog);
+ }
+
+ @Test
+ public void attributeCopyAcrossRelatedBranches() throws Exception {
+ Artifact artifactWithSpecialAttr =
+ ArtifactTypeManager.makeNewArtifact(DemoArtifactTypes.DemoCodeTeamWorkflow, DemoSawBuilds.SAW_Bld_1);
+ artifactWithSpecialAttr.setSoleAttributeValue(CoreAttributeTypes.Partition, "Navigation");
+ artifactWithSpecialAttr.setName("ArtifactTest-artifactWithSpecialAttr");
+
+ Artifact copiedArtifact = artifactWithSpecialAttr.duplicate(DemoSawBuilds.SAW_Bld_2);
+
+ Assert.assertFalse(copiedArtifact.getAttributes(CoreAttributeTypes.Partition).isEmpty());
+ }
+
+ @Test
+ public void attributeCopyAcrossUnrelatedBranches() throws Exception {
+ Artifact artifactWithSpecialAttr =
+ ArtifactTypeManager.makeNewArtifact(DemoArtifactTypes.DemoCodeTeamWorkflow, DemoSawBuilds.SAW_Bld_1);
+ artifactWithSpecialAttr.setSoleAttributeValue(CoreAttributeTypes.Partition, "Navigation");
+ artifactWithSpecialAttr.setName("ArtifactTest-artifactWithSpecialAttr");
+
+ Artifact copiedArtifact = artifactWithSpecialAttr.duplicate(CoreBranches.COMMON);
+
+ Assert.assertTrue(copiedArtifact.getAttributes(CoreAttributeTypes.Partition).isEmpty());
+ }
+
+ @Test(expected = OseeArgumentException.class)
+ public void setSoleAttributeValueTest() throws Exception {
+ Artifact artifactWithSpecialAttr =
+ ArtifactTypeManager.makeNewArtifact(DemoArtifactTypes.DemoCodeTeamWorkflow, CoreBranches.COMMON);
+ artifactWithSpecialAttr.setSoleAttributeValue(CoreAttributeTypes.Partition, "Navigation");
+ }
+
+}

Back to the top