Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-11-08 01:12:15 +0000
committerRoberto E. Escobar2012-11-08 01:12:15 +0000
commitc04ce11db040bddd9eeda4790ba0065b26174c4e (patch)
tree099740462396d1734da91890f147d67c175ab298 /plugins/org.eclipse.osee.framework.skynet.core.test
parentb7bec492c86a57cda90eded1649d09b145f185e1 (diff)
downloadorg.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.tar.gz
org.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.tar.xz
org.eclipse.osee-c04ce11db040bddd9eeda4790ba0065b26174c4e.zip
feature[ats_TL5SF]: Add messaging tests to maven
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/DataFactory.java19
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockDataFactory.java34
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java58
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationCacheTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationFilterUtilTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorterTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java2
8 files changed, 113 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
index fdfcc97bca3..5af02d7a500 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
@@ -29,7 +29,6 @@ Export-Package: org.eclipse.osee.framework.skynet.core,
Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.enums,
- org.eclipse.osee.framework.core.model.mocks,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.skynet.core.event,
org.eclipse.osee.support.test.util
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/DataFactory.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/DataFactory.java
index 3998bf4b21b..d56ff47b6e4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/DataFactory.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/DataFactory.java
@@ -17,8 +17,9 @@ import java.util.Random;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
+import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.mocks.MockDataFactory;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
@@ -108,7 +109,19 @@ public final class DataFactory {
}
public static RelationType createRelationType(int id) {
- ArtifactType dummyArtType = MockDataFactory.createArtifactType(id);
- return MockDataFactory.createRelationType(id, dummyArtType, dummyArtType);
+ ArtifactType dummyArtType = createArtifactType(id);
+ return createRelationType(id, dummyArtType, dummyArtType);
+ }
+
+ private static ArtifactType createArtifactType(int index) {
+ return new ArtifactType(randomGenerator.nextLong(), "art_" + index, index % 2 == 0);
+ }
+
+ private static RelationType createRelationType(int index, IArtifactType artTypeA, IArtifactType artTypeB) {
+ RelationTypeMultiplicity multiplicity =
+ RelationTypeMultiplicity.values()[Math.abs(index % RelationTypeMultiplicity.values().length)];
+ String order = RelationOrderBaseTypes.values()[index % RelationTypeMultiplicity.values().length].getGuid();
+ return new RelationType(randomGenerator.nextLong(), "relType_" + index, "sideA_" + index, "sideB_" + index,
+ artTypeA, artTypeB, multiplicity, order);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockDataFactory.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockDataFactory.java
new file mode 100644
index 00000000000..a95134962b1
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockDataFactory.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.mocks;
+
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class MockDataFactory {
+
+ private MockDataFactory() {
+ // Utility Class
+ }
+
+ public static Branch createBranch(int index) {
+ BranchState branchState = BranchState.values()[Math.abs(index % BranchState.values().length)];
+ BranchType branchType = BranchType.values()[Math.abs(index % BranchType.values().length)];
+ boolean isArchived = index % 2 == 0 ? true : false;
+ return new Branch(GUID.create(), "branch_" + index, branchType, branchState, isArchived);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java
new file mode 100644
index 00000000000..6d6d096ac34
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.mocks;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.IOseeStorable;
+import org.eclipse.osee.framework.core.model.cache.IOseeCache;
+import org.eclipse.osee.framework.core.model.cache.IOseeDataAccessor;
+import org.junit.Assert;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MockOseeDataAccessor<K, T extends IOseeStorable> implements IOseeDataAccessor<K, T> {
+
+ private boolean wasLoadCalled = false;
+ private boolean wasStoreCalled = false;
+
+ public void setLoadCalled(boolean wasLoadCalled) {
+ this.wasLoadCalled = wasLoadCalled;
+ }
+
+ public void setStoreCalled(boolean wasStoreCalled) {
+ this.wasStoreCalled = wasStoreCalled;
+ }
+
+ public boolean wasLoaded() {
+ return wasLoadCalled;
+ }
+
+ public boolean wasStoreCalled() {
+ return wasStoreCalled;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void load(IOseeCache<K, T> cache) throws OseeCoreException {
+ Assert.assertNotNull(cache);
+ setLoadCalled(true);
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void store(Collection<T> types) throws OseeCoreException {
+ Assert.assertNotNull(types);
+ setStoreCalled(true);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationCacheTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationCacheTest.java
index c417b64a308..529a2495a41 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationCacheTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationCacheTest.java
@@ -18,12 +18,12 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.mocks.MockDataFactory;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.util.Compare;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.mocks.DataFactory;
+import org.eclipse.osee.framework.skynet.core.mocks.MockDataFactory;
import org.eclipse.osee.framework.skynet.core.mocks.MockLinker;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.support.test.util.TestUtil;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationFilterUtilTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationFilterUtilTest.java
index d80990951c0..fd1770e82ff 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationFilterUtilTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationFilterUtilTest.java
@@ -13,14 +13,14 @@ package org.eclipse.osee.framework.skynet.core.relation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.mocks.MockDataFactory;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.skynet.core.mocks.DataFactory;
+import org.eclipse.osee.framework.skynet.core.mocks.MockDataFactory;
import org.eclipse.osee.framework.skynet.core.relation.RelationFilterUtil.RelationMatcher;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorterTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorterTest.java
index b3567fdccea..09a071a03e5 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorterTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorterTest.java
@@ -34,13 +34,13 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.RelationTypeSide;
import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidRelationReorder;
-import org.eclipse.osee.framework.core.model.mocks.MockOseeDataAccessor;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.mocks.DataFactory;
import org.eclipse.osee.framework.skynet.core.mocks.MockIArtifact;
+import org.eclipse.osee.framework.skynet.core.mocks.MockOseeDataAccessor;
import org.eclipse.osee.framework.skynet.core.relation.order.IRelationOrderAccessor;
import org.eclipse.osee.framework.skynet.core.relation.order.IRelationSorter;
import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
index 7f5b81ad598..2c16e70ee36 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
@@ -26,13 +26,13 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidRelationReorder;
-import org.eclipse.osee.framework.core.model.mocks.MockOseeDataAccessor;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.mocks.DataFactory;
+import org.eclipse.osee.framework.skynet.core.mocks.MockOseeDataAccessor;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.junit.After;
import org.junit.Assert;

Back to the top