Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-05-31 15:10:56 -0400
committerAngel Avila2016-05-31 15:10:56 -0400
commit79cb334114158737e8b88b970f8d9d64ffb4efbd (patch)
treea2f8ff7d2aeb52c448d1e27a53415e7318374efc /plugins/org.eclipse.osee.ats.core.test
parentf411cdb73fc14907f82a14d56e825c283e91f95f (diff)
downloadorg.eclipse.osee-79cb334114158737e8b88b970f8d9d64ffb4efbd.tar.gz
org.eclipse.osee-79cb334114158737e8b88b970f8d9d64ffb4efbd.tar.xz
org.eclipse.osee-79cb334114158737e8b88b970f8d9d64ffb4efbd.zip
feature[ats_UFM31]: Add workItem to XWidget validator
Diffstat (limited to 'plugins/org.eclipse.osee.ats.core.test')
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java11
1 files changed, 7 insertions, 4 deletions
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 92b9499ac9..dee41d2c28 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
@@ -42,6 +42,7 @@ public class AtsXWidgetValidateManagerTest {
@Test
public void testValidateTransition_emptyValidators() {
List<WidgetResult> results = new LinkedList<>();
+ AtsXWidgetValidateManager.getProviders().clear();
AtsXWidgetValidateManager.validateTransition(workItem, results, ValidatorTestUtil.emptyValueProvider, null, null,
null, atsServices);
@@ -52,6 +53,7 @@ public class AtsXWidgetValidateManagerTest {
public void testValidateTransition_validValidators() {
List<WidgetResult> results = new LinkedList<>();
AtsXWidgetValidateManager manager = new AtsXWidgetValidateManager();
+ AtsXWidgetValidateManager.getProviders().clear();
TestValidatorProvider provider = new TestValidatorProvider(new AtsValidator());
manager.addWidgetValidatorProvider(provider);
@@ -75,19 +77,20 @@ public class AtsXWidgetValidateManagerTest {
}
@Test
- public void testValidateTransition_exceptoinValidators() {
+ public void testValidateTransition_exceptionValidators() {
List<WidgetResult> results = new LinkedList<>();
AtsXWidgetValidateManager manager = new AtsXWidgetValidateManager();
- TestValidatorProvider provider = new TestValidatorProvider(new AtsExceptoinValidator());
+ TestValidatorProvider provider = new TestValidatorProvider(new AtsExceptionValidator());
manager.addWidgetValidatorProvider(provider);
MockWidgetDefinition widgetDef = new MockWidgetDefinition("Widget Name");
+ widgetDef.setXWidgetName("XTestWidget");
AtsXWidgetValidateManager.validateTransition(workItem, results, ValidatorTestUtil.emptyValueProvider, widgetDef,
null, null, atsServices);
Assert.assertFalse(results.isEmpty());
Assert.assertEquals(results.iterator().next().getStatus(), WidgetStatus.Exception);
Assert.assertEquals(
- "Exception - Widget Name - Exception retriving validation for widget [AtsExceptoinValidator] Exception [problem]",
+ "Exception - Widget Name - Exception retriving validation for widget [AtsExceptionValidator] Exception [problem]",
results.iterator().next().toString());
Assert.assertTrue(results.iterator().next().getException() instanceof OseeStateException);
manager.removeWidgetValidatorProvider(provider);
@@ -109,7 +112,7 @@ public class AtsXWidgetValidateManagerTest {
}
}
- private class AtsExceptoinValidator implements IAtsXWidgetValidator {
+ private class AtsExceptionValidator implements IAtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, IAtsServices atsServices) throws OseeStateException {

Back to the top