diff options
Diffstat (limited to 'org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework')
154 files changed, 6320 insertions, 0 deletions
diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseCommandContextFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseCommandContextFactory.java new file mode 100644 index 000000000..b2eb2f9b1 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseCommandContextFactory.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.command.ITestContext; +import org.eclipse.osee.ote.core.framework.command.ITestServerCommand; + +public class BaseCommandContextFactory implements ICommandContextFactory { + @Override + public ITestContext getContext(final TestEnvironment testEnvironment, final ITestServerCommand cmd) { + return testEnvironment; + } +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseRunManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseRunManager.java new file mode 100644 index 000000000..53378b7ae --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseRunManager.java @@ -0,0 +1,138 @@ +/******************************************************************************* + * 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.core.framework; + +import java.util.logging.Level; +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.framework.jdk.core.util.Conditions; +import org.eclipse.osee.framework.logging.BaseStatus; +import org.eclipse.osee.framework.logging.IHealthStatus; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.testrun.ITestResultCollector; +import org.eclipse.osee.ote.core.framework.testrun.ITestResultCollectorFactory; +import org.eclipse.osee.ote.core.framework.testrun.ITestRunManager; + +public class BaseRunManager implements IRunManager { + + private final ITestRunManager testRunManager; + private final ITestLifecycleListenerProvider lifecycleListenerProvider; + private final ITestResultCollectorFactory resultCollectorFactory; + private ITestResultCollector resultCollector; + + public BaseRunManager(ITestRunManager testRunManager, ITestLifecycleListenerProvider lifecycleListenerProvider, ITestResultCollectorFactory resultCollectorFactory) { + this.lifecycleListenerProvider = lifecycleListenerProvider; + this.testRunManager = testRunManager; + this.resultCollectorFactory = resultCollectorFactory; + } + + @Override + public boolean addListener(ITestLifecycleListener listener) { + return lifecycleListenerProvider.addListener(listener); + } + + @Override + public void clearAllListeners() { + lifecycleListenerProvider.clear(); + } + + @Override + public boolean removeListener(ITestLifecycleListener listener) { + return lifecycleListenerProvider.removeListener(listener); + } + + @Override + public IMethodResult run(TestEnvironment env, IPropertyStore propertyStore) { + try { + this.resultCollector = resultCollectorFactory.createCollector(); + this.resultCollector.initialize(propertyStore, env); + ResultBuilder rb = new ResultBuilder(true); + rb.append(lifecycleListenerProvider.notifyPreInstantiation(propertyStore, env)); + if (rb.isReturnStatusOK()) { + rb.append(testRunManager.initialize(env, propertyStore)); + if (rb.isReturnStatusOK()) { + try { + rb.append( + lifecycleListenerProvider.notifyPostInstantiation(propertyStore, testRunManager.getTest(), env)); + } catch (Throwable th) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.ERROR); + result.addStatus(new BaseStatus(this.getClass().getName(), Level.SEVERE, th)); + rb.append(result); + } + if (rb.isReturnStatusOK()) { + try { + rb.append(testRunManager.run(propertyStore, env)); + } catch (Throwable th) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.ERROR); + result.addStatus(new BaseStatus(this.getClass().getName(), Level.SEVERE, th)); + rb.append(result); + } + } else { + TestScript test = testRunManager.getTest(); + boolean aborted = false; + if (Conditions.hasValues(rb.get().getStatus())) { + for (IHealthStatus hs : rb.get().getStatus()) { + if (hs.getException() != null) { + test.abortDueToThrowable(hs.getException()); + aborted = true; + break; + } + } + } + if (!aborted) { + test.abort(); + } + } + } + rb.append(lifecycleListenerProvider.notifyPreDispose(propertyStore, testRunManager.getTest(), env)); + rb.append(testRunManager.dispose()); + rb.append(lifecycleListenerProvider.notifyPostDispose(propertyStore, env)); + } + this.resultCollector.dispose(env); + this.resultCollector = null; + if (!rb.isReturnStatusOK()) { + OseeLog.log(BaseRunManager.class, Level.SEVERE, rb.toString()); + } + return rb.get(); + } catch (Throwable th) { + th.printStackTrace(); + MethodResultImpl status = new MethodResultImpl(ReturnCode.ERROR); + status.addStatus(new BaseStatus(BaseRunManager.class.getName(), Level.SEVERE, th)); + return status; + } + } + + @Override + public boolean abort() { + return testRunManager.abort(); + } + + @Override + public boolean abort(Throwable th, boolean wait) { + return testRunManager.abort(th, wait); + } + + @Override + public boolean isAborted() { + return testRunManager.isAborted(); + } + + @Override + public TestScript getCurrentScript() { + return testRunManager.getTest(); + } + + @Override + public boolean isCurrentThreadScript() { + return testRunManager.isCurrentThreadScript(); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseTestLifecycleListenerProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseTestLifecycleListenerProvider.java new file mode 100644 index 000000000..2a85d0357 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/BaseTestLifecycleListenerProvider.java @@ -0,0 +1,123 @@ +/******************************************************************************* + * 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.core.framework; + +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Level; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.framework.logging.BaseStatus; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.event.IEventData; +import org.eclipse.osee.ote.core.framework.event.IEventDataProvider; + +public class BaseTestLifecycleListenerProvider implements ITestLifecycleListenerProvider { + + private final IEventDataProvider eventProvider; + private final List<ITestLifecycleListener> listeners; + private int listenerCountAtPreinit = 0; + + public BaseTestLifecycleListenerProvider(IEventDataProvider eventProvider) { + this.eventProvider = eventProvider; + listeners = new CopyOnWriteArrayList<>(); + } + + @Override + public void clear() { + listeners.clear(); + } + + @Override + public boolean addListener(ITestLifecycleListener listener) { + return listeners.add(listener); + } + + @Override + public IMethodResult notifyPostDispose(IPropertyStore propertyStore, TestEnvironment env) { + IEventData eventData = eventProvider.getEventData(propertyStore, null); + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + for (ITestLifecycleListener listener : listeners) { + try { + result = collectStatus(result, listener.postDispose(eventData, env)); + } catch (Throwable th) { + result = collectStatus(result,new MethodResultImpl(ReturnCode.ERROR)); + result.addStatus(new BaseStatus(this.getClass().getName(), Level.SEVERE, th)); + } + } + + int newSize = listeners.size(); + if( this.listenerCountAtPreinit != newSize) + { + System.err.printf("+++++++++++++++++++++++++++++++++++++++++There are now %s listeners when there were %s to start with\n", listenerCountAtPreinit, newSize ); + for (ITestLifecycleListener listener : listeners) { + System.err.println("Listener: " + listener.getClass().getName()); + } + System.err.println("-----------------------------------------------------------------------------------------------------"); + } + return result; + } + + @Override + public IMethodResult notifyPostInstantiation(IPropertyStore propertyStore, TestScript test, TestEnvironment env) { + IEventData eventData = eventProvider.getEventData(propertyStore, test); + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + for (ITestLifecycleListener listener : listeners) { + result = collectStatus(result, listener.postInstantiation(eventData, env)); + } + return result; + } + + @Override + public IMethodResult notifyPreDispose(IPropertyStore propertyStore, TestScript test, TestEnvironment env) { + IEventData eventData = eventProvider.getEventData(propertyStore, test); + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + for (ITestLifecycleListener listener : listeners) { + try { + result = collectStatus(result, listener.preDispose(eventData, env)); + } catch (Throwable th) { + result = collectStatus(result,new MethodResultImpl(ReturnCode.ERROR)); + result.addStatus(new BaseStatus(this.getClass().getName(), Level.SEVERE, th)); + } + } + return result; + } + + @Override + public IMethodResult notifyPreInstantiation(IPropertyStore propertyStore, TestEnvironment env) { + IEventData eventData = eventProvider.getEventData(propertyStore, null); + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + + for (ITestLifecycleListener listener : listeners) { + result = collectStatus(result, listener.preInstantiation(eventData, env)); + } + + this.listenerCountAtPreinit = listeners.size(); + return result; + } + + @Override + public boolean removeListener(ITestLifecycleListener listener) { + return listeners.remove(listener); + } + + private MethodResultImpl collectStatus(MethodResultImpl result, IMethodResult listenerResult) { + if (listenerResult.getReturnCode() != ReturnCode.OK) { + if (result.getReturnCode() == ReturnCode.OK) { + result = new MethodResultImpl(ReturnCode.OK); + } + result.setReturnCode(listenerResult.getReturnCode()); + result.addStatus(listenerResult.getStatus()); + } + return result; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/DestroyableService.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/DestroyableService.java new file mode 100644 index 000000000..5fefb422a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/DestroyableService.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * 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.core.framework; + +public interface DestroyableService { + void destroy(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ICommandContextFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ICommandContextFactory.java new file mode 100644 index 000000000..ecae76d59 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ICommandContextFactory.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.command.ITestContext; +import org.eclipse.osee.ote.core.framework.command.ITestServerCommand; + +public interface ICommandContextFactory { + + ITestContext getContext(TestEnvironment testEnvironment, ITestServerCommand cmd); + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IMethodResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IMethodResult.java new file mode 100644 index 000000000..8b9124312 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IMethodResult.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework; + +import java.util.List; +import org.eclipse.osee.framework.logging.IHealthStatus; + +/** + * @author Andrew M. Finkbeiner + */ +public interface IMethodResult { + List<IHealthStatus> getStatus(); + + ReturnCode getReturnCode(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IRunManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IRunManager.java new file mode 100644 index 000000000..ff2082eb5 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/IRunManager.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +public interface IRunManager { + + public boolean addListener(ITestLifecycleListener listener); + + public void clearAllListeners(); + + public boolean removeListener(ITestLifecycleListener listener); + + public IMethodResult run(TestEnvironment env, IPropertyStore propertyStore); + + public boolean abort(); + + public boolean abort(Throwable th, boolean wait); + + public boolean isAborted(); + + public TestScript getCurrentScript(); + + public boolean isCurrentThreadScript(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListener.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListener.java new file mode 100644 index 000000000..c17c58f0c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListener.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public interface ITestLifecycleListener { + + IMethodResult preInstantiation(IEventData eventData, TestEnvironment env); + + IMethodResult postInstantiation(IEventData eventData, TestEnvironment env); + + IMethodResult preDispose(IEventData eventData, TestEnvironment env); + + IMethodResult postDispose(IEventData eventData, TestEnvironment env); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListenerProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListenerProvider.java new file mode 100644 index 000000000..616e290cb --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ITestLifecycleListenerProvider.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +public interface ITestLifecycleListenerProvider { + void clear(); + + boolean addListener(ITestLifecycleListener listener); + + boolean removeListener(ITestLifecycleListener listener); + + IMethodResult notifyPostDispose(IPropertyStore propertyStore, TestEnvironment env); + + IMethodResult notifyPostInstantiation(IPropertyStore propertyStore, TestScript test, TestEnvironment env); + + IMethodResult notifyPreDispose(IPropertyStore propertyStore, TestScript test, TestEnvironment env); + + IMethodResult notifyPreInstantiation(IPropertyStore propertyStore, TestEnvironment env); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/MethodResultImpl.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/MethodResultImpl.java new file mode 100644 index 000000000..7b13317a5 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/MethodResultImpl.java @@ -0,0 +1,82 @@ +/******************************************************************************* + * 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.core.framework; + +import java.util.ArrayList; +import java.util.List; +import org.eclipse.osee.framework.logging.IHealthStatus; + +/** + * @author Andrew M. Finkbeiner + */ +public class MethodResultImpl implements IMethodResult { + + public static MethodResultImpl combine(IMethodResult result1, IMethodResult result2) { + if (result1.getReturnCode() == ReturnCode.OK && result2.getReturnCode() == ReturnCode.OK) { + return new MethodResultImpl(ReturnCode.OK); + } else { + return new MethodResultImpl(result1, result2); + } + } + + private List<IHealthStatus> statuses; + private ReturnCode returnCode; + + public MethodResultImpl(ReturnCode returnCode) { + statuses = new ArrayList<>(); + this.returnCode = returnCode; + } + + private MethodResultImpl(IMethodResult result1, IMethodResult result2) { + if (result1.getReturnCode() != ReturnCode.OK) { + addStatus(result1.getStatus()); + setReturnCode(result1.getReturnCode()); + } + if (result2.getReturnCode() != ReturnCode.OK) { + addStatus(result2.getStatus()); + setReturnCode(result2.getReturnCode()); + } + } + + @Override + public ReturnCode getReturnCode() { + return returnCode; + } + + @Override + public List<IHealthStatus> getStatus() { + return statuses; + } + + public void setReturnCode(ReturnCode returnCode) { + this.returnCode = returnCode; + } + + public void addStatus(IHealthStatus status) { + statuses.add(status); + } + + public void addStatus(List<IHealthStatus> status) { + statuses.addAll(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(returnCode.toString()); + sb.append("\n"); + for (IHealthStatus status : statuses) { + sb.append(status.toString()); + sb.append("\n"); + } + return sb.toString(); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ResultBuilder.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ResultBuilder.java new file mode 100644 index 000000000..501205682 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ResultBuilder.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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.core.framework; + +import org.eclipse.osee.framework.logging.OseeLog; + +/** + * @author Andrew M. Finkbeiner + */ +public class ResultBuilder { + + private final MethodResultImpl result; + private final boolean logToHM; + + public ResultBuilder(boolean logToHM) { + result = new MethodResultImpl(ReturnCode.OK); + this.logToHM = logToHM; + } + + public MethodResultImpl append(IMethodResult result) { + if (logToHM) { + OseeLog.reportStatus(result.getStatus()); + } + this.result.addStatus(result.getStatus()); + if (result.getReturnCode() != ReturnCode.OK) { + this.result.setReturnCode(result.getReturnCode()); + } + return this.result; + } + + public IMethodResult get() { + return this.result; + } + + public boolean isReturnStatusOK() { + return this.result.getReturnCode() == ReturnCode.OK; + } + + @Override + public String toString() { + return result.toString(); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ReturnCode.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ReturnCode.java new file mode 100644 index 000000000..c5fd6dcd6 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/ReturnCode.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.framework; + +/** + * @author Andrew M. Finkbeiner + */ +public enum ReturnCode { + OK, + ERROR, + ABORTED +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/adapter/TestLifecycleListenerAdapter.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/adapter/TestLifecycleListenerAdapter.java new file mode 100644 index 000000000..21ed3946e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/adapter/TestLifecycleListenerAdapter.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * 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.core.framework.adapter; + +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.ITestLifecycleListener; +import org.eclipse.osee.ote.core.framework.MethodResultImpl; +import org.eclipse.osee.ote.core.framework.ReturnCode; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +/** + * @author Roberto E. Escobar + */ +public class TestLifecycleListenerAdapter implements ITestLifecycleListener { + + @Override + public IMethodResult postDispose(IEventData eventData, TestEnvironment env) { + return new MethodResultImpl(ReturnCode.OK); + } + + @Override + public IMethodResult postInstantiation(IEventData eventData, TestEnvironment env) { + return new MethodResultImpl(ReturnCode.OK); + } + + @Override + public IMethodResult preDispose(IEventData eventData, TestEnvironment env) { + return new MethodResultImpl(ReturnCode.OK); + } + + @Override + public IMethodResult preInstantiation(IEventData eventData, TestEnvironment env) { + return new MethodResultImpl(ReturnCode.OK); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BaseCommandManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BaseCommandManager.java new file mode 100644 index 000000000..1f9e984a1 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BaseCommandManager.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.rmi.server.ExportException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.eclipse.osee.ote.core.OTESessionManager; +import org.eclipse.osee.ote.core.ServiceUtility; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.environment.status.OTEStatusBoard; +import org.eclipse.osee.ote.core.framework.thread.OteThreadManager; + +public class BaseCommandManager implements ICommandManager { + + private final ExecutorService commands; + private final ExecutorService commandResponse; + private final Map<ITestServerCommand, Future<ITestCommandResult>> cmdMap; + + public BaseCommandManager() { + OteThreadManager threadManager = OteThreadManager.getInstance(); + commands = Executors.newSingleThreadExecutor(threadManager.createNewFactory("ote.command")); + commandResponse = Executors.newSingleThreadExecutor(threadManager.createNewFactory("ote.command.response")); + cmdMap = new ConcurrentHashMap<>(); + } + + @Override + public ICommandHandle addCommand(ITestServerCommand cmd, TestEnvironment context) throws ExportException { + OTEStatusBoard statusBoard = ServiceUtility.getService(OTEStatusBoard.class); + OTESessionManager sessionManager = ServiceUtility.getService(OTESessionManager.class); + + Future<ITestCommandResult> result = + commands.submit(new TestCallableWrapper(this, cmd, context,statusBoard, sessionManager)); + cmdMap.put(cmd, result); + return cmd.createCommandHandle(result, context); + } + + public void commandComplete(ITestServerCommand cmd, TestEnvironment context) { + commandResponse.submit(new TestCommandComplete(context, cmd, cmdMap.get(cmd))); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BatchLog.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BatchLog.java new file mode 100644 index 000000000..25635ec1f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/BatchLog.java @@ -0,0 +1,54 @@ +package org.eclipse.osee.ote.core.framework.command; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.logging.Level; + +import org.eclipse.osee.framework.logging.ILoggerListener; +import org.eclipse.osee.framework.logging.OseeLog; + +public class BatchLog implements ILoggerListener { + + private File fileToWriteTo; + private FileOutputStream fos; + private PrintWriter out; + + public BatchLog(File fileToWriteTo){ + this.fileToWriteTo = fileToWriteTo; + } + + public void open() throws FileNotFoundException{ + fos = new FileOutputStream(fileToWriteTo); + out = new PrintWriter(fileToWriteTo); + OseeLog.registerLoggerListener(this); + } + + public void close(){ + try { + fos.close(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + OseeLog.unregisterLoggerListener(this); + } + } + + public void flush(){ + out.flush(); + } + + @Override + public void log(String loggerName, Level level, String message, Throwable th) { + if(level.intValue() >= Level.SEVERE.intValue()){ + out.printf("%s %s\n", level.getName(), message); + if(th != null){ + th.printStackTrace(out); + } + } + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/CommandCompleteListener.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/CommandCompleteListener.java new file mode 100644 index 000000000..a5b243b1f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/CommandCompleteListener.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * 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.core.framework.command; + +/** + * @author Andrew M. Finkbeiner + */ +public interface CommandCompleteListener { + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandHandle.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandHandle.java new file mode 100644 index 000000000..7b709894b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandHandle.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * 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.core.framework.command; + + +public interface ICommandHandle { + boolean cancelAll(boolean mayInterruptIfRunning); + + boolean cancelSingle(boolean mayInterruptIfRunning); + + ITestCommandResult get(); + + boolean isCancelled(); + + boolean isDone(); + + String getCommandKey(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandManager.java new file mode 100644 index 000000000..4bd98b303 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ICommandManager.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.rmi.server.ExportException; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +public interface ICommandManager { + public ICommandHandle addCommand(ITestServerCommand cmd, TestEnvironment context) throws ExportException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestCommandResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestCommandResult.java new file mode 100644 index 000000000..f21c08b39 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestCommandResult.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.io.Serializable; + +public interface ITestCommandResult extends Serializable { + TestCommandStatus getStatus(); + + Throwable getThrowable(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestContext.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestContext.java new file mode 100644 index 000000000..3d4f4032e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestContext.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.io.File; + +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.framework.IRunManager; + +public interface ITestContext { + IRunManager getRunManager(); + + File getOutDir(); + + IServiceConnector getConnector(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestServerCommand.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestServerCommand.java new file mode 100644 index 000000000..ffd304a97 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/ITestServerCommand.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.rmi.server.ExportException; +import java.util.UUID; +import java.util.concurrent.Future; + +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.environment.status.OTEStatusBoard; + +public interface ITestServerCommand { + + UUID getUserSessionKey(); + + ICommandHandle createCommandHandle(Future<ITestCommandResult> result, ITestContext context) throws ExportException; + + ITestCommandResult execute(TestEnvironment context, OTEStatusBoard statusBoard) throws Exception; + + String getGUID(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java new file mode 100644 index 000000000..2319f8e26 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java @@ -0,0 +1,256 @@ +package org.eclipse.osee.ote.core.framework.command; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.Serializable; +import java.rmi.server.ExportException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.Future; +import java.util.logging.Level; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.framework.jdk.core.util.Lib; +import org.eclipse.osee.framework.logging.IHealthStatus; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.Configuration; +import org.eclipse.osee.ote.OTEApi; +import org.eclipse.osee.ote.core.ServiceUtility; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.environment.status.CommandEndedStatusEnum; +import org.eclipse.osee.ote.core.environment.status.OTEStatusBoard; +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.ReturnCode; +import org.eclipse.osee.ote.core.framework.saxparse.ProcessOutfileOverview; +import org.eclipse.osee.ote.io.OTEServerFolder; +import org.eclipse.osee.ote.message.IMessageTestContext; + +public class RunTests implements ITestServerCommand, Serializable { + + private static final long serialVersionUID = 7408758537342855854L; + private static final String DEVELOPMENT = "Development"; + + private final IPropertyStore global; + private final List<IPropertyStore> scripts; + private volatile boolean cancelAll = false; + private volatile boolean isRunning = false; + private final UUID sessionKey; + private final String commandId; + private TestEnvironment environment; + private final Configuration configuration; + + public RunTests(String commandId, UUID sessionKey, Configuration configuration, IPropertyStore global, List<IPropertyStore> scripts) { + this.global = global; + this.scripts = scripts; + this.sessionKey = sessionKey; + this.commandId = commandId; + this.configuration = configuration; + } + + public UUID getSessionKey() { + return sessionKey; + } + + @Override + public ICommandHandle createCommandHandle(Future<ITestCommandResult> result, ITestContext context) throws ExportException { + return new RunTestsHandle(result, context, this); + } + + @Override + public ITestCommandResult execute(TestEnvironment environment, OTEStatusBoard statusBoard) throws Exception { + ITestCommandResult retVal = TestCommandResult.SUCCESS; + isRunning = true; + IMessageTestContext msgContext = (IMessageTestContext) environment; + this.environment = environment; + + OTEApi ote = ServiceUtility.getService(OTEApi.class); + OTEServerFolder serverFolder = ote.getServerFolder(); + + String testType = getTestType(); + File batchFolder = serverFolder.getNewBatchFolder(testType); + batchFolder.mkdirs(); + if(!isFolderToKeep(testType)){ + serverFolder.markFolderForDelete(batchFolder); + } + BatchLog batchLog = new BatchLog(serverFolder.getBatchLogFile(batchFolder)); + batchLog.open(); + + File batchStatusFile = serverFolder.getBatchStatusFile(batchFolder); + File batchRunList = serverFolder.getBatchRunList(batchFolder); + + setBatchStatus(batchStatusFile, "running"); + setBatchRunList(batchRunList, scripts); + + environment.setupOutfileDir(batchFolder.getAbsolutePath()); + msgContext.resetScriptLoader(configuration, global.getArray(RunTestsKeys.classpath.name())); + + //Override the command line option only if batch abort has been selected in TestManager + boolean batchAbortFailMode = global.getBoolean(RunTestsKeys.batchFailAbortMode.name()); + if(batchAbortFailMode){ + System.setProperty("ote.abort.on.fail", "true"); + } + else { + System.clearProperty("ote.abort.on.fail"); + } + + //Override the command line option only if batch pause has been selected in TestManager + boolean batchPauseFailMode = global.getBoolean(RunTestsKeys.batchFailPauseMode.name()); + if(batchPauseFailMode){ + System.setProperty("ote.pause.on.fail", "true"); + } + else { + System.clearProperty("ote.pause.on.fail"); + } + + //Override the command line option only if batch pause has been selected in TestManager + boolean printOnFailMode = global.getBoolean(RunTestsKeys.printFailToConsoleMode.name()); + if(printOnFailMode){ + System.setProperty("ote.print.fail.to.console", "true"); + } + else { + System.clearProperty("ote.print.fail.to.console"); + } + + for (IPropertyStore store : scripts) { + Set<String> arrayKeySet = global.arrayKeySet(); + for(String key:arrayKeySet){ + String[] array = global.getArray(key); + if(array != null ){ + store.put(key, array); + } + } + Set<String> keySet = global.keySet(); + for(String key:keySet){ + String val = global.get(key); + if(val != null ){ + store.put(key, val); + } + } + + if (cancelAll) { + statusBoard.onTestComplete(store.get(RunTestsKeys.testClass.name()), + store.get(RunTestsKeys.serverOutfilePath.name()), + store.get(RunTestsKeys.clientOutfilePath.name()), CommandEndedStatusEnum.ABORTED, + new ArrayList<IHealthStatus>()); + retVal = TestCommandResult.CANCEL; + continue; + + } + statusBoard.onTestStart(store.get(RunTestsKeys.testClass.name()), store.get(RunTestsKeys.serverOutfilePath.name()), store.get(RunTestsKeys.clientOutfilePath.name())); + IMethodResult runResults = environment.getRunManager().run(environment, store); + + CommandEndedStatusEnum status = CommandEndedStatusEnum.RAN_TO_COMPLETION; + if (runResults.getReturnCode() == ReturnCode.ABORTED) { + status = CommandEndedStatusEnum.ABORTED; + } + if (runResults.getReturnCode() == ReturnCode.ERROR) { + status = CommandEndedStatusEnum.EXCEPTION; + } + + statusBoard.onTestComplete(store.get(RunTestsKeys.testClass.name()), + store.get(RunTestsKeys.serverOutfilePath.name()), store.get(RunTestsKeys.clientOutfilePath.name()), + status, runResults.getStatus()); + batchLog.flush(); + + File outfile = new File(store.get(RunTestsKeys.serverOutfilePath.name())); + generateOutfileSummary(outfile, serverFolder.getResultsFile(outfile)); + } + setBatchStatus(batchStatusFile, "complete"); + isRunning = false; + batchLog.close(); + return retVal; + } + + private void setBatchRunList(File batchRunList, List<IPropertyStore> scripts2) { + StringBuilder sb = new StringBuilder(); + for (IPropertyStore store : scripts) { + sb.append(store.get(RunTestsKeys.testClass.name())); + sb.append("\n"); + } + try { + Lib.writeStringToFile(sb.toString(), batchRunList); + } catch (IOException ex) { + OseeLog.log(getClass(), Level.SEVERE, "Failed to write batch run list", ex); + } + } + + private void setBatchStatus(File batchStatusFile, String string) { + try { + Lib.writeStringToFile(string, batchStatusFile); + } catch (IOException ex) { + OseeLog.log(getClass(), Level.SEVERE, "Failed to write batch status", ex); + } + } + + private void generateOutfileSummary(File outfile, File resultsFile){ + String summary = getResults(outfile); + writeSummaryToFile(resultsFile, summary); + } + + private void writeSummaryToFile(File file, String summary) { + try { + Lib.writeStringToFile(summary, file); + } catch (IOException ex) { + OseeLog.log(getClass(), Level.SEVERE, "Failed to write outfile summary", ex); + } + } + + private String getResults(File outfile){ + ProcessOutfileOverview overview = new ProcessOutfileOverview(); + FileInputStream fis = null; + try{ + fis = new FileInputStream(outfile); + overview.run(fis); + } catch (Exception ex) { + OseeLog.log(getClass(), Level.SEVERE, "Failed to write outfile summary", ex); + } finally { + if(fis != null){ + try { + fis.close(); + } catch (IOException e) { + OseeLog.log(getClass(), Level.SEVERE, "Failed to close outfile", e); + } + } + } + return String.format("%s,%s,%s", overview.getScriptName(), overview.getResults(), overview.getElapsedTime()); + } + + private String getTestType(){ + return global.get("FormalTestType"); + } + + private boolean isFolderToKeep(String testType) { + if(testType != null && testType.equalsIgnoreCase(DEVELOPMENT)){ + return false; + } else { + return true; + } + } + + public boolean cancel() { + cancelAll = true; + return environment.getRunManager().abort(); + } + + public boolean cancelSingle() { + return environment.getRunManager().abort(); + } + + @Override + public String getGUID() { + return commandId; + } + + @Override + public UUID getUserSessionKey() { + return sessionKey; + } + + boolean isRunning() { + return isRunning; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsHandle.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsHandle.java new file mode 100644 index 000000000..1b1bbe1b6 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsHandle.java @@ -0,0 +1,64 @@ +package org.eclipse.osee.ote.core.framework.command; + +import java.io.Serializable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import org.eclipse.osee.framework.jdk.core.util.GUID; + +public class RunTestsHandle implements ICommandHandle, Serializable { + + private static final long serialVersionUID = 3643208660033506154L; + + private final transient Future<ITestCommandResult> result; + private final transient ITestContext context; + private final transient RunTests command; + private final String guid; + + public RunTestsHandle(Future<ITestCommandResult> result, ITestContext context, RunTests command) { + this.result = result; + this.context = context; + this.command = command; + this.guid = GUID.create(); + } + + @Override + public boolean cancelAll(boolean mayInterruptIfRunning) { + return command.cancel(); + } + + @Override + public boolean cancelSingle(boolean mayInterruptIfRunning) { + return command.cancelSingle(); + } + + @Override + public ITestCommandResult get() { + try { + return result.get(); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (ExecutionException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public boolean isCancelled() { + return false; + } + + @Override + public boolean isDone() { + return command.isRunning(); + } + + @Override + public String getCommandKey() { + return guid; + } + + + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java new file mode 100644 index 000000000..a92904874 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java @@ -0,0 +1,29 @@ +package org.eclipse.osee.ote.core.framework.command; + +public enum RunTestsKeys { + distributionStatement, + executablePath, + classpath, + version_repositoryType, + version_location, + version_revision, + version_lastAuthor, + version_lastModificationDate, + version_modifiedFlag, + serverOutfilePath, + executableOutputPath, + executableDebug, + testClass, + clientOutfilePath, + testVersion, + serverOutfileFolderOverride, + executablePathsArray, + executableArg1Array, + executableArg2Array, + spare1, + batchFailAbortMode, + batchmode, + batchFailPauseMode, + printFailToConsoleMode; + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCallableWrapper.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCallableWrapper.java new file mode 100644 index 000000000..70ca276ba --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCallableWrapper.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.util.concurrent.Callable; +import java.util.logging.Level; + +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.OTESessionManager; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.environment.status.OTEStatusBoard; + +public class TestCallableWrapper implements Callable<ITestCommandResult> { + + private final ITestServerCommand cmd; + private final TestEnvironment context; + private final BaseCommandManager cmdManager; + private final OTEStatusBoard statusBoard; + private final OTESessionManager sessionManager; + + public TestCallableWrapper(BaseCommandManager cmdManager, ITestServerCommand cmd, TestEnvironment context, OTEStatusBoard statusBoard, OTESessionManager sessionManager) { + this.cmd = cmd; + this.context = context; + this.cmdManager = cmdManager; + this.statusBoard = statusBoard; + this.sessionManager = sessionManager; + } + + @Override + public ITestCommandResult call() throws Exception { + ITestCommandResult result; + try { + sessionManager.setActiveUser(cmd.getUserSessionKey()); + result = cmd.execute(context, statusBoard); + if (result.getThrowable() != null) { + OseeLog.log(TestCallableWrapper.class, Level.SEVERE, result.getThrowable()); + } + } catch (Throwable ex) { + result = new TestCommandResult(TestCommandStatus.FAIL, ex); + OseeLog.log(TestCallableWrapper.class, Level.SEVERE, ex); + } finally { + cmdManager.commandComplete(cmd, context); + } + return result; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandComplete.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandComplete.java new file mode 100644 index 000000000..2c1c42209 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandComplete.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * 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.core.framework.command; + +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestCommandComplete implements Callable<ITestCommandResult> { + + private ICommandHandle handle; + private final TestEnvironment env; + private Future<ITestCommandResult> future; + private ITestServerCommand cmd; + + public TestCommandComplete(TestEnvironment env, ITestServerCommand cmd, Future<ITestCommandResult> future) { + this.future = future; + this.cmd = cmd; + this.env = env; + } + + public TestCommandComplete(TestEnvironment env, ICommandHandle handle) { + this.env = env; + this.handle = handle; + } + + @Override + public ITestCommandResult call() throws Exception { + ITestCommandResult result; + try { + result = future.get(30, TimeUnit.SECONDS); + ICommandHandle handle = cmd.createCommandHandle(future, env); + env.testEnvironmentCommandComplete(handle); + } catch (Throwable th) { + result = new TestCommandResult(TestCommandStatus.FAIL, new Exception("Failed to retrieve command result", th)); + } + return result; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandResult.java new file mode 100644 index 000000000..01c228b1a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandResult.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.core.framework.command; + +public class TestCommandResult implements ITestCommandResult { + + private static final long serialVersionUID = -7905997520977718355L; + + public static final ITestCommandResult CANCEL = new TestCommandResult(TestCommandStatus.CANCEL); + public static final ITestCommandResult SUCCESS = new TestCommandResult(TestCommandStatus.SUCCESS); + public static final ITestCommandResult FAIL = new TestCommandResult(TestCommandStatus.FAIL); + + private final TestCommandStatus status; + private Throwable th; + + public TestCommandResult(TestCommandStatus status) { + this.status = status; + } + + public TestCommandResult(TestCommandStatus status, Throwable th) { + this.status = status; + this.th = th; + } + + @Override + public TestCommandStatus getStatus() { + return status; + } + + @Override + public Throwable getThrowable() { + return th; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandStatus.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandStatus.java new file mode 100644 index 000000000..9683ac215 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/TestCommandStatus.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * 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.core.framework.command; + +public enum TestCommandStatus { + SUCCESS, + FAIL, + CANCEL +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEvent.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEvent.java new file mode 100644 index 000000000..75654310a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEvent.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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.core.framework.event; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestCase; +import org.eclipse.osee.ote.core.TestScript; + +public class BaseEvent implements IEventData { + + private final IPropertyStore propertyStore; + private final TestScript test; + private final TestCase testCase; + + public BaseEvent(IPropertyStore propertyStore, TestScript test) { + this.propertyStore = propertyStore; + this.test = test; + this.testCase = null; + } + + public BaseEvent(IPropertyStore propertyStore, TestScript test, TestCase testCase) { + this.propertyStore = propertyStore; + this.test = test; + this.testCase = testCase; + } + + public BaseEvent(TestScript test, TestCase testCase) { + this.propertyStore = null; + this.test = test; + this.testCase = testCase; + } + + public BaseEvent(TestScript test) { + this.test = test; + this.testCase = null; + this.propertyStore = null; + } + + @Override + public TestScript getTest() { + return test; + } + + @Override + public TestCase getTestCase() { + return testCase; + } + + @Override + public IPropertyStore getProperties() { + return propertyStore; + } + + public String getScriptClass() { + return propertyStore.get("classname"); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEventDataProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEventDataProvider.java new file mode 100644 index 000000000..389599722 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/BaseEventDataProvider.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework.event; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; + +public class BaseEventDataProvider implements IEventDataProvider { + + @Override + public IEventData getEventData(IPropertyStore propertyStore, TestScript script) { + return new BaseEvent(propertyStore, script); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventData.java new file mode 100644 index 000000000..294be540a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventData.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework.event; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestCase; +import org.eclipse.osee.ote.core.TestScript; + +public interface IEventData { + public TestScript getTest(); + + public TestCase getTestCase(); + + public IPropertyStore getProperties(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventDataProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventDataProvider.java new file mode 100644 index 000000000..aa57fd257 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/event/IEventDataProvider.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.framework.event; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; + +public interface IEventDataProvider { + + IEventData getEventData(IPropertyStore propertyStore, TestScript script); + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractInteractivePrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractInteractivePrompt.java new file mode 100644 index 000000000..6ba914813 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractInteractivePrompt.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.util.concurrent.Executor; +import java.util.logging.Level; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +/** + * @author Ken J. Aguilar + */ +public abstract class AbstractInteractivePrompt<T> extends AbstractRemotePrompt implements IPromptHandle { + + private final TestScript script; + protected Exception exception; + protected T response; + + public AbstractInteractivePrompt(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, id, message); + this.script = script; + } + + public T open(Executor executor) throws InterruptedException, Exception { + response = null; + exception = null; + if (executor != null) { + // run the prompt in the background + executor.execute(new Runnable() { + + @Override + public void run() { + try { + doPrompt(); + } catch (Exception e) { + OseeLog.log(TestEnvironment.class, Level.SEVERE, "exception while performing prompt", e); + // the thread that activated the prompt will be waiting on the script object's notifyAll() to + // be called. If an exception occurs this may not happen so we should do it here + endPrompt(null, new Exception("exception while performing prompt", e)); + } + } + }); + } else { + doPrompt(); + } + return waitForResponse(script, false); + } + + protected void endPrompt(T response, Exception exception) { + + script.getTestEnvironment().getScriptCtrl().setExecutionUnitPause(false); + script.getTestEnvironment().getScriptCtrl().setScriptPause(false); + synchronized (script) { + this.response = response; + this.exception = exception; + script.notifyAll(); + } + } + + protected abstract void doPrompt() throws Exception; + + protected void terminatePrompt() throws Exception { + getScript().getUserSession().cancelPrompts(); + } + + protected T waitForResponse(TestScript script, boolean executionUnitPause) throws InterruptedException, Exception { + synchronized (script) { + script.getTestEnvironment().getScriptCtrl().setScriptPause(true); + script.getTestEnvironment().getScriptCtrl().setExecutionUnitPause(executionUnitPause); + script.getTestEnvironment().getScriptCtrl().unlock(); + try { + script.wait(); + } catch (InterruptedException e) { + terminatePrompt(); + throw new InterruptedException(); + } finally { + script.getTestEnvironment().getScriptCtrl().lock(); + } + return response; + } + } + + /** + * @return the script + */ + public TestScript getScript() { + return script; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractRemotePrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractRemotePrompt.java new file mode 100644 index 000000000..e1e2722fd --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/AbstractRemotePrompt.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import java.rmi.server.ExportException; +import org.eclipse.osee.connection.service.IServiceConnector; + +/** + * @author Ken J. Aguilar + */ +public class AbstractRemotePrompt implements IPromptHandle { + private final String id; + private final String message; + private final IServiceConnector connector; + + public AbstractRemotePrompt(IServiceConnector connector, String id, String message) throws UnknownHostException { + this.connector = connector; + this.id = id; + this.message = message; + } + + @Override + public String getPromptId() throws RemoteException { + return id; + } + + @Override + public String getPromptMessage() throws RemoteException { + return message; + } + + /** + * returns a reference to the specified remote interface whose remote methods will be bound to this prompt object + * + */ + protected final <U extends IPromptHandle> U createRemoteReference(Class<U> remoteInterface) throws ExportException { + return remoteInterface.cast(connector.export(this)); + } + + public void close() throws Exception { + connector.unexport(this); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/BlockingMessagePrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/BlockingMessagePrompt.java new file mode 100644 index 000000000..2385333eb --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/BlockingMessagePrompt.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.IUserSession; + +/** + * @author Ken J. Aguilar + */ +public class BlockingMessagePrompt extends AbstractRemotePrompt implements IResumeResponse { + + private final ReentrantLock lock = new ReentrantLock(); + private final Condition responseAvailable = lock.newCondition(); + private boolean responded; + + public BlockingMessagePrompt(IServiceConnector connector, String id, String message) throws UnknownHostException { + super(connector, id, message); + } + + /** + * @return true if the user did not respond within the time specified and false if the user responded in time + */ + public boolean open(IUserSession session, int timeout) throws Exception { + lock.lock(); + try { + responded = false; + session.initiateResumePrompt(this); + long nanos = TimeUnit.SECONDS.toNanos(timeout); + + while (!responded) { + if (nanos > 0) { + nanos = responseAvailable.awaitNanos(0); + } else { + return true; + } + } + return false; + } finally { + lock.unlock(); + } + } + + @Override + public void resume() throws RemoteException { + lock.lock(); + try { + responded = true; + responseAvailable.notifyAll(); + } finally { + lock.unlock(); + } + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPassFailPromptResponse.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPassFailPromptResponse.java new file mode 100644 index 000000000..f9d31abc3 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPassFailPromptResponse.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.RemoteException; + +/** + * @author Ken J. Aguilar + */ +public interface IPassFailPromptResponse extends IPromptHandle { + void respond(boolean pass, String text) throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPromptHandle.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPromptHandle.java new file mode 100644 index 000000000..0346e11be --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IPromptHandle.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * @author Ken J. Aguilar + */ +public interface IPromptHandle extends Remote { + String getPromptId() throws RemoteException; + + String getPromptMessage() throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IResumeResponse.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IResumeResponse.java new file mode 100644 index 000000000..622e37d50 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IResumeResponse.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.RemoteException; + +/** + * @author Ken J. Aguilar + */ +public interface IResumeResponse extends IPromptHandle { + void resume() throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ISteppingPrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ISteppingPrompt.java new file mode 100644 index 000000000..8f81017d8 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ISteppingPrompt.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.RemoteException; + +/** + * @author Ken J. Aguilar + */ +public interface ISteppingPrompt extends IPromptHandle { + void step() throws RemoteException; + + void resume() throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IUserInputPromptResponse.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IUserInputPromptResponse.java new file mode 100644 index 000000000..d4aaa6fa7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IUserInputPromptResponse.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.RemoteException; + +/** + * @author Ken J. Aguilar + */ +public interface IUserInputPromptResponse extends IPromptHandle { + void respond(String text) throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IYesNoPromptResponse.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IYesNoPromptResponse.java new file mode 100644 index 000000000..a9a4861ab --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/IYesNoPromptResponse.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.rmi.RemoteException; + +public interface IYesNoPromptResponse extends IPromptHandle { + void respond(boolean yes) throws RemoteException; +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/InformationalPrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/InformationalPrompt.java new file mode 100644 index 000000000..07ddce254 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/InformationalPrompt.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.util.concurrent.Executor; + +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.IUserSession; + +/** + * @author Ken J. Aguilar + */ +public class InformationalPrompt extends AbstractRemotePrompt { + + public InformationalPrompt(IServiceConnector connector, String id, String message) throws UnknownHostException { + super(connector, id, message); + } + + public void open(final IUserSession session, Executor executor) throws Exception { + if (executor != null) { + executor.execute(new Runnable() { + + @Override + public void run() { + String message = null; + try { + message = getPromptMessage(); + if (message != null) { + session.initiateInformationalPrompt(getPromptMessage()); + } else { + session.initiateInformationalPrompt("null message"); + } + } catch (Exception e) { + System.out.println(message); + } + } + }); + } else { + session.initiateInformationalPrompt(getPromptMessage()); + } + } + + @Override + public void close() { + + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/NonBlockingMessagePrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/NonBlockingMessagePrompt.java new file mode 100644 index 000000000..31b3d2aba --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/NonBlockingMessagePrompt.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.IUserSession; + +/** + * @author Ken J. Aguilar + */ +public class NonBlockingMessagePrompt extends AbstractRemotePrompt implements IResumeResponse { + + public NonBlockingMessagePrompt(IServiceConnector connector, String id, String message) throws UnknownHostException { + super(connector, id, message); + } + + public void open(IUserSession session) throws Exception { + + session.initiateResumePrompt(this); + + } + + @Override + public void resume() throws RemoteException { + + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/OfpDebugPrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/OfpDebugPrompt.java new file mode 100644 index 000000000..0df027b5f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/OfpDebugPrompt.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +/** + * @author Ken J. Aguilar + */ +public class OfpDebugPrompt extends ScriptPausePromptImpl { + + public OfpDebugPrompt(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void resume() throws RemoteException { + super.resume(); + } + + @Override + protected String waitForResponse(TestScript script, boolean executionUnitPause) throws InterruptedException, Exception { + synchronized (script) { + script.getTestEnvironment().getScriptCtrl().setScriptPause(true); + script.getTestEnvironment().getScriptCtrl().setExecutionUnitPause(executionUnitPause); + script.getTestEnvironment().getScriptCtrl().unlock(); + script.wait(); + if (exception != null) { + throw exception; + } + return response; + } + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptImpl.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptImpl.java new file mode 100644 index 000000000..759a855df --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptImpl.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +/** + * @author Ken J. Aguilar + */ +public class PassFailPromptImpl extends AbstractInteractivePrompt<PassFailPromptResult> implements IPassFailPromptResponse { + + public PassFailPromptImpl(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void doPrompt() throws Exception { + getScript().getUserSession().initiatePassFailPrompt(createRemoteReference(IPassFailPromptResponse.class)); + } + + @Override + public void respond(boolean pass, String text) throws RemoteException { + endPrompt(new PassFailPromptResult(pass, text), null); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptResult.java new file mode 100644 index 000000000..7a8861faa --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/PassFailPromptResult.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +public class PassFailPromptResult { + private final boolean pass; + private final String text; + + public PassFailPromptResult(boolean pass, String text) { + this.pass = pass; + this.text = text; + } + + /** + * @return the pass + */ + public boolean isPass() { + return pass; + } + + /** + * @return the text + */ + public String getText() { + return text; + } + +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptPausePromptImpl.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptPausePromptImpl.java new file mode 100644 index 000000000..a900523db --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptPausePromptImpl.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +/** + * @author Ken J. Aguilar + */ +public class ScriptPausePromptImpl extends AbstractInteractivePrompt<String> implements IResumeResponse { + + public ScriptPausePromptImpl(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void doPrompt() throws Exception { + getScript().getUserSession().initiateResumePrompt(createRemoteReference(IResumeResponse.class)); + } + + @Override + public void resume() throws RemoteException { + endPrompt("CONTINUE", null); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptSteppingPrompt.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptSteppingPrompt.java new file mode 100644 index 000000000..318205ea4 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/ScriptSteppingPrompt.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +/** + * @author Ken J. Aguilar + */ +public class ScriptSteppingPrompt extends AbstractInteractivePrompt<String> implements ISteppingPrompt { + + public ScriptSteppingPrompt(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void doPrompt() throws Exception { + getScript().getUserSession().initiateResumePrompt(createRemoteReference(IResumeResponse.class)); + } + + @Override + public void step() throws RemoteException { + // environment.singleStepEnv(); + endPrompt("RESUME", null); + } + + @Override + public void resume() throws RemoteException { + + endPrompt("CONTINUE", null); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/UserInputPromptImpl.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/UserInputPromptImpl.java new file mode 100644 index 000000000..b12e6058e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/UserInputPromptImpl.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +/** + * @author Ken J. Aguilar + */ +public class UserInputPromptImpl extends AbstractInteractivePrompt<String> implements IUserInputPromptResponse { + + public UserInputPromptImpl(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void doPrompt() throws Exception { + getScript().getUserSession().initiateUserInputPrompt(createRemoteReference(IUserInputPromptResponse.class)); + } + + @Override + public void respond(String text) throws RemoteException { + endPrompt(text, null); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptImpl.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptImpl.java new file mode 100644 index 000000000..7a1a6b154 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptImpl.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +import java.net.UnknownHostException; +import java.rmi.RemoteException; + +import org.eclipse.osee.connection.service.IServiceConnector; +import org.eclipse.osee.ote.core.TestScript; + +public class YesNoPromptImpl extends AbstractInteractivePrompt<YesNoPromptResult> implements IYesNoPromptResponse { + + public YesNoPromptImpl(IServiceConnector connector, TestScript script, String id, String message) throws UnknownHostException { + super(connector, script, id, message); + } + + @Override + public void doPrompt() throws Exception { + getScript().getUserSession().initiateYesNoPrompt(createRemoteReference(IYesNoPromptResponse.class)); + } + + @Override + public void respond(boolean yes) throws RemoteException { + endPrompt(new YesNoPromptResult(yes), null); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptResult.java new file mode 100644 index 000000000..4ebd66471 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/prompt/YesNoPromptResult.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework.prompt; + +public class YesNoPromptResult { + private final boolean yes; + + public YesNoPromptResult(boolean yes) { + this.yes = yes; + } + + public boolean isYes() { + return yes; + } +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ElementHandlers.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ElementHandlers.java new file mode 100644 index 000000000..d7efe949e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ElementHandlers.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * 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.core.framework.saxparse; + +import java.util.ArrayList; +import java.util.List; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * @author Andrew M. Finkbeiner + */ +public abstract class ElementHandlers { + + private final String name; + private final List<IBaseSaxElementListener> listeners = new ArrayList<>(); + + public ElementHandlers(String name) { + this.name = name; + } + + public final String getElementName() { + return this.name; + } + + public final void addListener(IBaseSaxElementListener listener) { + listeners.add(listener); + } + + public final void removeListener(IBaseSaxElementListener listener) { + listeners.remove(listener); + } + + void endElementFound(String uri, String localName, String name, String content) throws SAXException { + if (listeners.isEmpty()) { + return; + } + Object obj = createEndElementFoundObject(uri, localName, name, content); + for (IBaseSaxElementListener listener : listeners) { + listener.onEndElement(obj); + } + } + + void startElementFound(String uri, String localName, String name, Attributes attributes) throws SAXException { + if (listeners.isEmpty()) { + return; + } + Object obj = createStartElementFoundObject(uri, localName, name, attributes); + for (IBaseSaxElementListener listener : listeners) { + listener.onStartElement(obj); + } + } + + public abstract Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes); + + public Object createEndElementFoundObject(String uri, String localName, String name, String content) { + return content; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/IBaseSaxElementListener.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/IBaseSaxElementListener.java new file mode 100644 index 000000000..f64bd7e21 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/IBaseSaxElementListener.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * 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.core.framework.saxparse; + +/** + * @author Andrew M. Finkbeiner + */ +public interface IBaseSaxElementListener { + + void onStartElement(Object obj); + + void onEndElement(Object obj); + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/OteSaxHandler.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/OteSaxHandler.java new file mode 100644 index 000000000..856a7732c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/OteSaxHandler.java @@ -0,0 +1,214 @@ +/******************************************************************************* + * 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.core.framework.saxparse; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Actual; +import org.eclipse.osee.ote.core.framework.saxparse.elements.AdditionalInfo; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Argument; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Attention; +import org.eclipse.osee.ote.core.framework.saxparse.elements.CheckGroup; +import org.eclipse.osee.ote.core.framework.saxparse.elements.CheckPoint; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Config; +import org.eclipse.osee.ote.core.framework.saxparse.elements.CurrentProcessor; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Debug; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ElapsedTime; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Environment; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ExecutedBy; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ExecutionDate; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Expected; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Global; +import org.eclipse.osee.ote.core.framework.saxparse.elements.GroupName; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Info; +import org.eclipse.osee.ote.core.framework.saxparse.elements.InfoGroup; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Location; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Message; +import org.eclipse.osee.ote.core.framework.saxparse.elements.MethodArguments; +import org.eclipse.osee.ote.core.framework.saxparse.elements.MethodName; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Name; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Notes; +import org.eclipse.osee.ote.core.framework.saxparse.elements.NumberOfTransmissions; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ObjectName; +import org.eclipse.osee.ote.core.framework.saxparse.elements.OfpErrorEntry; +import org.eclipse.osee.ote.core.framework.saxparse.elements.OfpLoggingInfo; +import org.eclipse.osee.ote.core.framework.saxparse.elements.OteLog; +import org.eclipse.osee.ote.core.framework.saxparse.elements.PropertyElementHandler; +import org.eclipse.osee.ote.core.framework.saxparse.elements.PropertyStoreElementHandler; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Qualification; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Requirement; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Result; +import org.eclipse.osee.ote.core.framework.saxparse.elements.RetryGroup; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ReturnValue; +import org.eclipse.osee.ote.core.framework.saxparse.elements.RuntimeVersions; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ScriptInit; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ScriptName; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ScriptResult; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ScriptVersion; +import org.eclipse.osee.ote.core.framework.saxparse.elements.SoftKeyInfoGroup; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Stacktrace; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Summary; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Support; +import org.eclipse.osee.ote.core.framework.saxparse.elements.SystemInfo; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestCase; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestEventElement; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestPoint; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestPointName; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestPointResults; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestScript; +import org.eclipse.osee.ote.core.framework.saxparse.elements.ThrowableElement; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Time; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TimeSummary; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Tracability; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Trace; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TraceEnd; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Type; +import org.eclipse.osee.ote.core.framework.saxparse.elements.User; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Value; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Version; +import org.eclipse.osee.ote.core.framework.saxparse.elements.VersionInformation; +import org.eclipse.osee.ote.core.framework.saxparse.elements.Witnesses; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * XMLReader xmlReader = XMLReaderFactory.createXMLReader(); CollectionParser handler = new + * CollectionParser(collectors); xmlReader.setContentHandler(handler); xmlReader.parse(new InputSource(inputStream)); + * + * @author Andrew M. Finkbeiner + */ +public class OteSaxHandler extends AbstractSaxHandler { + + Map<String, ElementHandlers> handlers; + + public OteSaxHandler() throws Exception { + handlers = new HashMap<>(); + addHandlers(new Global()); + addHandlers(new AdditionalInfo()); + addHandlers(new Actual()); + addHandlers(new Argument()); + addHandlers(new Attention()); + addHandlers(new CheckGroup()); + addHandlers(new CheckPoint()); + addHandlers(new Config()); + addHandlers(new CurrentProcessor()); + addHandlers(new Debug()); + addHandlers(new ElapsedTime()); + addHandlers(new Environment()); + addHandlers(new ExecutedBy()); + addHandlers(new ExecutionDate()); + addHandlers(new Expected()); + addHandlers(new GroupName()); + addHandlers(new Info()); + addHandlers(new InfoGroup()); + addHandlers(new Location()); + addHandlers(new Message()); + addHandlers(new MethodArguments()); + addHandlers(new MethodName()); + addHandlers(new Name()); + addHandlers(new Notes()); + addHandlers(new org.eclipse.osee.ote.core.framework.saxparse.elements.Number()); + addHandlers(new NumberOfTransmissions()); + addHandlers(new ObjectName()); + addHandlers(new OfpErrorEntry()); + addHandlers(new OfpLoggingInfo()); + addHandlers(new OteLog()); + addHandlers(new PropertyStoreElementHandler()); + addHandlers(new PropertyElementHandler()); + addHandlers(new Qualification()); + addHandlers(new Requirement()); + addHandlers(new Result()); + addHandlers(new RetryGroup()); + addHandlers(new ReturnValue()); + addHandlers(new RuntimeVersions()); + addHandlers(new ScriptInit()); + addHandlers(new ScriptName()); + addHandlers(new ScriptResult()); + addHandlers(new ScriptVersion()); + addHandlers(new SoftKeyInfoGroup()); + addHandlers(new Stacktrace()); + addHandlers(new Summary()); + addHandlers(new Support()); + addHandlers(new SystemInfo()); + addHandlers(new TestCase()); + addHandlers(new TestPoint()); + addHandlers(new ThrowableElement()); + addHandlers(new TestEventElement()); + addHandlers(new TestPointName()); + addHandlers(new TestPointResults()); + addHandlers(new TestScript()); + addHandlers(new Time()); + addHandlers(new TimeSummary()); + addHandlers(new Tracability()); + addHandlers(new Trace()); + addHandlers(new TraceEnd()); + addHandlers(new Type()); + addHandlers(new User()); + addHandlers(new Value()); + addHandlers(new Version()); + addHandlers(new VersionInformation()); + addHandlers(new Witnesses()); + } + + @Override + public void endElementFound(String uri, String localName, String name) throws SAXException { + ElementHandlers handler; + + handler = handlers.get("*"); + if (handler != null) { + handler.endElementFound(uri, localName, name, stripCData(getContents().trim())); + } + + handler = handlers.get(name); + if (handler != null) { + handler.endElementFound(uri, localName, name, stripCData(getContents().trim())); + } + } + + private String stripCData(String content) { + if (content.startsWith("<![CDATA[")) { + return content.subSequence(9, content.length() - 3).toString(); + } else { + return content; + } + + } + + @Override + public void startElementFound(String uri, String localName, String name, Attributes attributes) throws SAXException { + ElementHandlers handler; + + handler = handlers.get("*"); + if (handler != null) { + handler.startElementFound(uri, localName, name, attributes); + } + + handler = handlers.get(name); + if (handler != null) { + handler.startElementFound(uri, localName, name, attributes); + } else { + System.out.println("No Handler for ELEMENT type " + name); + } + } + + public void addHandlers(ElementHandlers handler) throws Exception { + Object obj = handlers.put(handler.getElementName(), handler); + if (obj != null) { + throw new Exception("Duplicate handler."); + } + } + + public ElementHandlers getHandler(String elementName) { + return handlers.get(elementName); + } +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ProcessOutfileOverview.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ProcessOutfileOverview.java new file mode 100644 index 000000000..f47eb0125 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/ProcessOutfileOverview.java @@ -0,0 +1,127 @@ +/******************************************************************************* + * 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.core.framework.saxparse; + +import java.io.InputStream; +import java.util.logging.Level; + +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TestPointResultsData; +import org.eclipse.osee.ote.core.framework.saxparse.elements.TimeSummaryData; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +/** + * @author Andrew M. Finkbeiner + */ +public class ProcessOutfileOverview { + + private String elapsedTime; + private String scriptName; + private String results = ""; + + public ProcessOutfileOverview() { + } + + public void run(InputStream inputStream) throws Exception { + + long time = System.currentTimeMillis(); + + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + OteSaxHandler handler = new OteSaxHandler(); + xmlReader.setContentHandler(handler); + xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler); + + handler.getHandler("TimeSummary").addListener(new IBaseSaxElementListener() { + + @Override + public void onEndElement(Object obj) { + } + + @Override + public void onStartElement(Object obj) { + if (obj instanceof TimeSummaryData) { + TimeSummaryData data = (TimeSummaryData) obj; + elapsedTime = data.getElapsed(); + } + } + + }); + handler.getHandler("TestPointResults").addListener(new IBaseSaxElementListener() { + + @Override + public void onEndElement(Object obj) { + } + + @Override + public void onStartElement(Object obj) { + if (obj instanceof TestPointResultsData) { + TestPointResultsData data = (TestPointResultsData) obj; + String fail = data.getFail(); + String pass = data.getPass(); + String aborted = data.getAborted(); + try { + int failedTestPoints = Integer.parseInt(fail); + int passedTestPoints = Integer.parseInt(pass); + int totalTestPoints = passedTestPoints + failedTestPoints; + boolean abort = false; + if (aborted != null && aborted.length() > 0) { + abort = Boolean.parseBoolean(aborted); + } + results = ""; + if (abort) { + results = String.format("ABORTED - Total[%d] Fail[%d]", totalTestPoints, failedTestPoints); + } else if (failedTestPoints > 0) { + results = String.format("FAILED - Total[%d] Fail[%d]", totalTestPoints, failedTestPoints); + } else { + results = String.format("PASSED - Total[%d] Fail[%d]", totalTestPoints, failedTestPoints); + } + } catch (NumberFormatException ex) { + + } + } + } + + }); + handler.getHandler("ScriptName").addListener(new IBaseSaxElementListener() { + + @Override + public void onEndElement(Object obj) { + scriptName = obj.toString(); + } + + @Override + public void onStartElement(Object obj) { + } + }); + + xmlReader.parse(new InputSource(inputStream)); + + long all = System.currentTimeMillis() - time; + + OseeLog.logf(getClass(), Level.INFO, "It took %d ms total to process.", all); + } + + public String getElapsedTime() { + return elapsedTime; + } + + public String getResults() { + return results; + } + + public String getScriptName() { + return scriptName; + } + + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Actual.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Actual.java new file mode 100644 index 000000000..fb181c68e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Actual.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Actual extends ElementHandlers { + + public Actual() { + super("Actual"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/AdditionalInfo.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/AdditionalInfo.java new file mode 100644 index 000000000..09985cc2e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/AdditionalInfo.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class AdditionalInfo extends ElementHandlers { + + public AdditionalInfo() { + super("AdditionalInfo"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Argument.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Argument.java new file mode 100644 index 000000000..beac9fd6b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Argument.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Argument extends ElementHandlers { + + public Argument() { + super("Argument"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Attention.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Attention.java new file mode 100644 index 000000000..097aaff6c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Attention.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Attention extends ElementHandlers { + + public Attention() { + super("Attention"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroup.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroup.java new file mode 100644 index 000000000..af91245d7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroup.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class CheckGroup extends ElementHandlers { + + public CheckGroup() { + super("CheckGroup"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new CheckGroupData(attributes.getValue("Mode")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroupData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroupData.java new file mode 100644 index 000000000..893ee745d --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckGroupData.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class CheckGroupData { + + private final String mode; + + /** + * @return the mode + */ + public String getMode() { + return mode; + } + + CheckGroupData(String mode) { + this.mode = mode; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckPoint.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckPoint.java new file mode 100644 index 000000000..6ca0712dc --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CheckPoint.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class CheckPoint extends ElementHandlers { + + public CheckPoint() { + super("CheckPoint"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Config.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Config.java new file mode 100644 index 000000000..1c18290d3 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Config.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Config extends ElementHandlers { + + public Config() { + super("Config"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new ConfigData(attributes.getValue("machineName")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ConfigData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ConfigData.java new file mode 100644 index 000000000..5fa71f66d --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ConfigData.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class ConfigData { + private final String machineName; + + /** + * @return the machineName + */ + public String getMachineName() { + return machineName; + } + + public ConfigData(String machineName) { + this.machineName = machineName; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CurrentProcessor.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CurrentProcessor.java new file mode 100644 index 000000000..f615b142d --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/CurrentProcessor.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class CurrentProcessor extends ElementHandlers { + + public CurrentProcessor() { + super("CurrentProcessor"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return attributes.getValue("proc"); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Debug.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Debug.java new file mode 100644 index 000000000..2db07a732 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Debug.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Debug extends ElementHandlers { + + public Debug() { + super("Debug"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ElapsedTime.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ElapsedTime.java new file mode 100644 index 000000000..907e1fe20 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ElapsedTime.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ElapsedTime extends ElementHandlers { + + public ElapsedTime() { + super("ElapsedTime"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Environment.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Environment.java new file mode 100644 index 000000000..9b882c20f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Environment.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Environment extends ElementHandlers { + + public Environment() { + super("Environment"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutedBy.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutedBy.java new file mode 100644 index 000000000..476ea0770 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutedBy.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ExecutedBy extends ElementHandlers { + + public ExecutedBy() { + super("ExecutedBy"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutionDate.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutionDate.java new file mode 100644 index 000000000..53577e7ba --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ExecutionDate.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ExecutionDate extends ElementHandlers { + + public ExecutionDate() { + super("ExecutionDate"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Expected.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Expected.java new file mode 100644 index 000000000..2e58af712 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Expected.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Expected extends ElementHandlers { + + public Expected() { + super("Expected"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Global.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Global.java new file mode 100644 index 000000000..b5a3ac4ed --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Global.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Robert A. Fisher + */ +public class Global extends ElementHandlers { + + public Global() { + super("*"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return name; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/GroupName.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/GroupName.java new file mode 100644 index 000000000..2a6f0fa24 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/GroupName.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class GroupName extends ElementHandlers { + + public GroupName() { + super("GroupName"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Info.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Info.java new file mode 100644 index 000000000..9db505ba0 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Info.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Info extends ElementHandlers { + + public Info() { + super("Info"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new InfoData(attributes.getValue("title")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoData.java new file mode 100644 index 000000000..a809c57bf --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoData.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class InfoData { + + private final String title; + + InfoData(String title) { + this.title = title; + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroup.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroup.java new file mode 100644 index 000000000..77ebb4dab --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroup.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class InfoGroup extends ElementHandlers { + + public InfoGroup() { + super("InfoGroup"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new InfoGroupData(attributes.getValue("title")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroupData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroupData.java new file mode 100644 index 000000000..ae7a17f24 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/InfoGroupData.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class InfoGroupData { + + private final String title; + + InfoGroupData(String title) { + this.title = title; + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Location.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Location.java new file mode 100644 index 000000000..35649fb67 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Location.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Location extends ElementHandlers { + + public Location() { + super("Location"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Message.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Message.java new file mode 100644 index 000000000..24bd66c8f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Message.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Message extends ElementHandlers { + + public Message() { + super("Message"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodArguments.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodArguments.java new file mode 100644 index 000000000..bd05ce5e0 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodArguments.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class MethodArguments extends ElementHandlers { + + public MethodArguments() { + super("MethodArguments"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodName.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodName.java new file mode 100644 index 000000000..2bb33c320 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/MethodName.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class MethodName extends ElementHandlers { + + public MethodName() { + super("MethodName"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Name.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Name.java new file mode 100644 index 000000000..7f3ef6353 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Name.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Name extends ElementHandlers { + + public Name() { + super("Name"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Notes.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Notes.java new file mode 100644 index 000000000..20935d936 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Notes.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Notes extends ElementHandlers { + + public Notes() { + super("Notes"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Number.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Number.java new file mode 100644 index 000000000..5e99840bf --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Number.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Number extends ElementHandlers { + + public Number() { + super("Number"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/NumberOfTransmissions.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/NumberOfTransmissions.java new file mode 100644 index 000000000..29473b64a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/NumberOfTransmissions.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class NumberOfTransmissions extends ElementHandlers { + + public NumberOfTransmissions() { + super("NumberOfTransmissions"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ObjectName.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ObjectName.java new file mode 100644 index 000000000..c8755db20 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ObjectName.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ObjectName extends ElementHandlers { + + public ObjectName() { + super("ObjectName"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntry.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntry.java new file mode 100644 index 000000000..024e89108 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntry.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class OfpErrorEntry extends ElementHandlers { + + public OfpErrorEntry() { + super("OfpErrorEntry"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new OfpErrorEntryData(attributes.getValue("NODE_ID"), attributes.getValue("count"), + attributes.getValue("severity"), attributes.getValue("version")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntryData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntryData.java new file mode 100644 index 000000000..12a89d172 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpErrorEntryData.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class OfpErrorEntryData { + + private final String nodeId; + private final String count; + private final String severity; + private final String version; + + /** + * @return the nodeId + */ + public String getNodeId() { + return nodeId; + } + + /** + * @return the count + */ + public String getCount() { + return count; + } + + /** + * @return the severity + */ + public String getSeverity() { + return severity; + } + + /** + * @return the version + */ + public String getVersion() { + return version; + } + + OfpErrorEntryData(String nodeId, String count, String severity, String version) { + this.nodeId = nodeId; + this.count = count; + this.severity = severity; + this.version = version; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpLoggingInfo.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpLoggingInfo.java new file mode 100644 index 000000000..c57acf82c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OfpLoggingInfo.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class OfpLoggingInfo extends ElementHandlers { + + public OfpLoggingInfo() { + super("OfpLoggingInfo"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLog.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLog.java new file mode 100644 index 000000000..3ddec0d40 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLog.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class OteLog extends ElementHandlers { + + public OteLog() { + super("OteLog"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new OteLogData(attributes.getValue("Level"), attributes.getValue("Logger")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLogData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLogData.java new file mode 100644 index 000000000..3e4be63bb --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/OteLogData.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class OteLogData { + + private final String level; + private final String logger; + + OteLogData(String level, String logger) { + this.level = level; + this.logger = logger; + } + + /** + * @return the level + */ + public String getLevel() { + return level; + } + + /** + * @return the logger + */ + public String getLogger() { + return logger; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandler.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandler.java new file mode 100644 index 000000000..a04065409 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandler.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class PropertyElementHandler extends ElementHandlers { + + public PropertyElementHandler() { + super("Property"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new PropertyElementHandlerData(attributes.getValue("key")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandlerData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandlerData.java new file mode 100644 index 000000000..e203f98da --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyElementHandlerData.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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.ote.core.framework.saxparse.elements; + +public class PropertyElementHandlerData { + + private final String key; + + protected PropertyElementHandlerData(String key){ + this.key = key; + } + + public String getKey() { + return key; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyStoreElementHandler.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyStoreElementHandler.java new file mode 100644 index 000000000..575f4813c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/PropertyStoreElementHandler.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class PropertyStoreElementHandler extends ElementHandlers { + + public PropertyStoreElementHandler() { + super("PropertyStore"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Qualification.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Qualification.java new file mode 100644 index 000000000..2594011c5 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Qualification.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Qualification extends ElementHandlers { + + public Qualification() { + super("Qualification"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new QualificationData(attributes.getValue("buildId"), attributes.getValue("level")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/QualificationData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/QualificationData.java new file mode 100644 index 000000000..9ed1f3f2b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/QualificationData.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class QualificationData { + + private final String buildId; + private final String level; + + public QualificationData(String buildId, String level) { + this.buildId = buildId; + this.level = level; + } + + /** + * @return the buildId + */ + public String getBuildId() { + return buildId; + } + + /** + * @return the level + */ + public String getLevel() { + return level; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Requirement.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Requirement.java new file mode 100644 index 000000000..d14aa9563 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Requirement.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Requirement extends ElementHandlers { + + public Requirement() { + super("Requirement"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Result.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Result.java new file mode 100644 index 000000000..0f81c786a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Result.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Result extends ElementHandlers { + + public Result() { + super("Result"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroup.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroup.java new file mode 100644 index 000000000..279f797b2 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroup.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class RetryGroup extends ElementHandlers { + + public RetryGroup() { + super("RetryGroup"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new RetryGroupData(attributes.getValue("Mode")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroupData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroupData.java new file mode 100644 index 000000000..cd6c55567 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RetryGroupData.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class RetryGroupData { + + private final String mode; + + /** + * @return the mode + */ + public String getMode() { + return mode; + } + + RetryGroupData(String mode) { + this.mode = mode; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ReturnValue.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ReturnValue.java new file mode 100644 index 000000000..4087b010e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ReturnValue.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ReturnValue extends ElementHandlers { + + public ReturnValue() { + super("ReturnValue"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RuntimeVersions.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RuntimeVersions.java new file mode 100644 index 000000000..ff168c6aa --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/RuntimeVersions.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class RuntimeVersions extends ElementHandlers { + + public RuntimeVersions() { + super("RuntimeVersions"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptInit.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptInit.java new file mode 100644 index 000000000..b749e8190 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptInit.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ScriptInit extends ElementHandlers { + + public ScriptInit() { + super("ScriptInit"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptName.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptName.java new file mode 100644 index 000000000..c64ec2eea --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptName.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ScriptName extends ElementHandlers { + + public ScriptName() { + super("ScriptName"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptResult.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptResult.java new file mode 100644 index 000000000..2001e3cf7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptResult.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ScriptResult extends ElementHandlers { + + public ScriptResult() { + super("ScriptResult"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersion.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersion.java new file mode 100644 index 000000000..787a88a2e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersion.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ScriptVersion extends ElementHandlers { + + public ScriptVersion() { + super("ScriptVersion"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new ScriptVersionData(attributes.getValue("lastAuthor"), attributes.getValue("lastModified"), + attributes.getValue("modifiedFlag"), attributes.getValue("repositoryType"), attributes.getValue("revision"), + attributes.getValue("url")); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersionData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersionData.java new file mode 100644 index 000000000..dcc323ff6 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ScriptVersionData.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class ScriptVersionData { + + private final String lastAuthor; + private final String lastModified; + private final String modifiedFlag; + private final String repositoryType; + private final String revision; + private final String url; + + ScriptVersionData(String lastAuthor, String lastModified, String modifiedFlag, String repositoryType, String revision, String url) { + this.lastAuthor = lastAuthor; + this.lastModified = lastModified; + this.modifiedFlag = modifiedFlag; + this.repositoryType = repositoryType; + this.revision = revision; + this.url = url; + } + + /** + * @return the lastAuthor + */ + public String getLastAuthor() { + return lastAuthor; + } + + /** + * @return the lastModified + */ + public String getLastModified() { + return lastModified; + } + + /** + * @return the modifiedFlag + */ + public String getModifiedFlag() { + return modifiedFlag; + } + + /** + * @return the repositoryType + */ + public String getRepositoryType() { + return repositoryType; + } + + /** + * @return the revision + */ + public String getRevision() { + return revision; + } + + /** + * @return the url + */ + public String getUrl() { + return url; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroup.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroup.java new file mode 100644 index 000000000..97377c958 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroup.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class SoftKeyInfoGroup extends ElementHandlers { + + public SoftKeyInfoGroup() { + super("SoftKeyInfoGroup"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new SoftKeyInfoGroupData(attributes.getValue("title")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroupData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroupData.java new file mode 100644 index 000000000..2ac772d72 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SoftKeyInfoGroupData.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class SoftKeyInfoGroupData { + + private final String title; + + SoftKeyInfoGroupData(String title) { + this.title = title; + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Stacktrace.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Stacktrace.java new file mode 100644 index 000000000..d9335537e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Stacktrace.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Stacktrace extends ElementHandlers { + + public Stacktrace() { + super("Stacktrace"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new StacktraceData(attributes.getValue("line"), attributes.getValue("source")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/StacktraceData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/StacktraceData.java new file mode 100644 index 000000000..ba18bcd22 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/StacktraceData.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class StacktraceData { + + private String line; + private String source; + + StacktraceData() { + } + + public StacktraceData(String line, String source) { + this.line = line; + this.source = source; + } + + /** + * @return the line + */ + public String getLine() { + return line; + } + + /** + * @return the source + */ + public String getSource() { + return source; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Summary.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Summary.java new file mode 100644 index 000000000..9a7bfb28b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Summary.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Summary extends ElementHandlers { + + public Summary() { + super("Summary"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new SummaryData(attributes.getValue("CRITICAL_COUNT"), attributes.getValue("EXCEPTION_COUNT"), + attributes.getValue("INFORMATIONAL_COUNT"), attributes.getValue("MINOR_COUNT"), + attributes.getValue("NODE_ID"), attributes.getValue("SERIOUS_COUNT"), attributes.getValue("START_NUMBER")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SummaryData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SummaryData.java new file mode 100644 index 000000000..531681d54 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SummaryData.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class SummaryData { + + private final String criticalCount; + private final String exceptionCount; + private final String informationCount; + private final String minorCount; + private final String nodeId; + private final String seriousCount; + private final String startNumber; + + SummaryData(String criticalCount, String exceptionCount, String informationCount, String minorCount, String nodeId, String seriousCount, String startNumber) { + this.criticalCount = criticalCount; + this.exceptionCount = exceptionCount; + this.informationCount = informationCount; + this.minorCount = minorCount; + this.nodeId = nodeId; + this.seriousCount = seriousCount; + this.startNumber = startNumber; + } + + /** + * @return the criticalCount + */ + public String getCriticalCount() { + return criticalCount; + } + + /** + * @return the exceptionCount + */ + public String getExceptionCount() { + return exceptionCount; + } + + /** + * @return the informationCount + */ + public String getInformationCount() { + return informationCount; + } + + /** + * @return the minorCount + */ + public String getMinorCount() { + return minorCount; + } + + /** + * @return the nodeId + */ + public String getNodeId() { + return nodeId; + } + + /** + * @return the seriousCount + */ + public String getSeriousCount() { + return seriousCount; + } + + /** + * @return the startNumber + */ + public String getStartNumber() { + return startNumber; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Support.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Support.java new file mode 100644 index 000000000..a948eda3e --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Support.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Support extends ElementHandlers { + + public Support() { + super("Support"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfo.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfo.java new file mode 100644 index 000000000..260f8d888 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfo.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class SystemInfo extends ElementHandlers { + + public SystemInfo() { + super("SystemInfo"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + SystemInfoData data = + new SystemInfoData(attributes.getValue("osArch"), attributes.getValue("osName"), + attributes.getValue("osVersion"), attributes.getValue("oseeVersion"), + attributes.getValue("oseeServerTitle")); + return data; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfoData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfoData.java new file mode 100644 index 000000000..86045751c --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/SystemInfoData.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class SystemInfoData { + + private final String osArch; + private final String osName; + private final String osVersion; + private final String oseeVersion; + private final String oseeServerTitle; + + /** + * @return the osArch + */ + public String getOsArch() { + return osArch; + } + + /** + * @return the osName + */ + public String getOsName() { + return osName; + } + + /** + * @return the osVersion + */ + public String getOsVersion() { + return osVersion; + } + + /** + * @return the oseeVersion + */ + public String getOseeVersion() { + return oseeVersion; + } + + /** + * @return the oseeServerTitle + */ + public String getOseeServerTitle() { + return oseeServerTitle; + } + + SystemInfoData(String osArch, String osName, String osVersion, String oseeVersion, String oseeServerTitle) { + this.osArch = osArch; + this.osName = osName; + this.osVersion = osVersion; + this.oseeVersion = oseeVersion; + this.oseeServerTitle = oseeServerTitle; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestCase.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestCase.java new file mode 100644 index 000000000..0890f34ac --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestCase.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestCase extends ElementHandlers { + + public TestCase() { + super("TestCase"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestEventElement.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestEventElement.java new file mode 100644 index 000000000..c1eff0ac8 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestEventElement.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestEventElement extends ElementHandlers { + + public TestEventElement() { + super("TEST_EVENT"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPoint.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPoint.java new file mode 100644 index 000000000..30ad854e5 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPoint.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestPoint extends ElementHandlers { + + public TestPoint() { + super("TestPoint"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointName.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointName.java new file mode 100644 index 000000000..d4cae71dc --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointName.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestPointName extends ElementHandlers { + + public TestPointName() { + super("TestPointName"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResults.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResults.java new file mode 100644 index 000000000..f64147957 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResults.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestPointResults extends ElementHandlers { + + public TestPointResults() { + super("TestPointResults"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + TestPointResultsData data = + new TestPointResultsData(attributes.getValue("aborted"), attributes.getValue("fail"), + attributes.getValue("pass"), attributes.getValue("total")); + return data; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResultsData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResultsData.java new file mode 100644 index 000000000..260999ea6 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestPointResultsData.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestPointResultsData { + + private final String aborted; + + /** + * @return the aborted + */ + public String getAborted() { + return aborted; + } + + /** + * @return the fail + */ + public String getFail() { + return fail; + } + + /** + * @return the pass + */ + public String getPass() { + return pass; + } + + /** + * @return the total + */ + public String getTotal() { + return total; + } + + private final String fail; + private final String pass; + private final String total; + + public TestPointResultsData(String aborted, String fail, String pass, String total) { + this.aborted = aborted; + this.fail = fail; + this.pass = pass; + this.total = total; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestScript.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestScript.java new file mode 100644 index 000000000..fc52df5fe --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TestScript.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TestScript extends ElementHandlers { + + public TestScript() { + super("TestScript"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ThrowableElement.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ThrowableElement.java new file mode 100644 index 000000000..990e972f5 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/ThrowableElement.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class ThrowableElement extends ElementHandlers { + + public ThrowableElement() { + super("Throwable"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Time.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Time.java new file mode 100644 index 000000000..97b514309 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Time.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Time extends ElementHandlers { + + public Time() { + super("Time"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummary.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummary.java new file mode 100644 index 000000000..df14221ce --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummary.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TimeSummary extends ElementHandlers { + + public TimeSummary() { + super("TimeSummary"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + TimeSummaryData data = + new TimeSummaryData(attributes.getValue("elapsed"), attributes.getValue("endDate"), + attributes.getValue("milliseconds"), attributes.getValue("startDate")); + return data; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummaryData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummaryData.java new file mode 100644 index 000000000..f36f31a8b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TimeSummaryData.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class TimeSummaryData { + + private final String elapsed; + + /** + * @return the elapsed + */ + public String getElapsed() { + return elapsed; + } + + /** + * @return the endDate + */ + public String getEndDate() { + return endDate; + } + + /** + * @return the milliseconds + */ + public String getMilliseconds() { + return milliseconds; + } + + /** + * @return the startDate + */ + public String getStartDate() { + return startDate; + } + private final String endDate; + private final String milliseconds; + private final String startDate; + + TimeSummaryData(String elapsed, String endDate, String milliseconds, String startDate) { + this.elapsed = elapsed; + this.endDate = endDate; + this.milliseconds = milliseconds; + this.startDate = startDate; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Tracability.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Tracability.java new file mode 100644 index 000000000..6cdb5ec31 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Tracability.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Tracability extends ElementHandlers { + + public Tracability() { + super("Tracability"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Trace.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Trace.java new file mode 100644 index 000000000..61bfd7dec --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Trace.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Trace extends ElementHandlers { + + public Trace() { + super("Trace"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TraceEnd.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TraceEnd.java new file mode 100644 index 000000000..e67e3a3a4 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/TraceEnd.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class TraceEnd extends ElementHandlers { + + public TraceEnd() { + super("TraceEnd"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Type.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Type.java new file mode 100644 index 000000000..11daefc75 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Type.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Type extends ElementHandlers { + + public Type() { + super("Type"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/User.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/User.java new file mode 100644 index 000000000..9f0269c2f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/User.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class User extends ElementHandlers { + + public User() { + super("User"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new UserData(attributes.getValue("email"), attributes.getValue("id"), attributes.getValue("name")); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/UserData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/UserData.java new file mode 100644 index 000000000..656a2beb7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/UserData.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class UserData { + + private final String email; + private final String id; + private final String name; + + UserData(String email, String id, String name) { + this.email = email; + this.id = id; + this.name = name; + } + + /** + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Value.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Value.java new file mode 100644 index 000000000..c8ffaecbf --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Value.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Value extends ElementHandlers { + + public Value() { + super("Value"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Version.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Version.java new file mode 100644 index 000000000..daead80a4 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Version.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Version extends ElementHandlers { + + public Version() { + super("Version"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return new VersionData(attributes.getValue("name"), attributes.getValue("underTest"), + attributes.getValue("version"), attributes.getValue("versionUnit")); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionData.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionData.java new file mode 100644 index 000000000..09a49164f --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionData.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +/** + * @author Andrew M. Finkbeiner + */ +public class VersionData { + + private final String name; + private final String underTest; + private final String version; + private final String versionUnit; + + VersionData(String name, String underTest, String version, String versionUnit) { + this.name = name; + this.underTest = underTest; + this.version = version; + this.versionUnit = versionUnit; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the underTest + */ + public String getUnderTest() { + return underTest; + } + + /** + * @return the version + */ + public String getVersion() { + return version; + } + + /** + * @return the versionUnit + */ + public String getVersionUnit() { + return versionUnit; + } + +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionInformation.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionInformation.java new file mode 100644 index 000000000..d869146be --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/VersionInformation.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class VersionInformation extends ElementHandlers { + + public VersionInformation() { + super("VersionInformation"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Witnesses.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Witnesses.java new file mode 100644 index 000000000..6d7f568c3 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/saxparse/elements/Witnesses.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * 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.core.framework.saxparse.elements; + +import org.eclipse.osee.ote.core.framework.saxparse.ElementHandlers; +import org.xml.sax.Attributes; + +/** + * @author Andrew M. Finkbeiner + */ +public class Witnesses extends ElementHandlers { + + public Witnesses() { + super("Witnesses"); + } + + @Override + public Object createStartElementFoundObject(String uri, String localName, String name, Attributes attributes) { + return null; + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerDataProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerDataProvider.java new file mode 100644 index 000000000..0b98b90ad --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerDataProvider.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestCase; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.framework.event.BaseEvent; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public class BaseTestRunListenerDataProvider implements ITestRunListenerDataProvider { + + public IEventData create(IPropertyStore properties, TestScript test, TestCase testCase) { + return new BaseEvent(properties, test, testCase); + } + + @Override + public IEventData createOnPostRun(IPropertyStore propertyStore, TestScript test) { + return new BaseEvent(propertyStore, test); + } + + @Override + public IEventData createOnPostTestCase(IPropertyStore propertyStore, TestScript test, TestCase testCase) { + return new BaseEvent(propertyStore, test, testCase); + } + + @Override + public IEventData createOnPreRun(IPropertyStore propertyStore, TestScript test) { + return new BaseEvent(propertyStore, test); + } + + @Override + public IEventData createOnPreTestCase(IPropertyStore propertyStore, TestScript test, TestCase testCase) { + return new BaseEvent(propertyStore, test, testCase); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProvider.java new file mode 100644 index 000000000..7f93cde32 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProvider.java @@ -0,0 +1,131 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.logging.Level; +import org.eclipse.osee.framework.logging.BaseStatus; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.MethodResultImpl; +import org.eclipse.osee.ote.core.framework.ReturnCode; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public class BaseTestRunListenerProvider implements ITestRunListenerProvider { + + List<ITestRunListener> listeners; + + public BaseTestRunListenerProvider() { + listeners = new CopyOnWriteArrayList<>(); + } + + @Override + public boolean addTestRunListener(ITestRunListener listener) { + return listeners.add(listener); + } + + @Override + public boolean removeTestRunListener(ITestRunListener listener) { + return listeners.remove(listener); + } + + @Override + public IMethodResult notifyPostRun(IEventData eventData) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + boolean failed = false; + for (ITestRunListener listener : listeners) { + try { + result = collectStatus(result, listener.postRun(eventData)); + } catch (Throwable th) { + failed = true; + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, th)); + } + } + if (failed) { + result.setReturnCode(ReturnCode.ERROR); + } + return result; + } + + @Override + public IMethodResult notifyPostTestCase(IEventData eventData) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + boolean failed = false; + for (ITestRunListener listener : listeners) { + try { + result = collectStatus(result, listener.postTestCase(eventData)); + } catch (Throwable th) { + failed = true; + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, th)); + } + } + if (failed) { + result.setReturnCode(ReturnCode.ERROR); + } + return result; + } + + @Override + public IMethodResult notifyPreRun(IEventData eventData) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + boolean failed = false; + for (ITestRunListener listener : listeners) { + try { + result = collectStatus(result, listener.preRun(eventData)); + } catch (Throwable th) { + failed = true; + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, th)); + } + } + if (failed) { + result.setReturnCode(ReturnCode.ERROR); + } + return result; + } + + @Override + public IMethodResult notifyPreTestCase(IEventData eventData) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + boolean failed = false; + for (ITestRunListener listener : listeners) { + try { + result = collectStatus(result, listener.preTestCase(eventData)); + } catch (Throwable th) { + failed = true; + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, th)); + } + } + if (failed) { + result.setReturnCode(ReturnCode.ERROR); + } + return result; + } + + private MethodResultImpl collectStatus(MethodResultImpl result, IMethodResult listenerResult) { + if (listenerResult.getReturnCode() != ReturnCode.OK) { + if (result.getReturnCode() == ReturnCode.OK) { + result = new MethodResultImpl(ReturnCode.OK); + } + result.setReturnCode(listenerResult.getReturnCode()); + result.addStatus(listenerResult.getStatus()); + } + return result; + } + + /** + * Clearing out the listeners. + */ + @Override + public void clear() { + listeners.clear(); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProviderFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProviderFactory.java new file mode 100644 index 000000000..545ee1477 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunListenerProviderFactory.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +public class BaseTestRunListenerProviderFactory implements ITestRunListenerProviderFactory { + + @Override + public ITestRunListenerDataProvider createListenerDataProvider() { + return new BaseTestRunListenerDataProvider(); + } + + @Override + public ITestRunListenerProvider createRunListenerProvider() { + return new BaseTestRunListenerProvider(); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunManager.java new file mode 100644 index 000000000..17af221cc --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/BaseTestRunManager.java @@ -0,0 +1,146 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import java.util.logging.Level; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.framework.logging.BaseStatus; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.MethodResultImpl; +import org.eclipse.osee.ote.core.framework.ReturnCode; +import org.eclipse.osee.ote.core.internal.Activator; +import org.eclipse.osee.ote.core.log.GCHelper; + +public class BaseTestRunManager implements ITestRunManager { + + private final ITestFactory testFactory; + private final ITestRunListenerProviderFactory testRunListenerProviderFactory; + + private TestScript test; + private TestRunThread testRunThread; + private ITestRunListenerDataProvider dataProvider; + private ITestRunListenerProvider listenerProvider; + private boolean aborted; + + public BaseTestRunManager(ITestFactory testFactory, ITestRunListenerProviderFactory testRunListenerProviderFactory) { + this.testFactory = testFactory; + this.testRunListenerProviderFactory = testRunListenerProviderFactory; + } + + @Override + public boolean abort() { + if (test != null) { + test.abort(); + } + aborted = true; + if (testRunThread != null) { + return testRunThread.abort(); + } + return true; + } + + @Override + public IMethodResult run(IPropertyStore propertyStore, TestEnvironment environment) { + IMethodResult result = new MethodResultImpl(ReturnCode.OK); + if (aborted) { + aborted = false; + MethodResultImpl methodresult = new MethodResultImpl(ReturnCode.ABORTED); + methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, "USER ABORTED")); + result = methodresult; + return result; + } + try { + GCHelper.enable(true); + testRunThread = new TestRunThread(propertyStore, test, environment, listenerProvider, dataProvider); + testRunThread.start(); + testRunThread.join(); + result = testRunThread.getResult(); + } catch (Exception ex) { + MethodResultImpl methodresult = new MethodResultImpl(ReturnCode.ERROR); + methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, ex)); + result = methodresult; + OseeLog.log(Activator.class, Level.SEVERE, ex); + } finally { + GCHelper.enable(false); + aborted = false; + testRunThread = null; + } + return result; + } + + @Override + public TestScript getTest() { + return test; + } + + @Override + public IMethodResult dispose() { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + try { + this.test.disposeTest(); + this.dataProvider = null; + this.listenerProvider.clear(); + this.listenerProvider = null; + this.test = null; + } catch (Exception ex) { + result = new MethodResultImpl(ReturnCode.ERROR); + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, ex)); + OseeLog.log(Activator.class, Level.SEVERE, ex); + } + return result; + } + + @Override + public IMethodResult initialize(TestEnvironment env, IPropertyStore propertyStore) { + MethodResultImpl result = new MethodResultImpl(ReturnCode.OK); + try { + aborted = false; + this.dataProvider = testRunListenerProviderFactory.createListenerDataProvider(); + this.listenerProvider = testRunListenerProviderFactory.createRunListenerProvider(); + this.test = testFactory.createInstance(env, propertyStore); + this.test.setListenerProvider(listenerProvider); + } catch (Exception ex) { + result = new MethodResultImpl(ReturnCode.ERROR); + result.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, ex)); + OseeLog.log(Activator.class, Level.SEVERE, ex); + } + return result; + } + + @Override + public boolean abort(Throwable th, boolean wait) { + if (test != null) { + test.abort(); + } + aborted = true; + if (testRunThread != null) { + return testRunThread.abort(th, wait); + } + return true; + } + + @Override + public boolean isAborted() { + return aborted; + } + + @Override + public boolean isCurrentThreadScript() { + if (testRunThread != null) { + return Thread.currentThread() == testRunThread.getThread(); + } + return false; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestFactory.java new file mode 100644 index 000000000..94f074e42 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestFactory.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +public interface ITestFactory { + + TestScript createInstance(TestEnvironment env, IPropertyStore properties) throws Exception; + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollector.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollector.java new file mode 100644 index 000000000..44fd62f0a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollector.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.environment.TestEnvironment; + +/** + * @author Roberto E. Escobar + */ +public interface ITestResultCollector { + + public void initialize(IPropertyStore propertyStore, TestEnvironment testEnvironment) throws Exception; + + public void dispose(TestEnvironment testEnvironment) throws Exception; + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollectorFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollectorFactory.java new file mode 100644 index 000000000..7f1c25aea --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestResultCollectorFactory.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +/** + * @author Roberto E. Escobar + */ +public interface ITestResultCollectorFactory { + + public ITestResultCollector createCollector(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListener.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListener.java new file mode 100644 index 000000000..1a7cd8683 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListener.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public interface ITestRunListener { + + IMethodResult preRun(IEventData eventData); + + IMethodResult preTestCase(IEventData eventData); + + IMethodResult postTestCase(IEventData eventData); + + IMethodResult postRun(IEventData eventData); +}
\ No newline at end of file diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerDataProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerDataProvider.java new file mode 100644 index 000000000..7326f7ce7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerDataProvider.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestCase; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public interface ITestRunListenerDataProvider { + + IEventData createOnPreRun(IPropertyStore propertyStore, TestScript test); + + IEventData createOnPreTestCase(IPropertyStore propertyStore, TestScript test, TestCase object); + + IEventData createOnPostTestCase(IPropertyStore propertyStore, TestScript test, TestCase object); + + IEventData createOnPostRun(IPropertyStore propertyStore, TestScript test); + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProvider.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProvider.java new file mode 100644 index 000000000..1eaeee0f0 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProvider.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.event.IEventData; + +public interface ITestRunListenerProvider { + + boolean addTestRunListener(ITestRunListener listener); + + boolean removeTestRunListener(ITestRunListener listener); + + IMethodResult notifyPreRun(IEventData eventData); + + IMethodResult notifyPreTestCase(IEventData eventData); + + IMethodResult notifyPostTestCase(IEventData eventData); + + IMethodResult notifyPostRun(IEventData eventData); + + void clear(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProviderFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProviderFactory.java new file mode 100644 index 000000000..0e4f4a31b --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunListenerProviderFactory.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +public interface ITestRunListenerProviderFactory { + ITestRunListenerProvider createRunListenerProvider(); + + ITestRunListenerDataProvider createListenerDataProvider(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunManager.java new file mode 100644 index 000000000..93974e9fd --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/ITestRunManager.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.IMethodResult; + +public interface ITestRunManager { + + IMethodResult initialize(TestEnvironment env, IPropertyStore propertyStore); + + IMethodResult run(IPropertyStore propertyStore, TestEnvironment environment); + + IMethodResult dispose(); + + TestScript getTest(); + + boolean abort(); + + boolean abort(Throwable th, boolean wait); + + boolean isAborted(); + + boolean isCurrentThreadScript(); +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java new file mode 100644 index 000000000..a0a1e754a --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/testrun/TestRunThread.java @@ -0,0 +1,171 @@ +/******************************************************************************* + * 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.core.framework.testrun; + +import java.util.List; +import java.util.logging.Level; + +import org.eclipse.osee.framework.jdk.core.type.IPropertyStore; +import org.eclipse.osee.framework.logging.BaseStatus; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.ote.core.OseeTestThread; +import org.eclipse.osee.ote.core.TestCase; +import org.eclipse.osee.ote.core.TestException; +import org.eclipse.osee.ote.core.TestScript; +import org.eclipse.osee.ote.core.environment.TestEnvironment; +import org.eclipse.osee.ote.core.framework.IMethodResult; +import org.eclipse.osee.ote.core.framework.MethodResultImpl; +import org.eclipse.osee.ote.core.framework.ResultBuilder; +import org.eclipse.osee.ote.core.framework.ReturnCode; +import org.eclipse.osee.ote.core.internal.Activator; +import org.eclipse.osee.ote.properties.OtePropertiesCore; + +public class TestRunThread extends OseeTestThread { + + private final TestScript test; + private final ITestRunListenerProvider listenerProvider; + private final ITestRunListenerDataProvider dataProvider; + private final IPropertyStore propertyStore; + private volatile boolean abort = false; + private final ResultBuilder rb = new ResultBuilder(false); + + public TestRunThread(IPropertyStore propertyStore, TestScript test, TestEnvironment env, ITestRunListenerProvider listenerProvider, ITestRunListenerDataProvider dataProvider) { + super(test.getClass().getSimpleName(), env); + this.test = test; + this.listenerProvider = listenerProvider; + this.dataProvider = dataProvider; + this.propertyStore = propertyStore; + } + + @Override + protected void run() throws Exception { + try { + rb.append(listenerProvider.notifyPreRun(dataProvider.createOnPreRun(propertyStore, test))); + if (rb.isReturnStatusOK()) { + List<TestCase> testCases = test.getTestCases(); + for (int i = 0; i < testCases.size(); i++) { + if (abort) { + Thread.interrupted();//clear the interrupted flag so that cleanup can occur without exception + addAbortResult(null); + i = testCases.size() - 1;//set to the last test case - TearDown + } + TestCase testCase = testCases.get(i); + if (testCase == null) { + continue; + } + + rb.append(listenerProvider.notifyPreTestCase(dataProvider.createOnPreTestCase(propertyStore, test, + testCase))); + try { + testCase.baseDoTestCase(getEnvironment()); + if (Thread.interrupted()) { + throw new InterruptedException("Thread probably aborted"); + } + } catch (Throwable ex) { + if (abort) { + addAbortResult(null); + } else { + abort = true; + this.test.setAborted(true); + MethodResultImpl methodresult = new MethodResultImpl(ReturnCode.ABORTED); + Throwable clientSideThrowable = ex; + if (!ex.getClass().getName().startsWith("java")) { + String msg = ex.getClass().getName(); + if (ex.getMessage() != null && !ex.getMessage().isEmpty()) { + msg += ": "+ex.getMessage(); + } + Throwable removeThisOnceWeGetRidOfSerializationOnAssociatedException = new Throwable(msg); + removeThisOnceWeGetRidOfSerializationOnAssociatedException.setStackTrace(ex.getStackTrace()); + clientSideThrowable = removeThisOnceWeGetRidOfSerializationOnAssociatedException; + } + methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, clientSideThrowable)); + rb.append(methodresult); + OseeLog.log( + Activator.class, + Level.SEVERE, + "Exception running Test Case [" + testCase != null ? testCase.getClass().getName() : "unknown (null test case)" + "]", + ex); + } + } + rb.append(listenerProvider.notifyPostTestCase(dataProvider.createOnPostTestCase(propertyStore, test, testCase))); + } + } + } finally { + Thread.interrupted();//clear the interrupted flag so that cleanup can occur without exception + rb.append(listenerProvider.notifyPostRun(dataProvider.createOnPostRun(propertyStore, test))); + if (getEnvironment().getScriptCtrl().isLocked()) { + getEnvironment().getScriptCtrl().unlock(); + } + } + } + + private void addAbortResult(Throwable th) { + if (rb.isReturnStatusOK()) { + MethodResultImpl methodresult = new MethodResultImpl(ReturnCode.ABORTED); + if (th == null) { + methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, "USER ABORTED")); + } else { + methodresult.addStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, th)); + } + rb.append(methodresult); + } + } + + public boolean abort() { + abort = true; + this.test.setAborted(true); + if (Thread.currentThread() == this.getThread()) { + throw new TestException("", Level.SEVERE); + } + if(OtePropertiesCore.abortMultipleInterrupt.getBooleanValue()){ + this.interrupt(); + try{ + this.join(1000*60); + } catch (InterruptedException ex){ + } + } else { + int count = 0; + do{ + this.interrupt(); + try{ + this.join(10); + } catch (InterruptedException ex){ + } + count++; + } while (this.isAlive() && count < 200); + } + if (this.isAlive()) { + OseeLog.reportStatus(new BaseStatus(TestEnvironment.class.getName(), Level.SEVERE, + "Waited 60s for test to abort but the thread did not die.")); + return false; + } + return true; + } + + public boolean abort(Throwable th, boolean wait) { + if (abort) { + return true; + } + abort = true; + this.test.setAborted(true); + addAbortResult(th); + if (Thread.currentThread() == this.getThread()) { + throw new TestException("", Level.SEVERE); + } + this.interrupt(); + return true; + } + + public IMethodResult getResult() { + return rb.get(); + } + +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThread.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThread.java new file mode 100644 index 000000000..add930bb7 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThread.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.core.framework.thread; + +public class OteThread extends Thread { + + protected OteThread(String name) { + super(name); + + } + + protected OteThread(Runnable arg0, String name) { + super(arg0, name); + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadFactory.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadFactory.java new file mode 100644 index 000000000..ba82b5eb3 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadFactory.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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.core.framework.thread; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ThreadFactory; + +/** + * @author Roberto E. Escobar + */ +public class OteThreadFactory implements ThreadFactory { + + private final List<WeakReference<OteThread>> threads; + private final String threadName; + + protected OteThreadFactory(String threadName) { + this.threadName = threadName; + this.threads = new CopyOnWriteArrayList<>(); + } + + @Override + public Thread newThread(Runnable runnable) { + OteThread thread = new OteThread(runnable, threadName + ":" + threads.size()); + this.threads.add(new WeakReference<OteThread>(thread)); + return thread; + } + + public List<OteThread> getThreads() { + List<OteThread> toReturn = new ArrayList<>(); + for (WeakReference<OteThread> weak : threads) { + OteThread thread = weak.get(); + if (thread != null) { + toReturn.add(thread); + } + } + return toReturn; + } +} diff --git a/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadManager.java b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadManager.java new file mode 100644 index 000000000..d5c4f7af2 --- /dev/null +++ b/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/thread/OteThreadManager.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * 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.core.framework.thread; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ThreadFactory; + +/** + * @author Roberto E. Escobar + */ +public class OteThreadManager { + + private static OteThreadManager instance = null; + + private final Map<String, OteThreadFactory> factories; + + private OteThreadManager() { + this.factories = new HashMap<>(); + } + + public static OteThreadManager getInstance() { + if (instance == null) { + instance = new OteThreadManager(); + } + return instance; + } + + public ThreadFactory createNewFactory(String threadName) { + OteThreadFactory factory = new OteThreadFactory(threadName); + factories.put(threadName, factory); + return factory; + } + + public List<OteThread> getThreadsFromFactory(String key) { + OteThreadFactory factory = factories.get(key); + return factory.getThreads(); + } + + public Set<String> getFactories() { + return factories.keySet(); + } +}
\ No newline at end of file |