Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2012-05-09 15:27:14 +0000
committerRoberto E. Escobar2012-05-09 15:27:14 +0000
commitbc7e10b04fe79fc4a64356ab3538f351d316e3f4 (patch)
tree826159fe904ff51d055740cca9f33091f07b80d7 /plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote
parent3a3e6b9014c47daf70e4bed84f38f3c350d06417 (diff)
downloadorg.eclipse.osee-bc7e10b04fe79fc4a64356ab3538f351d316e3f4.tar.gz
org.eclipse.osee-bc7e10b04fe79fc4a64356ab3538f351d316e3f4.tar.xz
org.eclipse.osee-bc7e10b04fe79fc4a64356ab3538f351d316e3f4.zip
refactor[ats_6H1JC]: Support for test report to use test out files
Diffstat (limited to 'plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote')
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java344
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java305
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java8
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java4
7 files changed, 384 insertions, 289 deletions
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
new file mode 100644
index 00000000000..03c109b8f20
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * 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.ote.define.artifacts;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Date;
+import java.util.List;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+import org.eclipse.osee.framework.skynet.core.attribute.providers.IAttributeDataProvider;
+import org.eclipse.osee.framework.skynet.core.attribute.providers.MappedAttributeDataProvider;
+import org.eclipse.osee.ote.define.AUTOGEN.OteAttributeTypes;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactTestRunOperator implements TestRunOperator {
+ private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
+ CoreArtifactTypes.TestRun);
+
+ private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
+ CoreArtifactTypes.TestCase);
+
+ private final Artifact artifact;
+
+ public ArtifactTestRunOperator(Artifact artifact) throws OseeArgumentException {
+ checkForNull(artifact);
+ checkForType(artifact);
+ this.artifact = artifact;
+ }
+
+ private void checkForNull(Artifact artifact) throws OseeArgumentException {
+ if (artifact == null) {
+ throw new OseeArgumentException("Artifact was null.");
+ }
+ }
+
+ private void checkForType(Artifact artifact) throws OseeArgumentException {
+ try {
+ if (!artifact.isOfType(CoreArtifactTypes.TestRun)) {
+ throw new OseeArgumentException("Unable to operate on type [%s]. Only [%s] allowed.",
+ artifact.getArtifactTypeName(), CoreArtifactTypes.TestRun);
+ }
+ } catch (OseeCoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static ArtifactTestRunOperator getNewArtifactWithOperator(IOseeBranch branch) throws OseeCoreException {
+ return new ArtifactTestRunOperator(TEST_RUN_ARTIFACT_FETCHER.getNewArtifact(branch));
+ }
+
+ public static OteArtifactFetcher<Artifact> getTestRunFetcher() {
+ return TEST_RUN_ARTIFACT_FETCHER;
+ }
+
+ public static OteArtifactFetcher<Artifact> getTestScriptFetcher() {
+ return TEST_SCRIPT_ARTIFACT_FETCHER;
+ }
+
+ public Artifact getTestRunArtifact() {
+ return artifact;
+ }
+
+ public String getDescriptiveName() {
+ return artifact.getName();
+ }
+
+ @Override
+ public String getScriptRevision() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.REVISION, "");
+ }
+
+ public String getScriptUrl() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.TEST_SCRIPT_URL, "");
+ }
+
+ public void setLastDateUploaded(Date value) throws OseeCoreException {
+ artifact.setSoleAttributeValue(OteAttributeTypes.LAST_DATE_UPLOADED, value);
+ }
+
+ @Override
+ public Date getLastDateUploaded() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.LAST_DATE_UPLOADED, null);
+ }
+
+ public void setChecksum(String value) throws OseeCoreException {
+ artifact.setSoleAttributeValue(OteAttributeTypes.CHECKSUM, value);
+ }
+
+ @Override
+ public String getChecksum() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.CHECKSUM, "");
+ }
+
+ public String getOutfileExtension() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.EXTENSION, "");
+ }
+
+ public void setOutfileExtension(String outfile) throws OseeCoreException {
+ artifact.setSoleAttributeValue(OteAttributeTypes.EXTENSION, outfile);
+ }
+
+ public boolean isFromLocalWorkspace() throws OseeCoreException, AttributeDoesNotExist {
+ return getLastDateUploaded() == null;
+ }
+
+ public void setLocalOutfileURI(String uri) throws OseeCoreException, AttributeDoesNotExist {
+ IAttributeDataProvider provider = getOutfileAttribute().getAttributeDataProvider();
+ if (provider instanceof MappedAttributeDataProvider) {
+ ((MappedAttributeDataProvider) provider).setLocalUri(uri);
+ }
+ }
+
+ @Override
+ public String getOutfileUrl() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.OUTFILE_URL);
+ }
+
+ public String getOutfileContents() throws OseeCoreException {
+ String toReturn = null;
+ try {
+ toReturn = Lib.inputStreamToString(new URI(getOutfileUrl()).toURL().openStream());
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return toReturn;
+ }
+
+ public Attribute<InputStream> getOutfileAttribute() throws AttributeDoesNotExist, OseeCoreException {
+ List<Attribute<InputStream>> attributes = artifact.getAttributes(OteAttributeTypes.OUTFILE_URL);
+ return attributes != null && attributes.size() > 0 ? attributes.get(0) : null;
+ }
+
+ public boolean isScriptRevisionValid() {
+ boolean toReturn = false;
+ try {
+ URI url = new URI(getScriptUrl());
+ if (url != null) {
+ String revision = getScriptRevision();
+ if (Strings.isValid(revision)) {
+ toReturn = true;
+ }
+ }
+ } catch (Exception ex) {
+ }
+ return toReturn;
+ }
+
+ public boolean hasNotBeenCommitted() {
+ Artifact fetched = null;
+ try {
+ fetched =
+ getTestRunFetcher().searchForUniqueArtifactMatching(OteAttributeTypes.CHECKSUM, getChecksum(),
+ artifact.getBranch());
+ } catch (Exception ex) {
+ }
+ return fetched == null;
+ }
+
+ public boolean isCommitAllowed() {
+ return isScriptRevisionValid() && hasNotBeenCommitted();
+ }
+
+ public boolean hasValidArtifact() {
+ return artifact != null && artifact.isDeleted() != true;
+ }
+
+ public void createTestScriptSoftLink() throws OseeCoreException {
+ Artifact testScript =
+ getTestScriptFetcher().searchForUniqueArtifactMatching(CoreAttributeTypes.Name, artifact.getName(),
+ artifact.getBranch());
+ if (testScript != null) {
+ artifact.setSoleAttributeValue(CoreAttributeTypes.TestScriptGuid, testScript.getGuid());
+ }
+ }
+
+ @Override
+ public String getPartition() {
+ String name = artifact.getName();
+ String[] data = name.split("\\.");
+ if (data.length - 3 > 0) {
+ name = data[data.length - 3];
+ }
+ return name;
+ }
+
+ @Override
+ public String getSubsystem() {
+ String name = artifact.getName();
+ String[] data = name.split("\\.");
+ if (data.length - 2 > 0) {
+ name = data[data.length - 2];
+ }
+ return name;
+ }
+
+ @Override
+ public int getTestPointsPassed() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.PASSED);
+ }
+
+ @Override
+ public int getTestPointsFailed() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.FAILED);
+ }
+
+ @Override
+ public int getTotalTestPoints() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.TOTAL_TEST_POINTS);
+ }
+
+ @Override
+ public Date getEndDate() throws OseeCoreException {
+ return processDateAttribute(OteAttributeTypes.END_DATE);
+ }
+
+ @Override
+ public Date getLastModifiedDate() throws OseeCoreException {
+ return processDateAttribute(OteAttributeTypes.LAST_MODIFIED_DATE);
+ }
+
+ @Override
+ public Date getTestStartDate() throws OseeCoreException {
+ return processDateAttribute(OteAttributeTypes.START_DATE);
+ }
+
+ private Date processDateAttribute(IAttributeType attributeType) throws OseeCoreException {
+ Date date = artifact.getSoleAttributeValue(attributeType, null);
+ if (date == null) {
+ date = new Date(0);
+ }
+ return date;
+ }
+
+ public boolean wasAborted() {
+ boolean toReturn = true;
+ try {
+ toReturn = artifact.getSoleAttributeValue(OteAttributeTypes.SCRIPT_ABORTED, false);
+ } catch (Exception ex) {
+ }
+ return toReturn;
+ }
+
+ @Override
+ public String getTestResultStatus() throws OseeCoreException {
+ String result = "FAILED";
+ if (wasAborted() != true) {
+ int total = getTotalTestPoints();
+ if (total > 0) {
+ if (getTestPointsFailed() <= 0) {
+ int passed = getTestPointsPassed();
+ if (passed == total) {
+ result = "PASSED";
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public boolean isBatchModeAllowed() {
+ boolean toReturn = false;
+ try {
+ toReturn = artifact.getSoleAttributeValue(OteAttributeTypes.IS_BATCH_MODE_ALLOWED, false);
+ } catch (Exception ex) {
+ }
+ return toReturn;
+ }
+
+ @Override
+ public String getOseeVersion() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_VERSION, "").trim();
+ }
+
+ @Override
+ public String getOseeServerTitle() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_SERVER_TITLE, "").trim();
+ }
+
+ @Override
+ public String getOseeServerVersion() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_SERVER_JAR_VERSION, "").trim();
+ }
+
+ @Override
+ public String getProcessorId() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.PROCESSOR_ID, "");
+ }
+
+ @Override
+ public String getRunDuration() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.ELAPSED_DATE, "");
+ }
+
+ @Override
+ public String getQualificationLevel() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.QUALIFICATION_LEVEL, "");
+ }
+
+ @Override
+ public String getBuildId() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.BUILD_ID, "");
+ }
+
+ @Override
+ public String getRanOnOperatingSystem() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.OS_NAME, "");
+ }
+
+ @Override
+ public String getLastAuthor() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(OteAttributeTypes.LAST_AUTHOR, null);
+ }
+
+ @Override
+ public String getScriptSimpleName() {
+ String rawName = getDescriptiveName();
+ String[] qualifiers = rawName.split("\\.");
+ return qualifiers[qualifiers.length - 1];
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java
index d6be65ba6c2..bb3cf95f0c3 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/TestRunOperator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * Copyright (c) 2012 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
@@ -8,313 +8,64 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-
package org.eclipse.osee.ote.define.artifacts;
-import java.io.InputStream;
-import java.net.URI;
import java.util.Date;
-import java.util.List;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.attribute.providers.IAttributeDataProvider;
-import org.eclipse.osee.framework.skynet.core.attribute.providers.MappedAttributeDataProvider;
-import org.eclipse.osee.ote.define.AUTOGEN.OteAttributeTypes;
/**
- * @author Roberto E. Escobar
+ * @author John Misinco
*/
-public class TestRunOperator {
- private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
- CoreArtifactTypes.TestRun);
-
- private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
- CoreArtifactTypes.TestCase);
-
- private final Artifact artifact;
-
- public TestRunOperator(Artifact artifact) throws OseeArgumentException {
- checkForNull(artifact);
- checkForType(artifact);
- this.artifact = artifact;
- }
-
- private void checkForNull(Artifact artifact) throws OseeArgumentException {
- if (artifact == null) {
- throw new OseeArgumentException("Artifact was null.");
- }
- }
-
- private void checkForType(Artifact artifact) throws OseeArgumentException {
- try {
- if (!artifact.isOfType(CoreArtifactTypes.TestRun)) {
- throw new OseeArgumentException("Unable to operate on type [%s]. Only [%s] allowed.",
- artifact.getArtifactTypeName(), CoreArtifactTypes.TestRun);
- }
- } catch (OseeCoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public static TestRunOperator getNewArtifactWithOperator(IOseeBranch branch) throws OseeCoreException {
- return new TestRunOperator(TEST_RUN_ARTIFACT_FETCHER.getNewArtifact(branch));
- }
-
- public static OteArtifactFetcher<Artifact> getTestRunFetcher() {
- return TEST_RUN_ARTIFACT_FETCHER;
- }
-
- public static OteArtifactFetcher<Artifact> getTestScriptFetcher() {
- return TEST_SCRIPT_ARTIFACT_FETCHER;
- }
-
- public Artifact getTestRunArtifact() {
- return artifact;
- }
-
- public String getDescriptiveName() {
- return artifact.getName();
- }
-
- public String getScriptRevision() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.REVISION, "");
- }
-
- public String getScriptUrl() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.TEST_SCRIPT_URL, "");
- }
-
- public void setLastDateUploaded(Date value) throws OseeCoreException {
- artifact.setSoleAttributeValue(OteAttributeTypes.LAST_DATE_UPLOADED, value);
- }
-
- public Date getLastDateUploaded() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.LAST_DATE_UPLOADED, null);
- }
-
- public void setChecksum(String value) throws OseeCoreException {
- artifact.setSoleAttributeValue(OteAttributeTypes.CHECKSUM, value);
- }
-
- public String getChecksum() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.CHECKSUM, "");
- }
-
- public String getOutfileExtension() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.EXTENSION, "");
- }
-
- public void setOutfileExtension(String outfile) throws OseeCoreException {
- artifact.setSoleAttributeValue(OteAttributeTypes.EXTENSION, outfile);
- }
-
- public boolean isFromLocalWorkspace() throws OseeCoreException, AttributeDoesNotExist {
- return getLastDateUploaded() == null;
- }
-
- public void setLocalOutfileURI(String uri) throws OseeCoreException, AttributeDoesNotExist {
- IAttributeDataProvider provider = getOutfileAttribute().getAttributeDataProvider();
- if (provider instanceof MappedAttributeDataProvider) {
- ((MappedAttributeDataProvider) provider).setLocalUri(uri);
- }
- }
-
- public String getOutfileUrl() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.OUTFILE_URL);
- }
-
- public String getOutfileContents() throws OseeCoreException {
- String toReturn = null;
- try {
- toReturn = Lib.inputStreamToString(new URI(getOutfileUrl()).toURL().openStream());
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return toReturn;
- }
-
- public Attribute<InputStream> getOutfileAttribute() throws AttributeDoesNotExist, OseeCoreException {
- List<Attribute<InputStream>> attributes = artifact.getAttributes(OteAttributeTypes.OUTFILE_URL);
- return attributes != null && attributes.size() > 0 ? attributes.get(0) : null;
- }
-
- public boolean isScriptRevisionValid() {
- boolean toReturn = false;
- try {
- URI url = new URI(getScriptUrl());
- if (url != null) {
- String revision = getScriptRevision();
- if (Strings.isValid(revision)) {
- toReturn = true;
- }
- }
- } catch (Exception ex) {
- }
- return toReturn;
- }
+public interface TestRunOperator {
- public boolean hasNotBeenCommitted() {
- Artifact fetched = null;
- try {
- fetched =
- getTestRunFetcher().searchForUniqueArtifactMatching(OteAttributeTypes.CHECKSUM, getChecksum(),
- artifact.getBranch());
- } catch (Exception ex) {
- }
- return fetched == null;
- }
+ public abstract String getScriptRevision() throws OseeCoreException;
- public boolean isCommitAllowed() {
- return isScriptRevisionValid() && hasNotBeenCommitted();
- }
+ public abstract Date getLastDateUploaded() throws OseeCoreException;
- public boolean hasValidArtifact() {
- return artifact != null && artifact.isDeleted() != true;
- }
+ public abstract String getChecksum() throws OseeCoreException;
- public void createTestScriptSoftLink() throws OseeCoreException {
- Artifact testScript =
- getTestScriptFetcher().searchForUniqueArtifactMatching(CoreAttributeTypes.Name, artifact.getName(),
- artifact.getBranch());
- if (testScript != null) {
- artifact.setSoleAttributeValue(CoreAttributeTypes.TestScriptGuid, testScript.getGuid());
- }
- }
+ public abstract String getOutfileUrl() throws OseeCoreException;
- public String getPartition() {
- String name = artifact.getName();
- String[] data = name.split("\\.");
- if (data.length - 3 > 0) {
- name = data[data.length - 3];
- }
- return name;
- }
+ public abstract String getPartition();
- public String getSubsystem() {
- String name = artifact.getName();
- String[] data = name.split("\\.");
- if (data.length - 2 > 0) {
- name = data[data.length - 2];
- }
- return name;
- }
+ public abstract String getSubsystem();
- public int getTestPointsPassed() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.PASSED);
- }
+ public abstract int getTestPointsPassed() throws OseeCoreException;
- public int getTestPointsFailed() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.FAILED);
- }
+ public abstract int getTestPointsFailed() throws OseeCoreException;
- public int getTotalTestPoints() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.TOTAL_TEST_POINTS);
- }
+ public abstract int getTotalTestPoints() throws OseeCoreException;
- public Date getEndDate() throws OseeCoreException {
- return processDateAttribute(OteAttributeTypes.END_DATE);
- }
+ public abstract Date getEndDate() throws OseeCoreException;
- public Date getLastModifiedDate() throws OseeCoreException {
- return processDateAttribute(OteAttributeTypes.LAST_MODIFIED_DATE);
- }
+ public abstract Date getLastModifiedDate() throws OseeCoreException;
- public Date getTestStartDate() throws OseeCoreException {
- return processDateAttribute(OteAttributeTypes.START_DATE);
- }
+ public abstract Date getTestStartDate() throws OseeCoreException;
- private Date processDateAttribute(IAttributeType attributeType) throws OseeCoreException {
- Date date = artifact.getSoleAttributeValue(attributeType, null);
- if (date == null) {
- date = new Date(0);
- }
- return date;
- }
+ public abstract String getTestResultStatus() throws OseeCoreException;
- public boolean wasAborted() {
- boolean toReturn = true;
- try {
- toReturn = artifact.getSoleAttributeValue(OteAttributeTypes.SCRIPT_ABORTED, false);
- } catch (Exception ex) {
- }
- return toReturn;
- }
+ public abstract boolean isBatchModeAllowed();
- public String getTestResultStatus() throws OseeCoreException {
- String result = "FAILED";
- if (wasAborted() != true) {
- int total = getTotalTestPoints();
- if (total > 0) {
- if (getTestPointsFailed() <= 0) {
- int passed = getTestPointsPassed();
- if (passed == total) {
- result = "PASSED";
- }
- }
- }
- }
- return result;
- }
+ public abstract String getOseeVersion() throws OseeCoreException;
- public boolean isBatchModeAllowed() {
- boolean toReturn = false;
- try {
- toReturn = artifact.getSoleAttributeValue(OteAttributeTypes.IS_BATCH_MODE_ALLOWED, false);
- } catch (Exception ex) {
- }
- return toReturn;
- }
+ public abstract String getOseeServerTitle() throws OseeCoreException;
- public String getOseeVersion() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_VERSION, "").trim();
- }
+ public abstract String getOseeServerVersion() throws OseeCoreException;
- public String getOseeServerTitle() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_SERVER_TITLE, "").trim();
- }
+ public abstract String getProcessorId() throws OseeCoreException;
- public String getOseeServerVersion() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.OSEE_SERVER_JAR_VERSION, "").trim();
- }
+ public abstract String getRunDuration() throws OseeCoreException;
- public String getProcessorId() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.PROCESSOR_ID, "");
- }
+ public abstract String getQualificationLevel() throws OseeCoreException;
- public String getRunDuration() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.ELAPSED_DATE, "");
- }
+ public abstract String getBuildId() throws OseeCoreException;
- public String getQualificationLevel() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.QUALIFICATION_LEVEL, "");
- }
+ public abstract String getRanOnOperatingSystem() throws OseeCoreException;
- public String getBuildId() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.BUILD_ID, "");
- }
+ public abstract String getLastAuthor() throws OseeCoreException;
- public String getRanOnOperatingSystem() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.OS_NAME, "");
- }
+ public abstract String getScriptSimpleName();
- public String getLastAuthor() throws OseeCoreException {
- return artifact.getSoleAttributeValue(OteAttributeTypes.LAST_AUTHOR, null);
- }
+ public abstract boolean wasAborted();
- public String getScriptSimpleName() {
- String rawName = getDescriptiveName();
- String[] qualifiers = rawName.split("\\.");
- return qualifiers[qualifiers.length - 1];
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
index 97b17c9b7fd..5b601d472e6 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
@@ -27,7 +27,7 @@ import org.eclipse.osee.framework.core.threading.ThreadedWorkerFactory;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.ote.define.OteDefinePlugin;
-import org.eclipse.osee.ote.define.artifacts.TestRunOperator;
+import org.eclipse.osee.ote.define.artifacts.ArtifactTestRunOperator;
/**
* @author Roberto E. Escobar
@@ -115,7 +115,7 @@ public class FindCommitableJob extends Job {
public Object call() throws Exception {
for (Artifact artifact : artifactsToSort) {
try {
- TestRunOperator operator = new TestRunOperator(artifact);
+ ArtifactTestRunOperator operator = new ArtifactTestRunOperator(artifact);
if (operator.isCommitAllowed() == true) {
synchronized (commitable) {
commitable.add(artifact);
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
index d66f28bbc26..03780009715 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
@@ -27,7 +27,7 @@ import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
-import org.eclipse.osee.ote.define.artifacts.TestRunOperator;
+import org.eclipse.osee.ote.define.artifacts.ArtifactTestRunOperator;
import org.eclipse.osee.ote.define.jobs.FindCommitableJob;
import org.eclipse.osee.ote.define.jobs.OutfileToArtifactJob;
@@ -137,7 +137,7 @@ public class ImportOutfileOperation {
for (Artifact artifact : artifacts) {
monitor.subTask(String.format("Persisting: [%s] ", artifact.getName()));
- TestRunOperator operator = new TestRunOperator(artifact);
+ ArtifactTestRunOperator operator = new ArtifactTestRunOperator(artifact);
operator.setLastDateUploaded(uploadDate);
if (monitor.isCanceled() != false) {
break;
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
index 73d2bb841f7..fd280168e95 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.threading.ThreadedWorkerExecutor;
import org.eclipse.osee.framework.core.threading.ThreadedWorkerFactory;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.ote.define.artifacts.TestRunOperator;
+import org.eclipse.osee.ote.define.artifacts.ArtifactTestRunOperator;
/**
* @author Roberto E. Escobar
@@ -88,7 +88,7 @@ public class LinkTestRunToTestScriptOperation {
monitor.subTask(String.format("Linking [%s] [%s of %s] ", testRun.getName(), count.incrementAndGet(),
totalSize));
- TestRunOperator operator = new TestRunOperator(testRun);
+ ArtifactTestRunOperator operator = new ArtifactTestRunOperator(testRun);
try {
operator.createTestScriptSoftLink();
synchronized (linked) {
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
index 82fb3b5e68d..a08b194cb6f 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
@@ -29,7 +29,7 @@ import org.eclipse.osee.framework.jdk.core.util.ChecksumUtil;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.ote.define.artifacts.TestRunOperator;
+import org.eclipse.osee.ote.define.artifacts.ArtifactTestRunOperator;
import org.eclipse.osee.ote.define.parser.BaseOutfileParser;
import org.eclipse.osee.ote.define.utilities.OutfileDataCollector;
import org.eclipse.osee.ote.define.utilities.OutfileParserExtensionManager;
@@ -89,7 +89,7 @@ public class OutfileToArtifactOperation {
return scriptFolder;
}
- private void addChecksum(TestRunOperator operator, URL targetURL) throws Exception {
+ private void addChecksum(ArtifactTestRunOperator operator, URL targetURL) throws Exception {
InputStream inputStream = null;
try {
inputStream = targetURL.openStream();
@@ -136,9 +136,9 @@ public class OutfileToArtifactOperation {
@Override
public Object call() throws Exception {
for (URI targetUri : filesToImport) {
- TestRunOperator operator = null;
+ ArtifactTestRunOperator operator = null;
try {
- operator = TestRunOperator.getNewArtifactWithOperator(branch);
+ operator = ArtifactTestRunOperator.getNewArtifactWithOperator(branch);
OutfileDataCollector collector = getOutfileData(monitor, targetUri.toURL());
collector.populate(operator.getTestRunArtifact(), parent);
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
index 6499f70a7db..1a133361c4d 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
@@ -28,9 +28,9 @@ import org.eclipse.osee.ote.define.parser.IDataListener;
* @author Roberto E. Escobar
*/
public class OutfileDataCollector implements IDataListener {
- private static final OteToAttributeMap oteToAttributeMap = OteToAttributeMap.getInstance();
+ protected static final OteToAttributeMap oteToAttributeMap = OteToAttributeMap.getInstance();
- private final Map<String, String> collectedData;
+ protected final Map<String, String> collectedData;
public OutfileDataCollector() {
this.collectedData = new HashMap<String, String>();

Back to the top