Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2015-12-11 16:07:01 -0500
committerRyan D. Brooks2015-12-11 16:07:01 -0500
commit46b4dfa08c74df928df15598271a878928eec629 (patch)
treed7159e3338cc1343851603fd3720b0ab03170163 /plugins/org.eclipse.osee.ats.core.test
parentb3267be249fa7928646bb9a8b603bb909f3d9af6 (diff)
downloadorg.eclipse.osee-46b4dfa08c74df928df15598271a878928eec629.tar.gz
org.eclipse.osee-46b4dfa08c74df928df15598271a878928eec629.tar.xz
org.eclipse.osee-46b4dfa08c74df928df15598271a878928eec629.zip
refactor: Cleanup unused and un-necessary ATS mocks
Diffstat (limited to 'plugins/org.eclipse.osee.ats.core.test')
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/.project5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AssigneeColumnTest.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockActionGroup.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockState.java77
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkStateFactory.java44
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsActionGroupTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockDateValueProvider.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockRuleManager.java41
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockStateDefinition.java228
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockValueProvider.java54
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockWidgetDefinition.java130
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/MockWorkDefinition.java126
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/WorkDefinitionMatchTest.java27
24 files changed, 50 insertions, 742 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/.project b/plugins/org.eclipse.osee.ats.core.test/.project
index 564e2e3d7f..91e632fee0 100644
--- a/plugins/org.eclipse.osee.ats.core.test/.project
+++ b/plugins/org.eclipse.osee.ats.core.test/.project
@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/plugins/org.eclipse.osee.ats.core.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core.test/META-INF/MANIFEST.MF
index fcc9afbc84..5e974115e3 100644
--- a/plugins/org.eclipse.osee.ats.core.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core.test/META-INF/MANIFEST.MF
@@ -10,3 +10,4 @@ Require-Bundle: org.junit,
org.hamcrest.core,
org.objenesis
Bundle-Vendor: Eclipse Open System Engineering Environment
+Import-Package: org.eclipse.osee.ats.mocks
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AssigneeColumnTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AssigneeColumnTest.java
index 6e5c59212e..c90fe9be20 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AssigneeColumnTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AssigneeColumnTest.java
@@ -20,9 +20,10 @@ import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.core.AbstractUserTest;
-import org.eclipse.osee.ats.core.mock.MockActionGroup;
import org.eclipse.osee.ats.core.model.impl.AtsActionGroup;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.junit.Assert;
import org.junit.Before;
import org.mockito.Mock;
@@ -136,7 +137,7 @@ public class AssigneeColumnTest extends AbstractUserTest {
implementStateImplementers.add(joe);
when(workItem2.getImplementers()).thenReturn(implementStateImplementers);
- MockActionGroup group = new MockActionGroup("group");
+ AtsActionGroup group = new AtsActionGroup(GUID.create(), "group", Lib.generateUuid());
group.addAction(workItem);
group.addAction(workItem2);
@@ -181,7 +182,7 @@ public class AssigneeColumnTest extends AbstractUserTest {
when(workItem2.getAssignees()).thenReturn(assigneesToReturn2);
when(stateMgr2.getStateType()).thenReturn(StateType.Working);
- MockActionGroup group = new MockActionGroup("group");
+ AtsActionGroup group = new AtsActionGroup(GUID.create(), "group", Lib.generateUuid());
group.addAction(workItem);
group.addAction(workItem2);
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockActionGroup.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockActionGroup.java
deleted file mode 100644
index 1892af88df..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockActionGroup.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.ats.core.mock;
-
-import org.eclipse.osee.ats.core.model.impl.AtsActionGroup;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockActionGroup extends AtsActionGroup {
-
- public MockActionGroup(String name) {
- super(GUID.create(), name, Lib.generateUuid());
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockState.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockState.java
deleted file mode 100644
index 018c5f6d3a..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockState.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.ats.core.mock;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockState {
-
- private final String name;
- private final List<IAtsUser> assignees = new LinkedList<>();
- private double hoursSpent = 0;
- private int percentComplete = 0;
-
- public MockState(String name, List<? extends IAtsUser> assignees) {
- this(name, assignees, 0, 0);
- }
-
- public MockState(String name, List<? extends IAtsUser> assignees, double hoursSpent, int percentComplete) {
- this.name = name;
- this.assignees.addAll(assignees);
- this.hoursSpent = hoursSpent;
- this.percentComplete = percentComplete;
- }
-
- public void setHoursSpent(double hoursSpent) {
- this.hoursSpent = hoursSpent;
- }
-
- public void setPercentComplete(int percentComplete) {
- this.percentComplete = percentComplete;
- }
-
- public MockState(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public List<IAtsUser> getAssignees() {
- return assignees;
- }
-
- public double getHoursSpent() {
- return hoursSpent;
- }
-
- public int getPercentComplete() {
- return percentComplete;
- }
-
- public void addAssignee(IAtsUser steve) {
- if (!assignees.contains(steve)) {
- assignees.add(steve);
- }
- }
-
- public void setAssignees(List<? extends IAtsUser> users) {
- assignees.clear();
- assignees.addAll(users);
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkStateFactory.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkStateFactory.java
deleted file mode 100644
index ad56291623..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkStateFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.ats.core.mock;
-
-import java.util.List;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.workflow.WorkState;
-import org.eclipse.osee.ats.api.workflow.state.WorkStateFactory;
-import org.eclipse.osee.ats.core.model.impl.WorkStateImpl;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockWorkStateFactory implements WorkStateFactory {
-
- @Override
- public WorkState createStateData(String name, List<? extends IAtsUser> assignees) {
- return new WorkStateImpl(name, assignees);
- }
-
- @Override
- public WorkState createStateData(String name) {
- return new WorkStateImpl(name);
- }
-
- @Override
- public WorkState createStateData(String name, List<? extends IAtsUser> assignees, double hoursSpent, int percentComplete) {
- return new WorkStateImpl(name, assignees, hoursSpent, percentComplete);
- }
-
- @Override
- public String getId() {
- return "Mock ID";
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsActionGroupTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsActionGroupTest.java
index d59def9001..b2aff82856 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsActionGroupTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/model/impl/AtsActionGroupTest.java
@@ -20,7 +20,7 @@ import org.junit.Test;
/**
* Test case for {@link AtsActionGroup}
- *
+ *
* @author Donald G. Dunne
*/
public class AtsActionGroupTest {
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
index 28efe24f48..e1089ece00 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
@@ -17,6 +17,9 @@ import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Before;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java
index 4cebdbba34..ee522e45f0 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java
@@ -15,6 +15,8 @@ import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
index 24240a1d30..e15742f1cf 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
@@ -19,6 +19,8 @@ import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java
index 08210403a7..c17ea67d9a 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java
@@ -18,6 +18,9 @@ import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionFloatMinMaxConstraint;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java
index 8ac2756276..71bbddb92a 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java
@@ -18,6 +18,9 @@ import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionIntMinMaxConstraint;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java
index ae1ccb1198..312a1ec353 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java
@@ -18,6 +18,9 @@ import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionListMinMaxSelectedConstraint;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java
index 29d8f7315f..e146e5f3db 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java
@@ -15,6 +15,8 @@ import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
index fe5d9e35cb..8ed596e153 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.junit.Assert;
import org.junit.Test;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
index 6733e5cf1f..6123b36bb0 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
@@ -25,6 +25,9 @@ import org.eclipse.osee.ats.api.workdef.WidgetStatus;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionFloatMinMaxConstraint;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionIntMinMaxConstraint;
import org.eclipse.osee.ats.core.workdef.SimpleWidgetDefinitionListMinMaxSelectedConstraint;
+import org.eclipse.osee.ats.mocks.MockStateDefinition;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
+import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.junit.Assert;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockDateValueProvider.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockDateValueProvider.java
index 07f41025f0..b73f9524e6 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockDateValueProvider.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockDateValueProvider.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.Collection;
import java.util.Date;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockRuleManager.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockRuleManager.java
deleted file mode 100644
index f013e82dcf..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockRuleManager.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.ats.core.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockRuleManager {
-
- public List<String> rules = new ArrayList<>();
-
- public List<String> getRules() {
- return rules;
- }
-
- public void addRule(String rule) {
- if (!rules.contains(rule)) {
- rules.add(rule);
- }
- }
-
- public boolean hasRule(String rule) {
- return rules.contains(rule);
- }
-
- public void removeRule(String rule) {
- rules.remove(rule);
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockStateDefinition.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockStateDefinition.java
deleted file mode 100644
index 0194c7abc2..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockStateDefinition.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * 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.ats.core.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsLayoutItem;
-import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
-import org.eclipse.osee.ats.api.workdef.StateColor;
-import org.eclipse.osee.ats.api.workdef.StateType;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockStateDefinition implements IAtsStateDefinition {
-
- private StateType StateType;
- private int ordinal = 0;
- private final List<IAtsLayoutItem> stateItems = new ArrayList<>(5);
- private final MockRuleManager ruleMgr = new MockRuleManager();
- private final List<IAtsStateDefinition> toStates = new ArrayList<>(5);
- private IAtsStateDefinition defaultToState;
- private final List<IAtsStateDefinition> overrideAttributeValidationStates = new ArrayList<>(5);
- private final List<IAtsDecisionReviewDefinition> decisionReviews = new ArrayList<>();
- private final List<IAtsPeerReviewDefinition> peerReviews = new ArrayList<>();
- private IAtsWorkDefinition workDefinition;
- private int stateWeight = 0;
- private Integer recommendedPercentComplete = null;
- private StateColor color = null;
- private String name;
- private String description;
-
- public MockStateDefinition(String name) {
- this.name = name;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public List<IAtsLayoutItem> getLayoutItems() {
- return stateItems;
- }
-
- @Override
- public StateType getStateType() {
- return StateType;
- }
-
- public void setStateType(StateType StateType) {
- this.StateType = StateType;
- }
-
- @Override
- public int getOrdinal() {
- return ordinal;
- }
-
- public void setOrdinal(int ordinal) {
- this.ordinal = ordinal;
- }
-
- @Override
- public List<IAtsStateDefinition> getToStates() {
- return toStates;
- }
-
- @Override
- public IAtsWorkDefinition getWorkDefinition() {
- return workDefinition;
- }
-
- @Override
- public void setWorkDefinition(IAtsWorkDefinition workDefinition) {
- this.workDefinition = workDefinition;
- }
-
- @Override
- public String toString() {
- return String.format("[%s][%s]", getName(), getStateType());
- }
-
- /**
- * Returns fully qualified name of <work definition name>.<this state name
- */
-
- @Override
- public String getFullName() {
- if (workDefinition != null) {
- return workDefinition.getName() + "." + getName();
- }
- return getName();
- }
-
- @Override
- public List<IAtsStateDefinition> getOverrideAttributeValidationStates() {
- return overrideAttributeValidationStates;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (getFullName() == null ? 0 : getFullName().hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- IAtsStateDefinition other = (IAtsStateDefinition) obj;
- if (getFullName() == null) {
- if (other.getFullName() != null) {
- return false;
- } else {
- return false;
- }
- } else if (!getFullName().equals(other.getFullName())) {
- return false;
- }
- return true;
- }
-
- @Override
- public IAtsStateDefinition getDefaultToState() {
- return defaultToState;
- }
-
- public void setDefaultToState(IAtsStateDefinition defaultToState) {
- this.defaultToState = defaultToState;
- }
-
- @Override
- public List<IAtsDecisionReviewDefinition> getDecisionReviews() {
- return decisionReviews;
- }
-
- @Override
- public List<IAtsPeerReviewDefinition> getPeerReviews() {
- return peerReviews;
- }
-
- @Override
- public int getStateWeight() {
- return stateWeight;
- }
-
- /**
- * Set how much (of 100%) this state's percent complete will contribute to the full percent complete of work
- * definitions.
- *
- * @param percentWeight int value where all stateWeights in workdefinition == 100
- */
-
- public void setStateWeight(int percentWeight) {
- this.stateWeight = percentWeight;
- }
-
- public void setRecommendedPercentComplete(int recommendedPercentComplete) {
- this.recommendedPercentComplete = recommendedPercentComplete;
- }
-
- @Override
- public Integer getRecommendedPercentComplete() {
- return recommendedPercentComplete;
- }
-
- public void setColor(StateColor stateColor) {
- this.color = stateColor;
- }
-
- @Override
- public StateColor getColor() {
- return color;
- }
-
- /**
- * Rules
- */
- public void removeRule(String rule) {
- ruleMgr.removeRule(rule);
- }
-
- @Override
- public List<String> getRules() {
- return ruleMgr.getRules();
- }
-
- public void addRule(String rule) {
- ruleMgr.addRule(rule);
- }
-
- @Override
- public boolean hasRule(String rule) {
- return ruleMgr.hasRule(rule);
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockValueProvider.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockValueProvider.java
deleted file mode 100644
index e168f449a5..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockValueProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.ats.core.validator;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockValueProvider implements IValueProvider {
-
- private final Collection<String> values;
- private final String name;
-
- public MockValueProvider(Collection<String> values) {
- this("test", values);
- }
-
- public MockValueProvider(String name, Collection<String> values) {
- this.name = name;
- this.values = values;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public boolean isEmpty() {
- return values.isEmpty();
- }
-
- @Override
- public Collection<String> getValues() {
- return values;
- }
-
- @Override
- public Collection<Date> getDateValues() {
- return Collections.emptyList();
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockWidgetDefinition.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockWidgetDefinition.java
deleted file mode 100644
index b7f21a1d54..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/MockWidgetDefinition.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.ats.core.validator;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.osee.ats.api.workdef.IAtsWidgetConstraint;
-import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsWidgetOptionHandler;
-import org.eclipse.osee.ats.api.workdef.WidgetOption;
-import org.eclipse.osee.ats.api.workdef.WidgetOptionHandler;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockWidgetDefinition implements IAtsWidgetDefinition {
-
- private String attributeName;
- private String toolTip;
- private String description;
- private int height;
- private String xWidgetName;
- private String defaultValue;
- private final WidgetOptionHandler options = new WidgetOptionHandler();
- private final List<IAtsWidgetConstraint> constraints = new ArrayList<>();
- private String name;
-
- public MockWidgetDefinition(String name) {
- this.name = name;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public String getAtrributeName() {
- return attributeName;
- }
-
- public void setAttributeName(String storeName) {
- this.attributeName = storeName;
- }
-
- @Override
- public String getToolTip() {
- return toolTip;
- }
-
- public void setToolTip(String toolTip) {
- this.toolTip = toolTip;
- }
-
- @Override
- public boolean is(WidgetOption widgetOption) {
- return options.contains(widgetOption);
- }
-
- @Override
- public void set(WidgetOption widgetOption) {
- options.add(widgetOption);
- }
-
- @Override
- public String getXWidgetName() {
- return xWidgetName;
- }
-
- @Override
- public void setXWidgetName(String xWidgetName) {
- this.xWidgetName = xWidgetName;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public int getHeight() {
- return height;
- }
-
- @Override
- public void setHeight(int height) {
- this.height = height;
- }
-
- @Override
- public String toString() {
- return String.format("[%s][%s]", getName(), getAtrributeName());
- }
-
- @Override
- public IAtsWidgetOptionHandler getOptions() {
- return options;
- }
-
- @Override
- public List<IAtsWidgetConstraint> getConstraints() {
- return constraints;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
index 3f6fcaeaed..81075290d1 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.ArrayList;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.ats.mocks.MockValueProvider;
import org.junit.Assert;
/**
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/MockWorkDefinition.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/MockWorkDefinition.java
deleted file mode 100644
index a5250ac284..0000000000
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/MockWorkDefinition.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.ats.core.workdef;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
-
-/**
- * @author Donald G. Dunne
- */
-public class MockWorkDefinition implements IAtsWorkDefinition {
-
- private final List<IAtsStateDefinition> states = new ArrayList<>(5);
- private String id;
- private IAtsStateDefinition startState;
- private String name;
-
- public MockWorkDefinition(String name) {
- this.name = name;
- this.id = name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public IAtsStateDefinition getStateByName(String name) {
- for (IAtsStateDefinition state : states) {
- if (state.getName().equals(name)) {
- return state;
- }
- }
- return null;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (getId() == null ? 0 : getId().hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- MockWorkDefinition other = (MockWorkDefinition) obj;
- if (getId() == null) {
- if (other.getId() != null) {
- return false;
- } else {
- return false;
- }
- } else if (!getId().equals(other.getId())) {
- return false;
- }
- return true;
- }
-
- @Override
- public IAtsStateDefinition getStartState() {
- return startState;
- }
-
- public void setStartState(IAtsStateDefinition startState) {
- this.startState = startState;
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public IAtsStateDefinition addState(IAtsStateDefinition state) {
- IAtsStateDefinition currState = getStateByName(state.getName());
- if (currState != null) {
- throw new IllegalArgumentException("Can not add two states of same name");
- }
- states.add(state);
- return state;
- }
-
- @Override
- public List<IAtsStateDefinition> getStates() {
- return states;
- }
-
- @Override
- public String getGuid() {
- return id;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/WorkDefinitionMatchTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/WorkDefinitionMatchTest.java
index 5511154758..1b59979a96 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/WorkDefinitionMatchTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/WorkDefinitionMatchTest.java
@@ -12,15 +12,29 @@ package org.eclipse.osee.ats.core.workdef;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
/**
* Test case for {@link WorkDefinitionMatch}
- *
+ *
* @author Donald G. Dunne
*/
public class WorkDefinitionMatchTest {
+ // @formatter:off
+ @Mock private IAtsWorkDefinition workDef;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ Mockito.when(workDef.getName()).thenReturn("mine");
+ }
+
@Test
public void testWorkDefinitionMatch() {
WorkDefinitionMatch match = new WorkDefinitionMatch();
@@ -30,7 +44,6 @@ public class WorkDefinitionMatchTest {
@Test
public void testWorkDefinitionMatchWorkDefinitionString() {
- IAtsWorkDefinition workDef = new MockWorkDefinition("mine");
WorkDefinitionMatch match = new WorkDefinitionMatch(workDef.getName(), "trace");
match.setWorkDefinition(workDef);
Assert.assertNotNull(match.getWorkDefinition());
@@ -38,14 +51,6 @@ public class WorkDefinitionMatchTest {
}
@Test
- public void testGetSetWorkDefinition() {
- WorkDefinitionMatch match = new WorkDefinitionMatch();
- Assert.assertNull(match.getWorkDefinition());
- match.setWorkDefinition(new MockWorkDefinition("mine"));
- Assert.assertNotNull(match.getWorkDefinition());
- }
-
- @Test
public void testAddTrace() {
WorkDefinitionMatch match = new WorkDefinitionMatch();
Assert.assertTrue(match.getTrace().isEmpty());
@@ -61,7 +66,6 @@ public class WorkDefinitionMatchTest {
@Test
public void testIsMatched() {
- IAtsWorkDefinition workDef = new MockWorkDefinition("mine");
WorkDefinitionMatch match = new WorkDefinitionMatch(workDef.getName(), "trace");
match.setWorkDefinition(workDef);
Assert.assertTrue(match.isMatched());
@@ -71,7 +75,6 @@ public class WorkDefinitionMatchTest {
@Test
public void testToString() {
- IAtsWorkDefinition workDef = new MockWorkDefinition("mine");
WorkDefinitionMatch match = new WorkDefinitionMatch(workDef.getName(), "trace");
match.setWorkDefinition(workDef);
Assert.assertEquals("mine", match.toString());

Back to the top