Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-11-02 16:22:24 -0400
committerRyan D. Brooks2010-11-02 16:22:24 -0400
commite5bb52166c23d1356e5f0d18d74dd0ed580f71dd (patch)
treea9a7edea5c3cb79f2eac4f7748aa8a528ab39cc3 /plugins/org.eclipse.osee.coverage
parent4b7d24ef3d9d0086d7bbc3f28f92f18a979bbc90 (diff)
downloadorg.eclipse.osee-e5bb52166c23d1356e5f0d18d74dd0ed580f71dd.tar.gz
org.eclipse.osee-e5bb52166c23d1356e5f0d18d74dd0ed580f71dd.tar.xz
org.eclipse.osee-e5bb52166c23d1356e5f0d18d74dd0ed580f71dd.zip
refinement: Add check for test db for convenience branch set in CoverageUtil
Diffstat (limited to 'plugins/org.eclipse.osee.coverage')
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
index c53dc4b9f4f..7c0fa4fa9eb 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/CoverageUtil.java
@@ -27,8 +27,10 @@ import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.coverage.model.ICoverageItemProvider;
import org.eclipse.osee.coverage.model.ICoverageUnitProvider;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -53,8 +55,12 @@ public class CoverageUtil {
public static boolean getBranchFromUser(boolean force) throws OseeCoreException {
if (force || CoverageUtil.getBranch() == null) {
Collection<Branch> branches = BranchManager.getBranches(BranchArchivedState.UNARCHIVED, BranchType.WORKING);
- if (isAdmin()) {
- branches.add(BranchManager.getBranch("SAW_Bld_1"));
+ if (isAdmin() && !isProductionDb()) {
+ try {
+ branches.add(BranchManager.getBranch("SAW_Bld_1"));
+ } catch (BranchDoesNotExist ex) {
+ // do nothing
+ }
}
BranchSelectionDialog dialog = new BranchSelectionDialog("Select Branch", branches);
if (dialog.open() != 0) {
@@ -65,6 +71,10 @@ public class CoverageUtil {
return true;
}
+ public static boolean isProductionDb() throws OseeCoreException {
+ return ClientSessionManager.isProductionDataStore();
+ }
+
public static CoverageItem getCoverageItemMatchingOrder(Collection<? extends ICoverage> items, CoverageItem coverageItem) {
for (ICoverage coverage : items) {
if (coverage instanceof CoverageItem && ((CoverageItem) coverage).getOrderNumber().equals(

Back to the top