Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-07-25 20:57:39 -0400
committerdonald.g.dunne2017-07-27 21:03:47 -0400
commit749a485776f28e3331398ed453c91d9a3f08053e (patch)
treed3b2834ed32ab9c3a1863d52f795369aae0100ce
parent5fdad963d46c71469b1774f6799291f648e9c017 (diff)
downloadorg.eclipse.osee-ats_config_load.tar.gz
org.eclipse.osee-ats_config_load.tar.xz
org.eclipse.osee-ats_config_load.zip
bug: Improve test performanceats_config_load
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java13
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java2
5 files changed, 17 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
index e6b435d904..4d345099ca 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
@@ -49,7 +49,6 @@ import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.actions.ISelectedAtsArtifacts;
import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
-import org.eclipse.osee.ats.core.client.config.AtsBulkLoad;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
@@ -290,7 +289,7 @@ public class AtsTestUtil {
throw new OseeStateException("AtsTestUtil should not be run on production.");
}
- AtsBulkLoad.reloadConfig(true);
+ // AtsBulkLoad.reloadConfig(true);
AtsTestUtil.postFixName = postFixName;
importWorkDefinition();
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
index f7ba72b9b3..561268a9ce 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
@@ -62,7 +62,7 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + WORK_DEF_FILE_NAME);
}
@@ -108,7 +108,7 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + WORK_DEF_FILE_NAME_PREPARE);
}
@@ -120,7 +120,7 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
TeamState.Implement.getName(), Arrays.asList(AtsClientService.get().getUserService().getCurrentUser
- ()), null, changes, TransitionOption.None);
+ ()), null, changes, TransitionOption.None);
IAtsTransitionManager transitionMgr = TransitionFactory.getTransitionManager(helper);
TransitionResults results = transitionMgr.handleAllAndPersist();
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
index 67216632af..2211b546c9 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
@@ -60,7 +60,7 @@ public class PeerReviewDefinitionManagerTest extends PeerReviewDefinitionManager
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + WORK_DEF_FILE_NAME);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
index 026a9c6df4..1c381e15fb 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.ats.api.task.IAtsTaskService;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.JaxAtsWorkDef;
import org.eclipse.osee.ats.api.workdef.StateType;
@@ -48,6 +49,7 @@ import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.core.workflow.transition.TransitionFactory;
import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
+import org.eclipse.osee.ats.demo.api.DemoArtifactToken;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.util.Result;
@@ -137,6 +139,7 @@ public class TransitionManagerTest {
@org.junit.Test
public void testHandleTransitionValidation__MustBeAssigned() throws OseeCoreException {
AtsTestUtil.cleanupAndReset("TransitionManagerTest-B");
+ AtsClientService.get().clearCaches();
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
IAtsTeamDefinition teamDef = teamArt.getTeamDefinition();
Assert.assertNotNull(teamDef);
@@ -213,6 +216,7 @@ public class TransitionManagerTest {
@org.junit.Test
public void testHandleTransitionValidation__WorkingBranchTransitionable() throws OseeCoreException {
AtsTestUtil.cleanupAndReset("TransitionManagerTest-C");
+ AtsClientService.get().clearCaches();
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
@@ -221,9 +225,14 @@ public class TransitionManagerTest {
IAtsTransitionManager transMgr = TransitionFactory.getTransitionManager(helper);
TransitionResults results = new TransitionResults();
+ IAtsChangeSet changes = AtsClientService.get().createChangeSet(getClass().getSimpleName());
+ IAtsVersion version = AtsClientService.get().getConfigItem(DemoArtifactToken.SAW_Bld_1);
+ AtsClientService.get().getVersionService().setTargetedVersion(teamArt, version, changes);
+ changes.execute();
+
// this should pass
transMgr.handleTransitionValidation(results);
- Assert.assertTrue("Test wasn't reset to allow transition", results.isEmpty());
+ Assert.assertTrue("Test wasn't reset to allow transition - " + results.toString(), results.isEmpty());
// attempt to transition to Implement with working branch
helper.setWorkingBranchInWork(true);
@@ -461,7 +470,7 @@ public class TransitionManagerTest {
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + workDefFilename);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
index bfa739242b..7579a23c2e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
@@ -75,7 +75,7 @@ public class DatabaseBranchAccessor implements IOseeDataAccessor<Branch> {
public static Branch loadBranch(IOseeCache<Branch> cache, BranchId branchId) {
return ConnectionHandler.getJdbcClient().fetchOrException(
- () -> new BranchDoesNotExist("Branch could not be acquired for branch id %d", branchId),
+ () -> new BranchDoesNotExist("Branch could not be acquired for branch id %s", branchId),
stmt -> load(cache, stmt), SELECT_BRANCH, branchId);
}

Back to the top