Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-08-26 18:51:13 +0000
committerRoberto E. Escobar2014-10-01 21:04:20 +0000
commit8d8f0219c79d9e8f0366c062ed6e0291cd36985c (patch)
tree6dffd5cf43e65af1df79c38cafe8df9f4bddf386
parentdfe51d925a9804b57f5ec32664d298f9ad15df92 (diff)
downloadorg.eclipse.osee-8d8f0219c79d9e8f0366c062ed6e0291cd36985c.tar.gz
org.eclipse.osee-8d8f0219c79d9e8f0366c062ed6e0291cd36985c.tar.xz
org.eclipse.osee-8d8f0219c79d9e8f0366c062ed6e0291cd36985c.zip
bug[ats_ATS33276]: Transitioning actions to completed errors on open branch
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AllAtsCoreClientTestSuite.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidatorTest.java24
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidatorTest.java21
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidatorTest.java130
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/ValidatorTestSuite.java24
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/ArtifactValueProvider.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactWithWorkaroundValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java46
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXHyperlinkMemberSelValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXWidgetValidateManagerClient.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboValidatorTest.java13
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidatorTest.java22
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidatorTest.java22
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXListValidatorTest.java22
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXTextValidatorTest.java13
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java16
-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/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/IAtsXWidgetValidator.java3
-rw-r--r--plugins/org.eclipse.osee.ats.dsl.integration.test/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.ats.dsl.integration.test/pom.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.dsl.integration/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.ats.dsl.integration/pom.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java11
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/META-INF/MANIFEST.MF16
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/build.properties1
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTest.java306
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTestTest.java197
-rw-r--r--plugins/org.eclipse.osee.ats.parent/pom.xml13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java4
-rw-r--r--plugins/org.eclipse.osee.x.ats.parent/pom.xml2
45 files changed, 908 insertions, 110 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AllAtsCoreClientTestSuite.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AllAtsCoreClientTestSuite.java
index cb206e7a856..28d61180917 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AllAtsCoreClientTestSuite.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AllAtsCoreClientTestSuite.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.client;
import org.eclipse.osee.ats.core.client.internal.config.InternalConfigTestSuite;
import org.eclipse.osee.ats.core.client.internal.store.InternalStoreTestSuite;
import org.eclipse.osee.ats.core.client.review.ReviewTestSuite;
+import org.eclipse.osee.ats.core.client.validator.ValidatorTestSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -20,7 +21,11 @@ import org.junit.runners.Suite;
* @author Donald G. Dunne
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({InternalConfigTestSuite.class, InternalStoreTestSuite.class, ReviewTestSuite.class})
+@Suite.SuiteClasses({
+ InternalConfigTestSuite.class,
+ InternalStoreTestSuite.class,
+ ReviewTestSuite.class,
+ ValidatorTestSuite.class})
public class AllAtsCoreClientTestSuite {
// Test Suite
}
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidatorTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidatorTest.java
index 5bd50167b4e..7c934ecdea9 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidatorTest.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.ats.core.client.review.defect;
import java.util.Arrays;
import java.util.Date;
-import org.junit.Assert;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectItem.Severity;
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;
/**
* Test unit for {@link AtsXDefectValidator}
@@ -30,6 +31,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
* @author Donald G. Dunne
*/
public class AtsXDefectValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -45,18 +47,23 @@ public class AtsXDefectValidatorTest {
// Valid for anything not XDefectViewer
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XDefectViewer");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Reviews do not require Defects to be entered, even if required for transition
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
}
@@ -76,14 +83,15 @@ public class AtsXDefectValidatorTest {
MockDefectValueProvider itemValueProvider = new MockDefectValueProvider(Arrays.asList(item));
// Valid defect
- WidgetResult result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef);
+ WidgetResult result =
+ validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
// Invalid Severity
item = getValidItem();
item.setSeverity(Severity.None);
itemValueProvider = new MockDefectValueProvider(Arrays.asList(item));
- result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(ReviewDefectError.AllItemsMustBeMarkedAndClosed.getError(), result.getDetails());
@@ -91,7 +99,7 @@ public class AtsXDefectValidatorTest {
item = getValidItem();
item.setDisposition(Disposition.None);
itemValueProvider = new MockDefectValueProvider(Arrays.asList(item));
- result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(ReviewDefectError.AllItemsMustBeMarkedAndClosed.getError(), result.getDetails());
@@ -99,7 +107,7 @@ public class AtsXDefectValidatorTest {
item = getValidItem();
item.setClosed(false);
itemValueProvider = new MockDefectValueProvider(Arrays.asList(item));
- result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(itemValueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(ReviewDefectError.AllItemsMustBeMarkedAndClosed.getError(), result.getDetails());
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidatorTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidatorTest.java
index 5308dd161eb..cff3480729e 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidatorTest.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.ats.core.client.review.role;
import java.util.Arrays;
import java.util.List;
-import org.junit.Assert;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.review.Role;
import org.eclipse.osee.ats.api.review.UserRole;
import org.eclipse.osee.ats.api.workdef.StateType;
@@ -23,11 +23,13 @@ import org.eclipse.osee.ats.core.client.review.defect.ValidatorTestUtil;
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;
/**
* @author Donald G. Dunne
*/
public class AtsXUserRoleValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -43,20 +45,25 @@ public class AtsXUserRoleValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XUserRoleViewer");
// Not valid to have no roles
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(UserRoleError.OneRoleEntryRequired.getError(), result.getDetails());
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid to have no roles
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(UserRoleError.OneRoleEntryRequired.getError(), result.getDetails());
}
@@ -80,20 +87,20 @@ public class AtsXUserRoleValidatorTest {
MockUserRoleValueProvider provider = new MockUserRoleValueProvider(roles);
// Valid Roles
- WidgetResult result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ WidgetResult result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
ValidatorTestUtil.assertValidResult(result);
// Not valid to have no author
roles = Arrays.asList(reviewer);
provider = new MockUserRoleValueProvider(roles);
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(UserRoleError.MustHaveAtLeastOneAuthor.getError(), result.getDetails());
// Not valid to have no reviewer
roles = Arrays.asList(author);
provider = new MockUserRoleValueProvider(roles);
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
Assert.assertEquals(UserRoleError.MustHaveAtLeastOneReviewer.getError(), result.getDetails());
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidatorTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidatorTest.java
new file mode 100644
index 00000000000..c222341e7aa
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidatorTest.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.client.validator;
+
+import static org.mockito.Mockito.when;
+import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
+import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
+import org.eclipse.osee.ats.api.workdef.WidgetResult;
+import org.eclipse.osee.ats.core.validator.IValueProvider;
+import org.eclipse.osee.ats.mocks.AtsMockitoTest;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsXCommitManagerValidatorTest extends AtsMockitoTest {
+
+ public AtsXCommitManagerValidatorTest() {
+ super("AtsXCommitManagerValidatorTest");
+ }
+
+ // @formatter:off
+ @Mock IAtsWidgetDefinition widgetDef;
+ @Mock IAtsWidgetDefinition notXCommitManagerWidget;
+ @Mock ArtifactValueProvider provider;
+ @Mock IValueProvider notArtifactValueProvider;
+ // @formatter:on
+
+ @Override
+ @Before
+ public void setup() throws OseeCoreException {
+ super.setup();
+
+ when(widgetDef.getXWidgetName()).thenReturn("XCommitManager");
+ when(widgetDef.getName()).thenReturn("Commit Manager");
+ when(implement.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())).thenReturn(false);
+ }
+
+ @Test
+ public void testValidateTransition_notCommitManager() {
+ AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
+
+ WidgetResult result = validator.validateTransition(null, notXCommitManagerWidget, null, null, null);
+ Assert.assertEquals(WidgetResult.Valid, result);
+
+ result = validator.validateTransition(notArtifactValueProvider, widgetDef, null, null, atsServices);
+ Assert.assertEquals(WidgetResult.Valid, result);
+
+ when(provider.getObject()).thenReturn(task1);
+ result = validator.validateTransition(provider, widgetDef, null, null, atsServices);
+ Assert.assertEquals(WidgetResult.Valid, result);
+
+ }
+
+ @Test
+ public void testValidateTransition_noChangesToCommit() {
+ AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
+
+ when(provider.getObject()).thenReturn(teamWf);
+ when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(false);
+ when(branchService.isCommittedBranchExists(teamWf)).thenReturn(false);
+ WidgetResult result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(WidgetResult.Valid, result);
+ }
+
+ @Test
+ public void testValidateTransition_changesToCommit() {
+ AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
+
+ when(provider.getObject()).thenReturn(teamWf);
+ when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(true);
+ when(branchService.isCommittedBranchExists(teamWf)).thenReturn(false);
+ when(branchService.isAllObjectsToCommitToConfigured(teamWf)).thenReturn(true);
+ WidgetResult result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(AtsXCommitManagerValidator.ALL_BRANCHES_MUST_BE_COMMITTED, result.getDetails());
+
+ when(provider.getObject()).thenReturn(teamWf);
+ when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(false);
+ when(branchService.isCommittedBranchExists(teamWf)).thenReturn(true);
+ when(branchService.isAllObjectsToCommitToConfigured(teamWf)).thenReturn(true);
+ result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(AtsXCommitManagerValidator.ALL_BRANCHES_MUST_BE_COMMITTED, result.getDetails());
+ }
+
+ @Test
+ public void testValidateTransition_transitionToWithWorkingBranchRuleExists() {
+ AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
+
+ when(provider.getObject()).thenReturn(teamWf);
+ when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(true);
+ when(branchService.isCommittedBranchExists(teamWf)).thenReturn(false);
+ when(branchService.isAllObjectsToCommitToConfigured(teamWf)).thenReturn(true);
+ when(implement.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())).thenReturn(true);
+ WidgetResult result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(WidgetResult.Valid, result);
+ }
+
+ @Test
+ public void testValidateTransition_branchesMustBeConfigured() {
+
+ AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
+ when(provider.getObject()).thenReturn(teamWf);
+ when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(true);
+ when(branchService.isCommittedBranchExists(teamWf)).thenReturn(false);
+ when(branchService.isAllObjectsToCommitToConfigured(teamWf)).thenReturn(true);
+ when(implement.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())).thenReturn(false);
+
+ when(branchService.isBranchesAllCommitted(teamWf)).thenReturn(true);
+ WidgetResult result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(WidgetResult.Valid, result);
+
+ when(branchService.isBranchesAllCommitted(teamWf)).thenReturn(false);
+ result = validator.validateTransition(provider, widgetDef, analyze, implement, atsServices);
+ Assert.assertEquals(AtsXCommitManagerValidator.ALL_BRANCHES_MUST_BE_COMMITTED, result.getDetails());
+
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/ValidatorTestSuite.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/ValidatorTestSuite.java
new file mode 100644
index 00000000000..89fdfca6430
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/validator/ValidatorTestSuite.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * 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.ats.core.client.validator;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({AtsXCommitManagerValidatorTest.class})
+/**
+ *
+ * @author Donald G. Dunne
+ */
+public class ValidatorTestSuite {
+ // TestSuite
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidator.java
index 046f20fcbc2..93815cd47c7 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/defect/AtsXDefectValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.review.defect;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -25,7 +26,7 @@ public class AtsXDefectValidator extends AtsXWidgetValidator {
public static String WIDGET_NAME = "XDefectViewer";
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
ReviewDefectManager mgr = new ReviewDefectManager(provider);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidator.java
index 47d543cc850..2bf446e507c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/AtsXUserRoleValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.review.role;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -25,7 +26,7 @@ public class AtsXUserRoleValidator extends AtsXWidgetValidator {
public static String WIDGET_NAME = "XUserRoleViewer";
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
// ReviewDefectValidation converted to provider IValueProvider
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/ArtifactValueProvider.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/ArtifactValueProvider.java
index 8fbe5de9bf7..34f90ebffa5 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/ArtifactValueProvider.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/ArtifactValueProvider.java
@@ -96,4 +96,8 @@ public class ArtifactValueProvider implements IValueProvider {
return artifact;
}
+ public Object getObject() {
+ return artifact;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactValidator.java
index 7539180dd06..da3c57ec01f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
@@ -29,7 +30,7 @@ public class AtsOperationalImpactValidator extends AtsXWidgetValidator {
public static String WIDGET_NAME = "OperationalImpactXWidget";
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
if (provider instanceof ArtifactValueProvider && ((ArtifactValueProvider) provider).getArtifact() instanceof TeamWorkFlowArtifact) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactWithWorkaroundValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactWithWorkaroundValidator.java
index 1bf11d99f74..e1cedee3a01 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactWithWorkaroundValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsOperationalImpactWithWorkaroundValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
@@ -29,7 +30,7 @@ public class AtsOperationalImpactWithWorkaroundValidator implements IAtsXWidgetV
public static String WIDGET_NAME = "OperationalImpactWithWorkaroundXWidget";
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
if (provider instanceof TeamWorkFlowArtifact) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
index b2671afe06a..6ba6a76f0e4 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
@@ -11,15 +11,15 @@
package org.eclipse.osee.ats.core.client.validator;
import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.validator.AtsXWidgetValidator;
import org.eclipse.osee.ats.core.validator.IValueProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -30,23 +30,37 @@ import org.eclipse.osee.framework.logging.OseeLog;
*/
public class AtsXCommitManagerValidator extends AtsXWidgetValidator {
+ protected static final String ALL_BRANCHES_MUST_BE_COMMITTED = "All branches must be committed.";
+ protected static final String ALL_BRANCHES_MUST_BE_CONFIGURED_FOR_COMMIT =
+ "All branches must be configured for commit.";
+
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) {
WidgetResult result = WidgetResult.Valid;
if ("XCommitManager".equals(widgetDef.getXWidgetName())) {
try {
- IAtsBranchService branchService = AtsClientService.get().getBranchService();
- if (provider instanceof ArtifactValueProvider && ((ArtifactValueProvider) provider).getArtifact() instanceof TeamWorkFlowArtifact) {
- TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) ((ArtifactValueProvider) provider).getArtifact();
- if (!branchService.isAllObjectsToCommitToConfigured(teamArt)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
- "All branches must be configured for commit.");
- }
- boolean changesExistToCommit =
- branchService.isWorkingBranchInWork(teamArt) || branchService.isCommittedBranchExists(teamArt);
- if (changesExistToCommit && !transitionToWithWorkingBranchRuleExists(toStateDef) && !branchService.isBranchesAllCommitted(teamArt)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
- "All branches must be committed.");
+ IAtsBranchService branchService = atsServices.getBranchService();
+ if (provider instanceof ArtifactValueProvider) {
+ ArtifactValueProvider valueProvider = (ArtifactValueProvider) provider;
+ if (valueProvider.getObject() instanceof IAtsTeamWorkflow) {
+ IAtsTeamWorkflow teamWf = (IAtsTeamWorkflow) valueProvider.getObject();
+
+ boolean workingBranchInWork = branchService.isWorkingBranchInWork(teamWf);
+ boolean committedBranchExists = branchService.isCommittedBranchExists(teamWf);
+
+ boolean changesExistToCommit = workingBranchInWork || committedBranchExists;
+
+ if (changesExistToCommit) {
+ boolean allObjectsToCommitToConfigured = branchService.isAllObjectsToCommitToConfigured(teamWf);
+ if (!allObjectsToCommitToConfigured) {
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
+ ALL_BRANCHES_MUST_BE_CONFIGURED_FOR_COMMIT);
+ }
+ if (!transitionToWithWorkingBranchRuleExists(toStateDef) && !branchService.isBranchesAllCommitted(teamWf)) {
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
+ ALL_BRANCHES_MUST_BE_COMMITTED);
+ }
+ }
}
}
} catch (OseeCoreException ex) {
@@ -58,7 +72,7 @@ public class AtsXCommitManagerValidator extends AtsXWidgetValidator {
return result;
}
- private boolean transitionToWithWorkingBranchRuleExists(IAtsStateDefinition toStateDef) {
+ protected boolean transitionToWithWorkingBranchRuleExists(IAtsStateDefinition toStateDef) {
return toStateDef.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name());
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXHyperlinkMemberSelValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXHyperlinkMemberSelValidator.java
index 4131ddb4b79..7fc466c3c03 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXHyperlinkMemberSelValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXHyperlinkMemberSelValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -23,7 +24,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXHyperlinkMemberSelValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XHyperlabelMemberSelDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXWidgetValidateManagerClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXWidgetValidateManagerClient.java
index a3301b87d2e..66b1ab60ee0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXWidgetValidateManagerClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXWidgetValidateManagerClient.java
@@ -75,7 +75,7 @@ public class AtsXWidgetValidateManagerClient implements AtsXWidgetValidatorProvi
awa.getStateDefinition())) {
ArtifactValueProvider provider = new ArtifactValueProvider(awa, widgetDef);
AtsXWidgetValidateManager.instance.validateTransition(results, provider, widgetDef, awa.getStateDefinition(),
- toStateDef);
+ toStateDef, AtsClientService.get().getServices());
}
return results;
}
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 6d3e27f2718..68193f3091a 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
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.validator;
import static org.mockito.MockitoAnnotations.initMocks;
import java.util.Arrays;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -29,12 +30,14 @@ import org.junit.Test;
public class AtsXComboBooleanValidatorTest {
private AtsXComboBooleanValidator validator;
+ private IAtsServices atsServices;
@Before
public void setUp() {
initMocks(this);
validator = new AtsXComboBooleanValidator();
+
}
@Test
@@ -49,33 +52,38 @@ public class AtsXComboBooleanValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XComboBooleanDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
// Check for "true" value
MockValueProvider valueProvider = new MockValueProvider(Arrays.asList("true"));
- result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
// Check for "false" value
valueProvider = new MockValueProvider(Arrays.asList("false"));
- result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
// Check for "junk" value
valueProvider = new MockValueProvider(Arrays.asList("junk"));
- result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
}
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 42ce90d4f02..4a3d1074d0a 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,6 +22,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXComboValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -36,18 +38,23 @@ public class AtsXComboValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XComboDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
}
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 58b81967e7a..5d79b959de7 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
@@ -14,6 +14,7 @@ import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -25,6 +26,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXDateValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -40,18 +42,23 @@ public class AtsXDateValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XDateDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
@@ -70,7 +77,8 @@ public class AtsXDateValidatorTest {
MockDateValueProvider dateProvider = new MockDateValueProvider(Arrays.asList(new Date()));
// Valid for valid date
- WidgetResult result = validator.validateTransition(dateProvider, widgetDef, fromStateDef, toStateDef);
+ WidgetResult result =
+ validator.validateTransition(dateProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
}
@@ -92,7 +100,8 @@ public class AtsXDateValidatorTest {
MockDateValueProvider dateProvider = new MockDateValueProvider(Arrays.asList(pastDate, new Date()));
// Not valid for pastDate
- WidgetResult result = validator.validateTransition(dateProvider, widgetDef, fromStateDef, toStateDef);
+ WidgetResult result =
+ validator.validateTransition(dateProvider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
}
}
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 1fbbe5d15cc..466b33838e3 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
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.validator;
import java.util.Arrays;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinitionFloatMinMaxConstraint;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
@@ -24,6 +25,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXFloatValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -39,18 +41,23 @@ public class AtsXFloatValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XFloatDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
@@ -72,25 +79,26 @@ public class AtsXFloatValidatorTest {
// Valid is nothing entered
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
//Invalid_Range if > than what should be
constraint.set(0.0, 2.0);
MockValueProvider provider = new MockValueProvider(Arrays.asList("0.0", "2.0", "3.0"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Invalid_Range if less than supposed to
constraint.set(1.0, 2.0);
provider = new MockValueProvider(Arrays.asList("0.0"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Valid if == what supposed to be
constraint.set(2.0, 2.0);
provider = new MockValueProvider(Arrays.asList("2.0", "2.0"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
ValidatorTestUtil.assertValidResult(result);
// test nulls
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 e53be2ec77a..baaed316005 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
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.validator;
import java.util.Arrays;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinitionIntMinMaxConstraint;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
@@ -24,6 +25,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXIntegerValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -39,18 +41,23 @@ public class AtsXIntegerValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XIntegerDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
@@ -71,25 +78,26 @@ public class AtsXIntegerValidatorTest {
// Valid is nothing entered
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
//Invalid_Range if > than what should be
constraint.set(0, 2);
MockValueProvider provider = new MockValueProvider(Arrays.asList("0", "2", "3"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Invalid_Range if less than supposed to
constraint.set(1, 2);
provider = new MockValueProvider(Arrays.asList("0"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Valid if == what supposed to be
constraint.set(2, 2);
provider = new MockValueProvider(Arrays.asList("2", "2"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
ValidatorTestUtil.assertValidResult(result);
// test nulls
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 65c21b11041..6bba9936a88 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
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.validator;
import java.util.Arrays;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinitionListMinMaxSelectedConstraint;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
@@ -24,6 +25,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXListValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -39,18 +41,23 @@ public class AtsXListValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XListDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
@@ -72,25 +79,26 @@ public class AtsXListValidatorTest {
// Valid is nothing entered
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
//Invalid_Range if select more than supposed to
constraint.set(0, 2);
MockValueProvider provider = new MockValueProvider(Arrays.asList("this", "is", "selected"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Invalid_Range if less than supposed to
constraint.set(2, 2);
provider = new MockValueProvider(Arrays.asList("this"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Range, result.getStatus());
//Valid if less what supposed to
constraint.set(2, 2);
provider = new MockValueProvider(Arrays.asList("this", "is"));
- result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef);
+ result = validator.validateTransition(provider, widgetDef, fromStateDef, toStateDef, atsServices);
ValidatorTestUtil.assertValidResult(result);
// test nulls
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 91eb267e7df..958e0363131 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,6 +22,7 @@ import org.junit.Assert;
* @author Donald G. Dunne
*/
public class AtsXTextValidatorTest {
+ private IAtsServices atsServices;
@org.junit.Test
public void testValidateTransition() throws OseeCoreException {
@@ -36,18 +38,23 @@ public class AtsXTextValidatorTest {
// Valid for anything not XIntegerDam
WidgetResult result =
- validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.setXWidgetName("XTextDam");
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
ValidatorTestUtil.assertValidResult(result);
widgetDef.getOptions().add(WidgetOption.REQUIRED_FOR_TRANSITION);
// Not valid if widgetDef required and no values set
- result = validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef);
+ result =
+ validator.validateTransition(ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef, toStateDef,
+ atsServices);
Assert.assertEquals(WidgetStatus.Invalid_Incompleted, result.getStatus());
}
}
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 212648b1686..d2a993bc01f 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
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -27,13 +28,14 @@ import org.junit.Test;
* @author Donald G. Dunne
*/
public class AtsXWidgetValidateManagerTest {
+ IAtsServices atsServices;
@Test
public void testValidateTransition_emptyValidators() {
List<WidgetResult> results = new LinkedList<WidgetResult>();
AtsXWidgetValidateManager manager = new AtsXWidgetValidateManager();
- manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null);
+ manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null, atsServices);
Assert.assertTrue(results.isEmpty());
}
@@ -43,7 +45,7 @@ public class AtsXWidgetValidateManagerTest {
AtsXWidgetValidateManager manager = new AtsXWidgetValidateManager();
manager.add(new TestValidatorProvider(new AtsValidator()));
- manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null);
+ manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null, atsServices);
Assert.assertTrue(results.isEmpty());
}
@@ -53,7 +55,7 @@ public class AtsXWidgetValidateManagerTest {
AtsXWidgetValidateManager manager = new AtsXWidgetValidateManager();
manager.add(new TestValidatorProvider(new AtsErrorValidator()));
- manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null);
+ manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, null, null, null, atsServices);
Assert.assertFalse(results.isEmpty());
}
@@ -64,7 +66,7 @@ public class AtsXWidgetValidateManagerTest {
manager.add(new TestValidatorProvider(new AtsExceptoinValidator()));
MockWidgetDefinition widgetDef = new MockWidgetDefinition("Widget Name");
- manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, widgetDef, null, null);
+ manager.validateTransition(results, ValidatorTestUtil.emptyValueProvider, widgetDef, null, null, atsServices);
Assert.assertFalse(results.isEmpty());
Assert.assertEquals(results.iterator().next().getStatus(), WidgetStatus.Exception);
Assert.assertEquals(
@@ -82,7 +84,7 @@ public class AtsXWidgetValidateManagerTest {
private class AtsValidator implements IAtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) {
return new WidgetResult(WidgetStatus.Valid, null, "Here it is");
}
@@ -90,7 +92,7 @@ public class AtsXWidgetValidateManagerTest {
private class AtsErrorValidator implements IAtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) {
return new WidgetResult(WidgetStatus.Invalid_Incompleted, null, "Here it is");
}
@@ -98,7 +100,7 @@ public class AtsXWidgetValidateManagerTest {
private class AtsExceptoinValidator implements IAtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeStateException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeStateException {
throw new OseeStateException("problem");
}
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 7f43327dbac..a88d25bf03e 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
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.Arrays;
import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinitionFloatMinMaxConstraint;
@@ -38,7 +39,7 @@ public class AtsXWidgetValidatorTest {
private static AtsXWidgetValidator validator = new AtsXWidgetValidator() {
@Override
- public WidgetResult validateTransition(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ public WidgetResult validateTransition(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) {
return null;
}
};
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
index 1e6454b31d7..c38284a182f 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -29,7 +30,7 @@ public class AtsXComboBooleanValidator extends AtsXWidgetValidator {
}
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XComboBooleanDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, fromStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
index 191dd2c22bd..fcec0bf52e0 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXComboValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if (widgetDef.getXWidgetName().startsWith("XComboDam")) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
index 81f6f86988e..def0a2729e7 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXDateValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XDateDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidator.java
index a9cf6a1f9d8..ef39137706c 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXFloatValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXFloatValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XFloatDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidator.java
index 092701f91b8..2c2cb33fee2 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXIntegerValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXIntegerValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XIntegerDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
index 3feae563a3f..07fb4d34b7a 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXListValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XListDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
index b58e2618d41..cec948fa54f 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -21,7 +22,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class AtsXTextValidator extends AtsXWidgetValidator {
@Override
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException {
WidgetResult result = WidgetResult.Valid;
if ("XTextDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
index d995ef1f009..9185eeb6f7e 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.validator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -27,11 +28,12 @@ public class AtsXWidgetValidateManager {
protected AtsXWidgetValidateManager() {
}
- public void validateTransition(List<WidgetResult> results, IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ public void validateTransition(List<WidgetResult> results, IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) {
for (AtsXWidgetValidatorProvider provider : providers) {
for (IAtsXWidgetValidator validator : provider.getValidators()) {
try {
- WidgetResult status = validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef);
+ WidgetResult status =
+ validator.validateTransition(valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
if (!status.isValid()) {
results.add(status);
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
index 4f60c0d6731..64c748ace20 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.validator;
import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetConstraint;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
@@ -56,7 +57,7 @@ public abstract class AtsXWidgetValidator implements IAtsXWidgetValidator {
}
@Override
- public abstract WidgetResult validateTransition(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException;
+ public abstract WidgetResult validateTransition(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException;
@SuppressWarnings("unchecked")
public <A> A getConstraintOfType(IAtsWidgetDefinition widgetDef, Class<A> clazz) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/IAtsXWidgetValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/IAtsXWidgetValidator.java
index a0489d54b7a..04dbd756afd 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/IAtsXWidgetValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/IAtsXWidgetValidator.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.validator;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -22,6 +23,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public interface IAtsXWidgetValidator {
- public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) throws OseeCoreException;
+ public WidgetResult validateTransition(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.ats.dsl.integration.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.dsl.integration.test/META-INF/MANIFEST.MF
index 18f827a44ea..13b93da88e6 100644
--- a/plugins/org.eclipse.osee.ats.dsl.integration.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.dsl.integration.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ATS DSL Integration Test
Bundle-SymbolicName: org.eclipse.osee.ats.dsl.integration.test
-Bundle-Version: 0.18.0.qualifier
+Bundle-Version: 0.19.0.qualifier
Fragment-Host: org.eclipse.osee.ats.dsl.integration
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.ats.dsl.integration.test/pom.xml b/plugins/org.eclipse.osee.ats.dsl.integration.test/pom.xml
index 8ceedcd07ab..08bca4f38c1 100644
--- a/plugins/org.eclipse.osee.ats.dsl.integration.test/pom.xml
+++ b/plugins/org.eclipse.osee.ats.dsl.integration.test/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.osee</groupId>
<artifactId>org.eclipse.osee.x.ats.parent</artifactId>
- <version>0.18.0-SNAPSHOT</version>
+ <version>0.19.0-SNAPSHOT</version>
<relativePath>../../plugins/org.eclipse.osee.x.ats.parent</relativePath>
</parent>
diff --git a/plugins/org.eclipse.osee.ats.dsl.integration/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.dsl.integration/META-INF/MANIFEST.MF
index 409bc2ea329..fce756e589f 100644
--- a/plugins/org.eclipse.osee.ats.dsl.integration/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.dsl.integration/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ATS DSL Integration
Bundle-SymbolicName: org.eclipse.osee.ats.dsl.integration;singleton:=true
-Bundle-Version: 0.18.0.qualifier
+Bundle-Version: 0.19.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Service-Component: OSGI-INF/*.xml
Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.ats.dsl.integration/pom.xml b/plugins/org.eclipse.osee.ats.dsl.integration/pom.xml
index a450d9e12bf..6fadf2e7b58 100644
--- a/plugins/org.eclipse.osee.ats.dsl.integration/pom.xml
+++ b/plugins/org.eclipse.osee.ats.dsl.integration/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.osee</groupId>
<artifactId>org.eclipse.osee.x.ats.parent</artifactId>
- <version>0.18.0-SNAPSHOT</version>
+ <version>0.19.0-SNAPSHOT</version>
<relativePath>../../plugins/org.eclipse.osee.x.ats.parent</relativePath>
</parent>
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
index c7ef5a6608a..8775bb72fd8 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
@@ -106,7 +106,6 @@ public class AtsServerImpl implements IAtsServer {
private final List<IAtsNotifierServer> notifiers = new CopyOnWriteArrayList<IAtsNotifierServer>();
private WorkItemNotificationProcessor workItemNotificationProcessor;
private AtsNotificationEventProcessor notificationEventProcessor;
-
private IAtsVersionService versionService;
public void setLogger(Log logger) {
@@ -145,7 +144,7 @@ public class AtsServerImpl implements IAtsServer {
configItemFactory = new ConfigItemFactory(logger, this);
workItemService = new AtsWorkItemServiceImpl(this, this);
- branchService = new AtsBranchServiceImpl(this, orcsApi, dbService);
+ branchService = new AtsBranchServiceImpl(getServices(), orcsApi, dbService);
reviewService = new AtsReviewServiceImpl(this, workItemService);
workDefCacheProvider = new AtsWorkDefinitionCacheProvider(workDefService);
@@ -320,7 +319,7 @@ public class AtsServerImpl implements IAtsServer {
public QueryBuilder getQuery() {
return getOrcsApi().getQueryFactory(null).fromBranch(AtsUtilCore.getAtsBranch());
}
-
+
@Override
public String getConfigValue(String key) {
String result = null;
@@ -365,6 +364,10 @@ public class AtsServerImpl implements IAtsServer {
@Override
public IAtsVersionService getVersionService() {
- return null;
+ return versionService;
+ }
+
+ public AtsNotifierServiceImpl getNotifyService() {
+ return notifyService;
}
}
diff --git a/plugins/org.eclipse.osee.ats.mocks/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.mocks/META-INF/MANIFEST.MF
index 44964519be3..a3772514b59 100644
--- a/plugins/org.eclipse.osee.ats.mocks/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.mocks/META-INF/MANIFEST.MF
@@ -5,12 +5,24 @@ Bundle-SymbolicName: org.eclipse.osee.ats.mocks
Bundle-Version: 0.19.0.qualifier
Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: org.eclipse.core.runtime,
+Import-Package: org.eclipse.osee.ats.api,
+ org.eclipse.osee.ats.api.ai,
+ org.eclipse.osee.ats.api.commit,
+ org.eclipse.osee.ats.api.data,
+ org.eclipse.osee.ats.api.review,
+ org.eclipse.osee.ats.api.team,
+ org.eclipse.osee.ats.api.user,
+ org.eclipse.osee.ats.api.version,
org.eclipse.osee.ats.api.workdef,
+ org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model.cache,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.jdk.core.type,
- org.eclipse.osee.framework.jdk.core.util
+ org.eclipse.osee.framework.jdk.core.util,
+ org.junit
Export-Package: org.eclipse.osee.ats.mocks
+Require-Bundle: org.mockito;bundle-version="1.9.0",
+ org.hamcrest.core,
+ org.objenesis
diff --git a/plugins/org.eclipse.osee.ats.mocks/build.properties b/plugins/org.eclipse.osee.ats.mocks/build.properties
index 34d2e4d2dad..3af869a6dd7 100644
--- a/plugins/org.eclipse.osee.ats.mocks/build.properties
+++ b/plugins/org.eclipse.osee.ats.mocks/build.properties
@@ -2,3 +2,4 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
+
diff --git a/plugins/org.eclipse.osee.ats.mocks/pom.xml b/plugins/org.eclipse.osee.ats.mocks/pom.xml
index 013d2151e89..4373c0e55db 100644
--- a/plugins/org.eclipse.osee.ats.mocks/pom.xml
+++ b/plugins/org.eclipse.osee.ats.mocks/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.ats.parent</artifactId>
<version>0.19.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.ats.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.mocks</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTest.java b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTest.java
new file mode 100644
index 00000000000..e03bb97267b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTest.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.mocks;
+
+import static org.mockito.Mockito.when;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.api.IAtsServices;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
+import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.version.IAtsVersionService;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.IAtsAction;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.junit.Before;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Class in support of testing ATS using Mocks. Sets up a standard configuration of mocks to use.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsMockitoTest {
+
+ // @formatter:off
+ @Mock protected IAtsUser currentUser;
+ @Mock protected IAtsTeamWorkflow teamWf;
+ @Mock protected IAtsTeamDefinition teamDef;
+ @Mock protected IAtsVersion ver1, ver2, ver3, ver4;
+ @Mock protected IAtsDecisionReview decRev;
+ @Mock protected IAtsPeerToPeerReview peerRev;
+ @Mock protected IAtsTask task1, task2;
+ @Mock protected IAtsActionableItem testAi, testAi2;
+ @Mock protected IAtsAction action;
+ @Mock protected IAtsStateDefinition analyze, implement, completed, cancelled;
+ @Mock protected IAtsWorkDefinition workDef;
+ @Mock protected IAtsWidgetDefinition estHoursWidgetDef, workPackageWidgetDef;
+ @Mock protected IAttributeResolver attrResolver;
+ @Mock protected IAtsVersionService versionService;
+ @Mock protected IAtsBranchService branchService;
+ @Mock protected IAtsWorkDefinitionService workDefService;
+ @Mock protected IAtsWorkItemService workItemService;
+ @Mock protected IAtsServices atsServices;
+ // @formatter:on
+
+ public String WORK_DEF_NAME = "Mock_Team_Workflow_Definition";
+ private final String className;
+ private String testName = "";
+
+ public AtsMockitoTest(String className) {
+ this.className = className;
+ }
+
+ public void setTestName(String testName) {
+ this.testName = testName;
+ }
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ when(atsServices.getAttributeResolver()).thenReturn(attrResolver);
+ when(atsServices.getVersionService()).thenReturn(versionService);
+ when(atsServices.getBranchService()).thenReturn(branchService);
+ when(atsServices.getWorkDefService()).thenReturn(workDefService);
+ when(atsServices.getWorkItemService()).thenReturn(workItemService);
+
+ when(currentUser.getName()).thenReturn("User1");
+ when(currentUser.getGuid()).thenReturn(GUID.create());
+ when(currentUser.getUserId()).thenReturn("1324");
+ when(currentUser.isActive()).thenReturn(true);
+
+ initializeState(analyze, "Analyze", StateType.Working, 1, implement,
+ Arrays.asList(implement, completed, cancelled), Arrays.asList(cancelled));
+ initializeState(implement, "Implement", StateType.Working, 2, completed,
+ Arrays.asList(analyze, completed, cancelled), Arrays.asList(cancelled, analyze));
+ initializeState(completed, "Completed", StateType.Completed, 3, completed, Arrays.asList(implement),
+ Arrays.asList(implement));
+ initializeState(cancelled, "Cancelled", StateType.Cancelled, 4, null, Arrays.asList(analyze, implement),
+ Arrays.asList(analyze, implement));
+
+ when(workDef.getName()).thenReturn(WORK_DEF_NAME);
+ when(workDef.getStartState()).thenReturn(analyze);
+ when(workDef.getStates()).thenReturn(Arrays.asList(cancelled, analyze, completed, implement));
+
+ when(estHoursWidgetDef.getName()).thenReturn(AtsAttributeTypes.EstimatedHours.getUnqualifiedName());
+ when(estHoursWidgetDef.getAtrributeName()).thenReturn(AtsAttributeTypes.EstimatedHours.getName());
+ when(estHoursWidgetDef.getXWidgetName()).thenReturn("XFloatDam");
+
+ when(workPackageWidgetDef.getName()).thenReturn(AtsAttributeTypes.WorkPackage.getUnqualifiedName());
+ when(workPackageWidgetDef.getAtrributeName()).thenReturn(AtsAttributeTypes.WorkPackage.getName());
+ when(workPackageWidgetDef.getXWidgetName()).thenReturn("XTextDam");
+
+ initializeAi(testAi, "AI", true, true);
+ initializeAi(testAi2, "AI2", true, true);
+ Set<IAtsActionableItem> aias = new HashSet<IAtsActionableItem>();
+ aias.add(testAi);
+ aias.add(testAi2);
+
+ when(teamDef.getName()).thenReturn(getTitle("Test Team Def"));
+ when(teamDef.getGuid()).thenReturn(GUID.create());
+ when(teamDef.getWorkflowDefinition()).thenReturn(WORK_DEF_NAME);
+ when(teamDef.isActive()).thenReturn(true);
+ when(teamDef.getLeads()).thenReturn(Arrays.asList(currentUser));
+ when(teamDef.getActionableItems()).thenReturn(aias);
+
+ inializeVersion(ver1, "ver 1.0");
+ inializeVersion(ver2, "ver 2.0");
+ inializeVersion(ver3, "ver 3.0");
+ inializeVersion(ver4, "ver 4.0");
+
+ when(teamDef.getVersions()).thenReturn(Arrays.asList(ver1, ver2, ver3, ver4));
+
+ when(action.getTeamWorkflows()).thenReturn(Arrays.asList(teamWf));
+ when(action.getGuid()).thenReturn(GUID.create());
+ when(action.getName()).thenReturn(getTitle("Action"));
+
+ when(teamWf.getName()).thenReturn("Test Team Wf");
+ when(teamWf.getActionableItems()).thenReturn(aias);
+ when(teamWf.getAtsId()).thenReturn("ATS0008");
+ when(teamWf.getArtifactTypeName()).thenReturn(AtsArtifactTypes.TeamWorkflow.getName());
+ when(teamWf.getTeamDefinition()).thenReturn(teamDef);
+
+ inializeTask(task1, "Test Task 1");
+ inializeTask(task2, "Test Task 2");
+
+ when(decRev.getParentTeamWorkflow()).thenReturn(teamWf);
+ when(decRev.getName()).thenReturn(getTitle("Test Dec Rev"));
+ when(decRev.getAssignees()).thenReturn(Arrays.asList(currentUser));
+
+ when(peerRev.getParentTeamWorkflow()).thenReturn(teamWf);
+ when(peerRev.getName()).thenReturn(getTitle("Test Peer Rev"));
+ when(peerRev.getAssignees()).thenReturn(Arrays.asList(currentUser));
+ }
+
+ private void inializeTask(IAtsTask task, String name) {
+ when(task.getName()).thenReturn(getTitle(name));
+ when(task.getGuid()).thenReturn(GUID.create());
+ when(task.getParentTeamWorkflow()).thenReturn(teamWf);
+ }
+
+ private void inializeVersion(IAtsVersion version, String name) {
+ when(version.getName()).thenReturn(name);
+ when(version.getGuid()).thenReturn(GUID.create());
+ }
+
+ private void initializeState(IAtsStateDefinition state, String name, StateType type, int ordinal, IAtsStateDefinition defaultToState, List<IAtsStateDefinition> toStates, List<IAtsStateDefinition> overrideValidationStates) {
+ when(state.getName()).thenReturn(name);
+ when(state.getWorkDefinition()).thenReturn(workDef);
+ when(state.getStateType()).thenReturn(type);
+ when(state.getOrdinal()).thenReturn(ordinal);
+ if (defaultToState != null) {
+ when(state.getDefaultToState()).thenReturn(defaultToState);
+ }
+ when(state.getToStates()).thenReturn(toStates);
+ when(state.getOverrideAttributeValidationStates()).thenReturn(overrideValidationStates);
+ }
+
+ private void initializeAi(IAtsActionableItem ai, String name, boolean active, boolean actionable) {
+ when(ai.getGuid()).thenReturn(GUID.create());
+ when(ai.getName()).thenReturn(name);
+ when(ai.isActionable()).thenReturn(actionable);
+ when(ai.isActive()).thenReturn(active);
+ when(ai.getTeamDefinition()).thenReturn(teamDef);
+ }
+
+ public IAtsWorkDefinition getWorkDef() {
+ return workDef;
+ }
+
+ public IAtsStateDefinition getAnalyzeStateDef() {
+ return analyze;
+ }
+
+ public IAtsWidgetDefinition getEstHoursWidgetDef() {
+ return estHoursWidgetDef;
+ }
+
+ public IAtsWidgetDefinition getWorkPackageWidgetDef() {
+ return workPackageWidgetDef;
+ }
+
+ public IAtsStateDefinition getImplementStateDef() {
+ return implement;
+ }
+
+ public IAtsStateDefinition getCompletedStateDef() {
+ return completed;
+ }
+
+ public IAtsStateDefinition getCancelledStateDef() {
+ return cancelled;
+ }
+
+ public IAtsTeamWorkflow getTeamWf() {
+ return teamWf;
+ }
+
+ public IAtsActionableItem getTestAi() {
+ return testAi;
+ }
+
+ public IAtsTeamDefinition getTestTeamDef() {
+ return teamDef;
+ }
+
+ @Override
+ public String toString() {
+ return getTitle("");
+ }
+
+ public IAtsUser getCurrentUser() {
+ return currentUser;
+ }
+
+ public IAtsTeamDefinition getTeamDef() {
+ return teamDef;
+ }
+
+ public IAtsVersion getVer1() {
+ return ver1;
+ }
+
+ public IAtsVersion getVer2() {
+ return ver2;
+ }
+
+ public IAtsVersion getVer3() {
+ return ver3;
+ }
+
+ public IAtsVersion getVer4() {
+ return ver4;
+ }
+
+ public IAtsDecisionReview getDecRev() {
+ return decRev;
+ }
+
+ public IAtsPeerToPeerReview getPeerRev() {
+ return peerRev;
+ }
+
+ public IAtsTask getTask1() {
+ return task1;
+ }
+
+ public IAtsTask getTask2() {
+ return task2;
+ }
+
+ public IAtsActionableItem getTestAi2() {
+ return testAi2;
+ }
+
+ public IAtsAction getAction() {
+ return action;
+ }
+
+ protected String getTitle(String objectName) {
+ StringBuilder sb = new StringBuilder("AMT -");
+ if (Strings.isValid(objectName)) {
+ sb.append(" Obj:[");
+ sb.append(objectName);
+ sb.append("] ");
+ }
+ if (Strings.isValid(testName)) {
+ sb.append(" Test:[");
+ sb.append(testName);
+ sb.append("] ");
+ }
+ if (Strings.isValid(className)) {
+ sb.append(" Class:[");
+ sb.append(className);
+ sb.append("] ");
+ }
+ return sb.toString().replaceFirst(" $", "");
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTestTest.java b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTestTest.java
new file mode 100644
index 00000000000..7f811705bd3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/AtsMockitoTestTest.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.mocks;
+
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workdef.StateType;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsMockitoTestTest extends AtsMockitoTest {
+
+ public AtsMockitoTestTest() {
+ super("MyTestClass");
+ }
+
+ @Test
+ public void testAtsMockitoTest() {
+ Assert.assertEquals("AMT - Class:[MyTestClass]", toString());
+ }
+
+ @Test
+ public void testSetTestName() {
+ setTestName("testReset");
+ Assert.assertEquals("AMT - Test:[testReset] Class:[MyTestClass]", toString());
+ }
+
+ @Test
+ public void testSetup() {
+ setup();
+ }
+
+ @Test
+ public void testGetWorkDef() {
+ Assert.assertEquals("Mock_Team_Workflow_Definition", workDef.getName());
+ Assert.assertEquals(4, workDef.getStates().size());
+ Assert.assertEquals(analyze, workDef.getStartState());
+ }
+
+ @Test
+ public void testGetAnalyzeStateDef() {
+ Assert.assertEquals("Analyze", analyze.getName());
+ Assert.assertEquals(StateType.Working, analyze.getStateType());
+ Assert.assertEquals(1, analyze.getOrdinal());
+ Assert.assertEquals(implement, analyze.getDefaultToState());
+ }
+
+ @Test
+ public void testGetEstHoursWidgetDef() {
+ Assert.assertEquals("Estimated Hours", estHoursWidgetDef.getName());
+ Assert.assertEquals(AtsAttributeTypes.EstimatedHours.getName(), estHoursWidgetDef.getAtrributeName());
+ Assert.assertEquals("XFloatDam", estHoursWidgetDef.getXWidgetName());
+ }
+
+ @Test
+ public void testGetWorkPackageWidgetDef() {
+ Assert.assertEquals("Work Package", workPackageWidgetDef.getName());
+ Assert.assertEquals(AtsAttributeTypes.WorkPackage.getName(), workPackageWidgetDef.getAtrributeName());
+ Assert.assertEquals("XTextDam", workPackageWidgetDef.getXWidgetName());
+ }
+
+ @Test
+ public void testGetImplementStateDef() {
+ Assert.assertEquals("Implement", implement.getName());
+ Assert.assertEquals(StateType.Working, implement.getStateType());
+ Assert.assertEquals(2, implement.getOrdinal());
+ Assert.assertEquals(completed, implement.getDefaultToState());
+ }
+
+ @Test
+ public void testGetCompletedStateDef() {
+ Assert.assertEquals("Completed", completed.getName());
+ Assert.assertEquals(StateType.Completed, completed.getStateType());
+ Assert.assertEquals(3, completed.getOrdinal());
+ Assert.assertEquals(completed, completed.getDefaultToState());
+ }
+
+ @Test
+ public void testGetCancelledStateDef() {
+ Assert.assertEquals("Cancelled", cancelled.getName());
+ Assert.assertEquals(StateType.Cancelled, cancelled.getStateType());
+ Assert.assertEquals(4, cancelled.getOrdinal());
+ Assert.assertNull(cancelled.getDefaultToState());
+ }
+
+ @Test
+ public void testGetTeamWf() {
+ Assert.assertEquals("Test Team Wf", teamWf.getName());
+ Assert.assertTrue(teamWf.getActionableItems().contains(testAi));
+ Assert.assertTrue(teamWf.getActionableItems().contains(testAi2));
+ Assert.assertEquals(teamDef, teamWf.getTeamDefinition());
+ Assert.assertEquals("ATS0008", teamWf.getAtsId());
+ Assert.assertEquals(AtsArtifactTypes.TeamWorkflow.getName(), teamWf.getArtifactTypeName());
+ }
+
+ @Test
+ public void testGetTestAi() {
+ Assert.assertEquals("AI", testAi.getName());
+ Assert.assertEquals(teamDef, testAi.getTeamDefinition());
+ }
+
+ @Test
+ public void testToString() {
+ Assert.assertEquals("AMT - Class:[MyTestClass]", toString());
+ setTestName("testToString");
+ Assert.assertEquals("AMT - Test:[testToString] Class:[MyTestClass]", toString());
+ }
+
+ @Test
+ public void testGetTitle() {
+ setTestName("testToString");
+ String title = getTitle("Action");
+ Assert.assertEquals("AMT - Obj:[Action] Test:[testToString] Class:[MyTestClass]", title);
+ }
+
+ @Test
+ public void testGetCurrentUser() {
+ Assert.assertEquals("User1", currentUser.getName());
+ Assert.assertEquals("1324", currentUser.getUserId());
+ Assert.assertTrue(currentUser.isActive());
+ }
+
+ @Test
+ public void testGetTeamDef() {
+ Assert.assertEquals("AMT - Obj:[Test Team Def] Class:[MyTestClass]", teamDef.getName());
+ Assert.assertTrue(teamDef.getActionableItems().contains(testAi));
+ Assert.assertTrue(teamDef.getActionableItems().contains(testAi2));
+ Assert.assertTrue(teamDef.isActive());
+ Assert.assertEquals(WORK_DEF_NAME, teamDef.getWorkflowDefinition());
+ }
+
+ @Test
+ public void testGetVer1() {
+ Assert.assertEquals("ver 1.0", ver1.getName());
+ }
+
+ @Test
+ public void testGetVer2() {
+ Assert.assertEquals("ver 2.0", ver2.getName());
+ }
+
+ @Test
+ public void testGetVer3() {
+ Assert.assertEquals("ver 3.0", ver3.getName());
+ }
+
+ @Test
+ public void testGetVer4() {
+ Assert.assertEquals("ver 4.0", ver4.getName());
+ }
+
+ @Test
+ public void testGetDecRev() {
+ Assert.assertEquals("AMT - Obj:[Test Dec Rev] Class:[MyTestClass]", decRev.getName());
+ Assert.assertEquals(teamWf, decRev.getParentTeamWorkflow());
+ Assert.assertTrue(decRev.getAssignees().contains(currentUser));
+ }
+
+ @Test
+ public void testGetPeerRev() {
+ Assert.assertEquals("AMT - Obj:[Test Peer Rev] Class:[MyTestClass]", peerRev.getName());
+ Assert.assertEquals(teamWf, peerRev.getParentTeamWorkflow());
+ Assert.assertTrue(peerRev.getAssignees().contains(currentUser));
+ }
+
+ @Test
+ public void testGetTask1() {
+ Assert.assertEquals("AMT - Obj:[Test Task 1] Class:[MyTestClass]", task1.getName());
+ }
+
+ @Test
+ public void testGetTask2() {
+ Assert.assertEquals("AMT - Obj:[Test Task 2] Class:[MyTestClass]", task2.getName());
+ }
+
+ @Test
+ public void testGetTestAi2() {
+ Assert.assertEquals("AI", testAi.getName());
+ }
+
+ @Test
+ public void testGetAction() {
+ Assert.assertEquals("AI2", testAi2.getName());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.parent/pom.xml b/plugins/org.eclipse.osee.ats.parent/pom.xml
index ffc8517e097..95dca93cfc0 100644
--- a/plugins/org.eclipse.osee.ats.parent/pom.xml
+++ b/plugins/org.eclipse.osee.ats.parent/pom.xml
@@ -42,7 +42,20 @@
<module>../../plugins/org.eclipse.osee.ats.p2</module>
</modules>
+
<profiles>
+ <profile>
+ <id>ats-client-mock</id>
+ <activation>
+ <property>
+ <name>osee-build-stage</name>
+ <value>osee-ats-client</value>
+ </property>
+ </activation>
+ <modules>
+ <module>../../plugins/org.eclipse.osee.ats.mocks</module>
+ </modules>
+ </profile>
<profile>
<id>ats-client-help-test</id>
<activation>
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index a92434a7e55..c7f0f9dacc0 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -336,8 +336,8 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
int backgroundColor = SWT.COLOR_BLACK;
String infoStr = "Double-click item to perform Action";
if (xCommitManager != null && xCommitManager.getXCommitViewer() != null && xCommitManager.getXCommitViewer().getTeamArt() != null && xCommitManager.getXCommitViewer().getTeamArt() != null) {
- if (!AtsClientService.get().getBranchService().isAllObjectsToCommitToConfigured(
- xCommitManager.getXCommitViewer().getTeamArt())) {
+ boolean workingBranchInWork = AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt);
+ if (workingBranchInWork && !AtsClientService.get().getBranchService().isAllObjectsToCommitToConfigured(xCommitManager.getXCommitViewer().getTeamArt())) {
infoStr = "All branches must be configured - Double-click item to perform Action";
backgroundColor = SWT.COLOR_RED;
returnStatus =
diff --git a/plugins/org.eclipse.osee.x.ats.parent/pom.xml b/plugins/org.eclipse.osee.x.ats.parent/pom.xml
index 039e28915b3..49501339def 100644
--- a/plugins/org.eclipse.osee.x.ats.parent/pom.xml
+++ b/plugins/org.eclipse.osee.x.ats.parent/pom.xml
@@ -28,7 +28,7 @@
<module>../../plugins/org.eclipse.osee.ats.impl</module>
<module>../../plugins/org.eclipse.osee.ats.impl.test</module>
-
+
<module>../../plugins/org.eclipse.osee.ats.rest</module>
<module>../../features/org.eclipse.osee.x.ats.feature</module>

Back to the top