summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-04-20 18:43:08 (EDT)
committerRyan D. Brooks2011-04-20 18:43:08 (EDT)
commit1f23671688cd5b3ca1bac6630f602ffade134c06 (patch)
tree81ca41bcf78a1f0d68077162caae59deb6303065
parent43dfc2d24b75160039bd5b0ad3c3a837bd5f1bbe (diff)
downloadorg.eclipse.osee-1f23671688cd5b3ca1bac6630f602ffade134c06.zip
org.eclipse.osee-1f23671688cd5b3ca1bac6630f602ffade134c06.tar.gz
org.eclipse.osee-1f23671688cd5b3ca1bac6630f602ffade134c06.tar.bz2
bug[bgz_343293]: Fix import trace units throwing an exception
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/build.properties1
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/plugin.xml9
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceParser.java47
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceUnitResourceLocator.java60
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.define.test/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.define.test/build.properties3
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/AllDefineTestSuite.java7
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/BlamTestSuite.java (renamed from plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/BlamTestSuite.java)2
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/TestPlanComplianceReportTest.java (renamed from plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/TestPlanComplianceReportTest.java)2
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/ImportTraceUnitsOperationTest.java133
-rw-r--r--plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/JobsTestSuite.java23
-rw-r--r--plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF15
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java3
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java12
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java (renamed from plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/jobs/ImportTraceUnitsJob.java)42
17 files changed, 313 insertions, 59 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.config.demo/META-INF/MANIFEST.MF
index adc64fe..2abbf77 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.config.demo/META-INF/MANIFEST.MF
@@ -17,7 +17,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.osee.framework.ui.plugin,
org.eclipse.ui.forms
Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.osee.framework.core.client,
+Import-Package: org.eclipse.core.filesystem,
+ org.eclipse.osee.define.traceability,
+ org.eclipse.osee.define.traceability.data,
+ org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
diff --git a/plugins/org.eclipse.osee.ats.config.demo/build.properties b/plugins/org.eclipse.osee.ats.config.demo/build.properties
index b9fd875..ec770a0 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/build.properties
+++ b/plugins/org.eclipse.osee.ats.config.demo/build.properties
@@ -5,3 +5,4 @@ bin.includes = META-INF/,\
plugin.xml,\
support/,\
images/
+additional.bundles = org.eclipse.core.filesystem
diff --git a/plugins/org.eclipse.osee.ats.config.demo/plugin.xml b/plugins/org.eclipse.osee.ats.config.demo/plugin.xml
index eca129e..daaba29 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/plugin.xml
+++ b/plugins/org.eclipse.osee.ats.config.demo/plugin.xml
@@ -60,5 +60,14 @@
class="org.eclipse.osee.ats.config.demo.artifact.DemoArtifactImageProvider">
</ArtifactImageProvider>
</extension>
+ <extension
+ id="DemoTraceUnitHandler"
+ name="DemoTraceUnitHandler"
+ point="org.eclipse.osee.define.TraceUnitHandler">
+ <TraceUnitHandler
+ TraceUnitParser="org.eclipse.osee.ats.config.demo.traceability.DemoTraceParser"
+ TraceUnitResourceLocator="org.eclipse.osee.ats.config.demo.traceability.DemoTraceUnitResourceLocator">
+ </TraceUnitHandler>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceParser.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceParser.java
new file mode 100644
index 0000000..8fd71dd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceParser.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.config.demo.traceability;
+
+import java.nio.CharBuffer;
+import java.util.Collection;
+import java.util.HashSet;
+import org.eclipse.osee.define.traceability.ITraceParser;
+import org.eclipse.osee.define.traceability.data.TraceMark;
+
+/**
+ * @author John Misinco
+ */
+public class DemoTraceParser implements ITraceParser {
+
+ @Override
+ public Collection<TraceMark> getTraceMarks(CharBuffer fileBuffer) {
+ Collection<TraceMark> traceMarks = new HashSet<TraceMark>();
+ String type = "Uses";
+ traceMarks.add(new TraceMark(type, "Collaborative Robot"));
+ traceMarks.add(new TraceMark(type, "Robot Object"));
+ traceMarks.add(new TraceMark(type, "Robot Interfaces"));
+ traceMarks.add(new TraceMark(type, "Individual robot events"));
+ traceMarks.add(new TraceMark(type, "Haptic Constraints"));
+
+ return traceMarks;
+ }
+
+ @Override
+ public CharBuffer removeTraceMarks(CharBuffer fileBuffer) {
+ return fileBuffer;
+ }
+
+ @Override
+ public boolean isTraceRemovalAllowed() {
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceUnitResourceLocator.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceUnitResourceLocator.java
new file mode 100644
index 0000000..b642c65
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/traceability/DemoTraceUnitResourceLocator.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.config.demo.traceability;
+
+import java.nio.CharBuffer;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.osee.define.traceability.ITraceUnitResourceLocator;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+
+/**
+ * @author John Misinco
+ */
+public class DemoTraceUnitResourceLocator implements ITraceUnitResourceLocator {
+
+ @Override
+ public boolean isValidDirectory(IFileStore fileStore) {
+ boolean isValid = false;
+ String name = fileStore.getName();
+ if (Strings.isValid(name) && fileStore.fetchInfo().isDirectory()) {
+ isValid = !name.startsWith(".");
+ }
+ return isValid;
+ }
+
+ @Override
+ public boolean isValidFile(IFileStore fileStore) {
+ boolean isValid = false;
+ String name = fileStore.getName();
+ if (Strings.isValid(name) && !fileStore.fetchInfo().isDirectory()) {
+ isValid = true;
+ }
+ return isValid;
+ }
+
+ @Override
+ public boolean hasValidContent(CharBuffer fileBuffer) {
+ return fileBuffer != null && fileBuffer.length() > 0;
+ }
+
+ @Override
+ public String getIdentifier(IFileStore fileStore, CharBuffer fileBuffer) throws Exception {
+ return fileStore.getName();
+ }
+
+ @Override
+ public IArtifactType getTraceUnitType(String name, CharBuffer fileBuffer) {
+ return CoreArtifactTypes.CodeUnit;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
index 77a173c..cda20cb 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
@@ -22,7 +22,6 @@ Import-Package: org.eclipse.core.runtime,
org.eclipse.osee.coverage.test.model,
org.eclipse.osee.coverage.test.navigate,
org.eclipse.osee.define.test,
- org.eclipse.osee.define.test.blam,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.message.test,
diff --git a/plugins/org.eclipse.osee.define.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define.test/META-INF/MANIFEST.MF
index da0f78e..b9af87c 100644
--- a/plugins/org.eclipse.osee.define.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define.test/META-INF/MANIFEST.MF
@@ -8,5 +8,8 @@ Fragment-Host: org.eclipse.osee.define
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4
Export-Package: org.eclipse.osee.define.test,
- org.eclipse.osee.define.test.blam
-Import-Package: org.eclipse.osee.support.test.util
+ org.eclipse.osee.define.test.blam.operation
+Import-Package: org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.database.core,
+ org.eclipse.osee.framework.skynet.core.artifact,
+ org.eclipse.osee.support.test.util
diff --git a/plugins/org.eclipse.osee.define.test/build.properties b/plugins/org.eclipse.osee.define.test/build.properties
index 34d2e4d..597a1cc 100644
--- a/plugins/org.eclipse.osee.define.test/build.properties
+++ b/plugins/org.eclipse.osee.define.test/build.properties
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ build.properties
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/AllDefineTestSuite.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/AllDefineTestSuite.java
index aa2d137..32e1ec9 100644
--- a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/AllDefineTestSuite.java
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/AllDefineTestSuite.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.define.test;
-import org.eclipse.osee.define.test.blam.BlamTestSuite;
+import org.eclipse.osee.define.test.blam.operation.BlamTestSuite;
+import org.eclipse.osee.define.test.jobs.JobsTestSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({BlamTestSuite.class})
+@Suite.SuiteClasses({BlamTestSuite.class, JobsTestSuite.class})
public final class AllDefineTestSuite {
- //
+ // Tests added above
}
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/BlamTestSuite.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/BlamTestSuite.java
index 038eab1..1aad269 100644
--- a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/BlamTestSuite.java
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/BlamTestSuite.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.define.test.blam;
+package org.eclipse.osee.define.test.blam.operation;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/TestPlanComplianceReportTest.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/TestPlanComplianceReportTest.java
index e8ac26a..9aaab43 100644
--- a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/TestPlanComplianceReportTest.java
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/blam/operation/TestPlanComplianceReportTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.define.test.blam;
+package org.eclipse.osee.define.test.blam.operation;
import java.io.StringWriter;
import java.util.ArrayList;
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/ImportTraceUnitsOperationTest.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/ImportTraceUnitsOperationTest.java
new file mode 100644
index 0000000..3a44b7e
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/ImportTraceUnitsOperationTest.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.define.test.jobs;
+
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.define.traceability.operations.ImportTraceUnitsOperation;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.OseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.jdk.core.util.Compare;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+/**
+ * @author John Misinco
+ */
+public final class ImportTraceUnitsOperationTest {
+
+ private static final String TEST_ONE_FILE = "ImportTraceUnitsTest1.txt";
+ private static final String TEST_TWO_FILE = "ImportTraceUnitsTest2.txt";
+ private static final IOseeBranch TEST_BRANCH = new OseeBranch("Trace Unit Branch", "BIkSWxVrZClFHss6FTAA");
+ private static final int RUNS = 3;
+
+ private Branch importToBranch;
+
+ @Rule
+ public final TemporaryFolder tempFolder = new TemporaryFolder();
+
+ private URI getMockFile(String fileName, String text) throws Exception {
+ File testFile = tempFolder.newFile(fileName);
+ Lib.writeStringToFile(text, testFile);
+ return testFile.toURI();
+ }
+
+ @Before
+ public void setup() throws OseeCoreException {
+ if (BranchManager.branchExists(TEST_BRANCH)) {
+ Branch branch = BranchManager.getBranch(TEST_BRANCH);
+ BranchManager.purgeBranch(branch);
+ }
+ Branch baseBranch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_2);
+ importToBranch = BranchManager.createWorkingBranch(baseBranch, TEST_BRANCH, UserManager.getUser());
+ }
+
+ @After
+ public void tearDown() throws OseeCoreException {
+ BranchManager.purgeBranch(importToBranch);
+ }
+
+ private void runOperation(URI file) {
+ boolean isRecursive = false;
+ boolean isPersistChanges = true;
+ String[] traceUnitHandlerIds = {"org.eclipse.osee.ats.config.demo.DemoTraceUnitHandler"};
+ boolean fileWithMultiPaths = false;
+
+ IOperation op =
+ new ImportTraceUnitsOperation("Import Trace Units", importToBranch, file, isRecursive, isPersistChanges,
+ fileWithMultiPaths, traceUnitHandlerIds);
+ Operations.executeWork(op);
+ }
+
+ @Test
+ public void testImportTraceUnitsJob() throws Exception {
+ URI mockURI1 = getMockFile(TEST_ONE_FILE, "some text");
+ URI mockURI2 = getMockFile(TEST_TWO_FILE, "some text");
+
+ ArrayList<Integer> gammas = new ArrayList<Integer>(RUNS);
+
+ for (int i = 0; i < RUNS; i++) {
+ runOperation(mockURI1);
+
+ Artifact artifact =
+ ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.CodeUnit, TEST_ONE_FILE, importToBranch);
+ Assert.assertNotNull(artifact);
+
+ Integer gamma = artifact.getGammaId();
+ if (!gammas.contains(gamma)) {
+ gammas.add(gamma);
+ }
+
+ Assert.assertEquals("Code Units", artifact.getParent().getName());
+
+ List<Artifact> reqArtifacts = artifact.getRelatedArtifacts(CoreRelationTypes.CodeRequirement_Requirement);
+ Assert.assertEquals(5, reqArtifacts.size());
+
+ Collection<String> actual = Artifacts.artNames(reqArtifacts);
+ List<String> expected =
+ Arrays.asList("Robot Object", "Haptic Constraints", "Robot Interfaces", "Individual robot events",
+ "Collaborative Robot");
+ Assert.assertFalse(Compare.isDifferent(expected, actual));
+ }
+ // make sure multiple artifacts were not created
+ Assert.assertEquals(1, gammas.size());
+
+ // create a 2nd artifact
+ runOperation(mockURI2);
+ Artifact artifact =
+ ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.CodeUnit, TEST_TWO_FILE, importToBranch);
+ Assert.assertNotNull(artifact);
+ // make sure a new artifact was created
+ Assert.assertFalse(gammas.contains(artifact.getGammaId()));
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/JobsTestSuite.java b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/JobsTestSuite.java
new file mode 100644
index 0000000..9ec54c6
--- /dev/null
+++ b/plugins/org.eclipse.osee.define.test/src/org/eclipse/osee/define/test/jobs/JobsTestSuite.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.define.test.jobs;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ImportTraceUnitsOperationTest.class})
+/**
+ * @author John Misinco
+ */
+public class JobsTestSuite {
+ // Tests added above
+}
diff --git a/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
index 283dee9..d2ed1a5 100644
--- a/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
@@ -31,16 +31,11 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.search,
org.eclipse.osee.framework.plugin.core,
org.eclipse.osee.framework.ui.plugin,
- org.eclipse.osee.framework.database,
- org.eclipse.ui.forms,
- org.eclipse.osee.framework.messaging.event.skynet,
- org.eclipse.osee.framework.jini,
org.eclipse.nebula.widgets.xviewer,
org.eclipse.osee.framework.help.ui
Bundle-ActivationPolicy: lazy
Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.access,
- org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
@@ -52,13 +47,10 @@ Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.skynet.core.artifact,
org.eclipse.osee.framework.skynet.core.artifact.search,
org.eclipse.osee.framework.skynet.core.attribute,
- org.eclipse.osee.framework.skynet.core.change,
org.eclipse.osee.framework.skynet.core.importing,
org.eclipse.osee.framework.skynet.core.linking,
org.eclipse.osee.framework.skynet.core.relation,
- org.eclipse.osee.framework.skynet.core.relation.order,
org.eclipse.osee.framework.skynet.core.transaction,
- org.eclipse.osee.framework.skynet.core.types,
org.eclipse.osee.framework.skynet.core.utility,
org.eclipse.osee.framework.skynet.core.word,
org.eclipse.osee.framework.ui.skynet,
@@ -67,21 +59,18 @@ Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.ui.skynet.artifact.editor,
org.eclipse.osee.framework.ui.skynet.blam,
org.eclipse.osee.framework.ui.skynet.branch,
- org.eclipse.osee.framework.ui.skynet.cm,
org.eclipse.osee.framework.ui.skynet.commandHandlers,
org.eclipse.osee.framework.ui.skynet.render,
org.eclipse.osee.framework.ui.skynet.results,
org.eclipse.osee.framework.ui.skynet.results.html,
org.eclipse.osee.framework.ui.skynet.results.table,
org.eclipse.osee.framework.ui.skynet.search,
- org.eclipse.osee.framework.ui.skynet.skywalker,
org.eclipse.osee.framework.ui.skynet.skywalker.arttype,
org.eclipse.osee.framework.ui.skynet.templates,
org.eclipse.osee.framework.ui.skynet.util,
- org.eclipse.osee.framework.ui.skynet.widgets,
org.eclipse.osee.framework.ui.skynet.widgets.xBranch,
org.eclipse.osee.framework.ui.skynet.widgets.xHistory,
- org.eclipse.osee.framework.ui.skynet.widgets.xnavigate,
org.eclipse.osee.framework.ui.swt,
- org.eclipse.osee.framework.ui.ws
+ org.eclipse.osee.framework.ui.ws,
+ org.eclipse.ui.forms.editor
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java
index 7cf5dff..33e443b 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitPage.java
@@ -28,7 +28,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.define.DefinePlugin;
import org.eclipse.osee.define.traceability.TraceUnitExtensionManager;
import org.eclipse.osee.define.traceability.TraceUnitExtensionManager.TraceHandler;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -374,7 +373,7 @@ public class ImportTraceUnitPage extends WizardDataTransferPage {
branchSelectComposite.setSelected(branch);
}
}
- } catch (OseeCoreException ex) {
+ } catch (Exception ex) {
// Do Nothing
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java
index cbe6383..d15e63a 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/importer/ImportTraceUnitWizard.java
@@ -11,15 +11,15 @@
package org.eclipse.osee.define.traceability.importer;
import java.net.URI;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osee.define.DefinePlugin;
-import org.eclipse.osee.define.traceability.jobs.ImportTraceUnitsJob;
+import org.eclipse.osee.define.traceability.operations.ImportTraceUnitsOperation;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
@@ -46,10 +46,10 @@ public class ImportTraceUnitWizard extends Wizard implements IImportWizard {
String[] traceUnitHandlerIds = page.getTraceUnitHandlerIds();
boolean fileWithMultiPaths = page.isFileContainingMultiplePaths();
- Job job =
- new ImportTraceUnitsJob("Import Trace Units", importToBranch, source, isRecursive, isPersistChanges,
+ IOperation op =
+ new ImportTraceUnitsOperation("Import Trace Units", importToBranch, source, isRecursive, isPersistChanges,
fileWithMultiPaths, traceUnitHandlerIds);
- Jobs.startJob(job, true);
+ Operations.executeAsJob(op, true);
page.saveWidgetValues();
} catch (Exception ex) {
OseeLog.log(DefinePlugin.class, OseeLevel.SEVERE_POPUP, "Import Trace Unit Error", ex);
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/jobs/ImportTraceUnitsJob.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java
index 5d1616e..11956a9 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/jobs/ImportTraceUnitsJob.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/ImportTraceUnitsOperation.java
@@ -8,24 +8,22 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.define.traceability.jobs;
+package org.eclipse.osee.define.traceability.operations;
import java.net.URI;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osee.define.DefinePlugin;
-import org.eclipse.osee.define.traceability.operations.TraceUnitFromResourceOperation;
+import org.eclipse.nebula.widgets.xviewer.Activator;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
/**
* @author Roberto E. Escobar
*/
-public class ImportTraceUnitsJob extends Job {
+public class ImportTraceUnitsOperation extends AbstractOperation {
private final Branch importToBranch;
private final boolean isRecursive;
private final boolean isPersistChanges;
@@ -33,8 +31,8 @@ public class ImportTraceUnitsJob extends Job {
private final URI source;
private final String[] traceTypeIds;
- public ImportTraceUnitsJob(String jobName, Branch importToBranch, URI source, boolean isRecursive, boolean isPersistChanges, boolean fileWithMultiPaths, String... traceHandlerIds) {
- super(jobName);
+ public ImportTraceUnitsOperation(String jobName, Branch importToBranch, URI source, boolean isRecursive, boolean isPersistChanges, boolean fileWithMultiPaths, String... traceHandlerIds) {
+ super("ImportTraceUnitsOperation", Activator.PLUGIN_ID);
this.importToBranch = importToBranch;
this.source = source;
this.isRecursive = isRecursive;
@@ -49,26 +47,14 @@ public class ImportTraceUnitsJob extends Job {
}
@Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.CANCEL_STATUS;
- try {
- monitor.beginTask(getName(), Integer.MAX_VALUE);
- if (isPersistChanges) {
- TraceUnitFromResourceOperation.importTraceFromTestUnits(monitor, source, isRecursive, fileWithMultiPaths,
- importToBranch, traceTypeIds);
- } else {
- TraceUnitFromResourceOperation.printTraceFromTestUnits(monitor, source, isRecursive, fileWithMultiPaths,
- traceTypeIds);
- }
- if (!monitor.isCanceled()) {
- status = Status.OK_STATUS;
- }
- } catch (Exception ex) {
- status = new Status(IStatus.ERROR, DefinePlugin.PLUGIN_ID, "", ex);
- } finally {
- monitor.done();
+ protected void doWork(IProgressMonitor monitor) throws OseeCoreException {
+ if (isPersistChanges) {
+ TraceUnitFromResourceOperation.importTraceFromTestUnits(monitor, source, isRecursive, fileWithMultiPaths,
+ importToBranch, traceTypeIds);
+ } else {
+ TraceUnitFromResourceOperation.printTraceFromTestUnits(monitor, source, isRecursive, fileWithMultiPaths,
+ traceTypeIds);
}
- return status;
}
}