Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-03-12 18:27:25 +0000
committerrescobar2010-03-12 18:27:25 +0000
commit205aa057fa925d37a3a5375aa8418b9567e99c6d (patch)
treed33f80b9f727c479b8031aeb352494c38ad9878d /plugins/org.eclipse.osee.ote.ui.test.manager
parent0e6d2b595cfb4d54eccdf3479e7c5d74d9c736a5 (diff)
downloadorg.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.tar.gz
org.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.tar.xz
org.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.zip
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.test.manager')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/.classpath7
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/.project28
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/META-INF/MANIFEST.MF49
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/build.properties10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmAdvancedPage.xml8
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmHostsPage.xml6
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmOverviewPage.xml6
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmScriptsPage.xml6
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/SourcePage.JPGbin0 -> 79534 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.JPGbin0 -> 89536 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.html20
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.JPGbin0 -> 110968 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.html27
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage2.JPGbin0 -> 112714 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/overview.html24
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.html16
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.jpgbin0 -> 79613 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.JPGbin0 -> 88643 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.html57
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage2.JPGbin0 -> 96180 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage3.JPGbin0 -> 1739274 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage4.JPGbin0 -> 97424 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/sourcePage.html17
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.html19
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.xml8
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.html19
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.xml15
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javadev.html24
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javaprog.html25
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/train_wbench.html32
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/training.html25
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/help/training.xml17
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/add.gifbin0 -> 298 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/alert_obj.gifbin0 -> 146 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/binoculars.gifbin0 -> 964 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/check.gifbin0 -> 131 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_disabled.gifbin0 -> 90 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_enabled.gifbin0 -> 343 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/connected.gifbin0 -> 1312 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_plug.gifbin0 -> 328 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_sm.gifbin0 -> 1049 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput.gifbin0 -> 683 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput_sm.gifbin0 -> 617 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/delete.gifbin0 -> 163 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/disconnected_plug.gifbin0 -> 928 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/environment.gifbin0 -> 946 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/error.gifbin0 -> 84 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/error_stack.gifbin0 -> 603 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/file.gifbin0 -> 354 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/file_delete.gifbin0 -> 995 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput.gifbin0 -> 680 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput_sm.gifbin0 -> 616 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/fldr_obj.gifbin0 -> 916 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/glasses.gifbin0 -> 909 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/green_bug.gifbin0 -> 949 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/import_wiz.gifbin0 -> 327 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/light_bolt.gifbin0 -> 1049 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/loadConfig.gifbin0 -> 950 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput.gifbin0 -> 684 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput_sm.gifbin0 -> 611 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/ofp.gifbin0 -> 913 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/red_bug.gifbin0 -> 924 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/save_edit.gifbin0 -> 1039 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/saveas_edit.gifbin0 -> 982 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled.gifbin0 -> 1797 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled_sm.gifbin0 -> 1035 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling.gifbin0 -> 2042 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling_sm.gifbin0 -> 1033 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete.gifbin0 -> 2354 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete_sm.gifbin0 -> 1034 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue.gifbin0 -> 1971 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue_sm.gifbin0 -> 1034 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput.gifbin0 -> 1723 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput_sm.gifbin0 -> 1036 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady.gifbin0 -> 1988 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady_sm.gifbin0 -> 1035 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptRunning.gifbin0 -> 676 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_abort_stop.gifbin0 -> 190 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_batch_abort_stop.gifbin0 -> 908 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_run_exec.gifbin0 -> 987 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/showerr_tsk.gifbin0 -> 1005 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/test.gifbin0 -> 208 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/tm.gifbin0 -> 70 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/tmError.gifbin0 -> 96 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/tracability.gifbin0 -> 871 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_abort_stop.gifbin0 -> 137 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_batch_abort_stop.gifbin0 -> 153 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_run_exec.gifbin0 -> 968 bytes
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/plugin.xml204
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_executionOptions.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_markerOptions.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_scriptOptions.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_hostsPage.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_overviewPage.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_scriptsPage.html10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/ITestManagerFactory.java37
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/OteTestManagerImage.java73
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerEditorAction.java54
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java69
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/TMBugAction.java29
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchDecorator.java70
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchProjectNature.java235
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/AddTestBatchProjectNature.java104
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/RemoveTestBatchProjectNature.java113
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ITestBatchDataListener.java21
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ProjectSetupItem.java47
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/RefreshOteNavigator.java53
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchData.java56
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchRegistry.java101
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java90
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupViewItems.java54
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/ResourceFinder.java103
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/SelectionUtil.java65
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFactory.java62
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFileHandler.java60
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ILoadConfig.java19
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ISaveConfig.java22
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadConfigurationOperation.java64
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadWidget.java110
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/SaveWidget.java137
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/LoadScriptPage.java155
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/SaveScriptPage.java91
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/ScriptPageConstants.java25
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptManager.java216
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptQueue.java41
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.done41
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.java37
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java354
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerStatusListener.java32
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/PageManager.java183
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditor.java588
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorContributor.java123
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInput.java154
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInputFactory.java29
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerInput.java142
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerModel.java215
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/internal/TestManagerPlugin.java100
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/ScriptRunJob.java147
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java170
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/FileModel.java166
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModel.java112
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.done70
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.java67
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/ScriptModel.java178
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/operations/AddIFileToTestManager.java91
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/AdvancedPage.java166
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/HostPage.java99
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/OverviewPage.java172
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java470
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/StatusWindowWidget.java135
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/TestManagerPage.java91
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/ScriptExecutionContribution.java109
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/TestManagerStorageKeys.java25
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ITaskListViewer.java42
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTableViewer.java505
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTask.java171
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTaskList.java131
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTable.java92
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableContentProvider.java73
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableFactory.java76
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableLabelProvider.java125
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java160
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/LoggingPanel.java137
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/ScriptExecutionOptionsPanel.java61
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/TestManagerPreferencePage.java96
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageDataViewer.java137
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageEventHandler.java127
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferenceNode.java53
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferencePage.java313
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/Dialogs.java26
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialog.java161
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialogHelper.java56
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialog.java121
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialogHelper.java54
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/PluginUtil.java67
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/TestManagerSelectDialog.java71
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/WidgetFactory.java64
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizard.java170
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizardPage.java207
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/support/output.xsd191
182 files changed, 10869 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/.classpath b/plugins/org.eclipse.osee.ote.ui.test.manager/.classpath
new file mode 100644
index 0000000000..8a8f1668cd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/.project b/plugins/org.eclipse.osee.ote.ui.test.manager/.project
new file mode 100644
index 0000000000..3893fc2b84
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.ote.ui.test.manager</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..5ebe512e63
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Mon Dec 19 15:23:15 MST 2005
+eclipse.preferences.version=1
+encoding//support/output.xsd=UTF8
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..0c4c484a16
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Nov 10 15:59:03 MST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.ui.test.manager/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..b6e3db6be6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/META-INF/MANIFEST.MF
@@ -0,0 +1,49 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OSEE Test Manager Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.ote.ui.test.manager;singleton:=true
+Bundle-Version: 0.9.2.qualifier
+Bundle-Activator: org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin
+Bundle-Vendor: Eclipse.org
+Export-Package: org.eclipse.osee.ote.ui.test.manager,
+ org.eclipse.osee.ote.ui.test.manager.actions,
+ org.eclipse.osee.ote.ui.test.manager.configuration,
+ org.eclipse.osee.ote.ui.test.manager.configuration.pages,
+ org.eclipse.osee.ote.ui.test.manager.connection,
+ org.eclipse.osee.ote.ui.test.manager.core,
+ org.eclipse.osee.ote.ui.test.manager.jobs,
+ org.eclipse.osee.ote.ui.test.manager.models,
+ org.eclipse.osee.ote.ui.test.manager.operations,
+ org.eclipse.osee.ote.ui.test.manager.pages,
+ org.eclipse.osee.ote.ui.test.manager.pages.contributions,
+ org.eclipse.osee.ote.ui.test.manager.pages.scriptTable,
+ org.eclipse.osee.ote.ui.test.manager.panels,
+ org.eclipse.osee.ote.ui.test.manager.preferences,
+ org.eclipse.osee.ote.ui.test.manager.preferences.environment,
+ org.eclipse.osee.ote.ui.test.manager.util,
+ org.eclipse.osee.ote.ui.test.manager.wizards
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.osee.ote.client,
+ org.eclipse.osee.ote.core,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.osee.framework.jdk.core,
+ org.eclipse.osee.ote.message,
+ org.eclipse.osee.framework.plugin.core,
+ org.eclipse.osee.framework.ui.plugin,
+ org.eclipse.osee.framework.ui.swt,
+ org.eclipse.osee.framework.svn,
+ org.eclipse.osee.ote.ui.markers,
+ org.eclipse.jface.text,
+ org.eclipse.osee.ote.ui,
+ org.eclipse.osee.ote.connection.service,
+ org.eclipse.osee.framework.logging,
+ org.eclipse.nebula.widgets.xviewer
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.apache.xml.serialize;version="2.9.0",
+ org.eclipse.jdt.core,
+ org.eclipse.osee.framework.core.exception
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/build.properties b/plugins/org.eclipse.osee.ote.ui.test.manager/build.properties
new file mode 100644
index 0000000000..625b6621f6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ images/,\
+ META-INF/,\
+ contexts/,\
+ help/,\
+ references/,\
+ support/,\
+ .
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmAdvancedPage.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmAdvancedPage.xml
new file mode 100644
index 0000000000..82d9f6f21e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmAdvancedPage.xml
@@ -0,0 +1,8 @@
+<contexts>
+ <context id="tm_advanced_page" title="Test Manager Advanced Page">
+ <description>Provides options of the execution and analysis of OSEE test programs.</description>
+ <topic href="references/tm_advancedPage_scriptOptions.html" label="Script Options"/>
+ <topic href="references/tm_advancedPage_executionOptions.html" label="Execution Options"/>
+ <topic href="references/tm_advancedPage_markerOptions.html" label="Marker Options"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmHostsPage.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmHostsPage.xml
new file mode 100644
index 0000000000..884231b23f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmHostsPage.xml
@@ -0,0 +1,6 @@
+<contexts>
+ <context id="tm_hosts_page" title="Test Manager Hosts Page">
+ <description>Displays available test servers, and allows you to connect to them and look at there current status.</description>
+ <topic href="references/tm_hostsPage.html" label="Connecting to and Viewing Test Servers"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmOverviewPage.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmOverviewPage.xml
new file mode 100644
index 0000000000..51bf2b36f4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmOverviewPage.xml
@@ -0,0 +1,6 @@
+<contexts>
+ <context id="tm_overview_page" title="Test Manager Overview Page">
+ <description>Displays overview information and provides a bug report mechanism.</description>
+ <topic label="Report a bug" href="../osee.ats/reference/report_a_bug.html"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmScriptsPage.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmScriptsPage.xml
new file mode 100644
index 0000000000..7f29692deb
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/contexts/tmScriptsPage.xml
@@ -0,0 +1,6 @@
+<contexts>
+ <context id="tm_scripts_page" title="Test Manager Scripts Page">
+ <description>Controls the exections of test programs.</description>
+ <topic href="references/tm_scriptsPage.html" label="Running Test Programs"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/SourcePage.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/SourcePage.JPG
new file mode 100644
index 0000000000..bc468f9e2d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/SourcePage.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.JPG
new file mode 100644
index 0000000000..18e68528c0
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.html
new file mode 100644
index 0000000000..e734625ac4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/advancedPage.html
@@ -0,0 +1,20 @@
+<html>
+
+ <head>
+ <title>Test Manager Hosts Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Test Manager Advanced Page</h1>
+ <p>The Advanced Page of the Test Manager is the page where configuration
+ options can be set.&nbsp; This page can be tailored to the individual
+ needs of the project that is employing the Test Manager.&nbsp; In the
+ example shown, the term ofp is the name for the code that is being
+ tested.</p>
+
+ <h2><img border="0" src="advancedPage.JPG" width="827" height="731"></h2>
+ <h2>&nbsp;</h2>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.JPG
new file mode 100644
index 0000000000..3a9b982546
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.html
new file mode 100644
index 0000000000..3d5520aff8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage.html
@@ -0,0 +1,27 @@
+<html>
+
+ <head>
+ <title>Test Manager Hosts Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Test Manager Hosts Page</h1>
+ <p>The Hosts page of Test Manager shows the test servers that are available for the user to
+ connect to. These test servers are the services that the test scripts code is actually run.&nbsp; Below is a screenshot showing an example of the Hosts tab with a test server available
+ to be connected to before the user is connected. A user can connect a test server from
+ this page.&nbsp; This table is an XViewer Table which allows the user to
+ employ column sorting.</p>
+
+ <h2><img border="0" src="hostsPage.JPG"></h2>
+ <p>&nbsp;</p>
+ <p>&nbsp;</p>
+
+ <p>Below is the same example after a user named osee has connected to the test server.
+ Notice the lightning bolt in the left column of the server entry in the table and the
+ user's name in the User column.<p>
+
+ <h2><img border="0" src="hostsPage2.JPG"></h2>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage2.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage2.JPG
new file mode 100644
index 0000000000..eebf6f4694
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/hostsPage2.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/overview.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overview.html
new file mode 100644
index 0000000000..d6acedff70
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overview.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+<h1>Test Manager Overview</h1>
+
+<p>
+The test manager is the application that is used to run test programs in the OTE (OSEE Test
+Environment). The Test Manager is in the editor area of Eclipse.
+</p>
+<p>
+In the OTE, tests are run which are referred to as test scripts. The Test Manager has multiple
+pages which are used to manage the running of these scripts. To navigate to each page, the user selects
+the associated tab on the bottom of the Test Manager. The Overview page can be configured
+with some basic overview info for the particular configuration that is extending the OTE.
+The Hosts page allows the user to see and connect to test environments that are used in the running
+of scripts. The Scripts page is the page where the scripts are actually run. The Advanced page
+has many configuration options related to the running of scripts. The Source page is where codes
+to run the scripts against can be specified.
+</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.html
new file mode 100644
index 0000000000..000bfd98e0
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.html
@@ -0,0 +1,16 @@
+<html>
+
+ <head>
+ <title>Test Manager Overview Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Test Manager Overview Page</h1>
+ The Overview page of Test Manager allows for some brief overview information related
+ to the configuration of the Test Manager.
+
+ <h2><img border="0" src="overviewPage.jpg"></h2>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.jpg b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.jpg
new file mode 100644
index 0000000000..1e28862c8b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/overviewPage.jpg
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.JPG
new file mode 100644
index 0000000000..c6ca61a901
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.html
new file mode 100644
index 0000000000..0e863240e4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage.html
@@ -0,0 +1,57 @@
+<html>
+
+ <head>
+ <title>Test Manager Hosts Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Test Manager Scripts Page</h1>
+ <p>The Scripts page of Test Manager is the page that is the main
+ controller of running test scripts.&nbsp; Below is a screenshot of the
+ Script page with no scripts in it.&nbsp; There is a box near the bottom
+ that has information related to the running of the scripts.&nbsp; There
+ are also widgets along the top of the page that allow for saving and
+ loading of script run lists, clearing out of scripts highlighted, code
+ to run against selection, and a test server connection widget.&nbsp; The
+ running and aborting widgets are there as well, though they are grayed
+ out since the user is not connected to a test server yet.&nbsp;
+ </p>
+
+ <h2>
+ <img border="0" src="scriptsPage.JPG" width="819" height="707"></h2>
+
+ <p>&nbsp;<p>&nbsp;<p>Below, the user has put some test scripts in the
+ Script page.&nbsp; The check box to the left is for determining if the
+ script will be run when the play button (which is still grayed out).&nbsp;
+ The names of the test scripts are in the Test column.&nbsp; The Status
+ column shows the current status of the test script, and they all show
+ NOT_CONNECTED when the Test Manager is not connected to a test server.&nbsp;
+ The location of the test script is also shown.<p>
+ <img border="0" src="scriptsPage2.JPG" width="819" height="707"></p>
+ <p>&nbsp;</p>
+ <p>
+ &nbsp;</p>
+ <p>
+ In this shot, the Test Manager has now connected to a test server.&nbsp;
+ The status of the scripts is shown as READY, and the test server
+ connection widget is now shown as a lightning bolt.&nbsp; Also, notice
+ that the green play button is not grayed out anymore.&nbsp; It can be
+ selected to start the running of the selected test scripts.</p>
+ <p><img border="0" src="scriptsPage3.JPG" width="819" height="707"></p>
+ <p>
+ &nbsp;</p>
+ <p>
+ &nbsp;</p>
+ <p>Below, the test script run is in progress.&nbsp; Notice the first
+ script is completed and there is a checkmark in the Output File column.&nbsp;
+ That signifies that an output file has been created for the completed
+ run.&nbsp; The user can double-click the checkmark to open the output
+ file.&nbsp; The results of the run are shown in the Result column, and
+ it even shows the results while in progress.&nbsp; The first script
+ passed all 721 test point.&nbsp; The 2nd script&nbsp; is still running
+ and has failed 1 of the 9 test points so far.</p>
+ <p><img border="0" src="scriptsPage4.JPG" width="819" height="707"></p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage2.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage2.JPG
new file mode 100644
index 0000000000..9ff4571c43
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage2.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage3.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage3.JPG
new file mode 100644
index 0000000000..979b725108
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage3.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage4.JPG b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage4.JPG
new file mode 100644
index 0000000000..d251fed6d4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/scriptsPage4.JPG
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/sourcePage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/sourcePage.html
new file mode 100644
index 0000000000..858509ff8a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/sourcePage.html
@@ -0,0 +1,17 @@
+<html>
+
+ <head>
+ <title>Test Manager Overview Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Test Manager Source Page</h1>
+ The Source page of Test Manager allows the user to enter source code
+ location to run against.&nbsp; It also contains the location to place
+ the Description information that shows up on the Overview Page.
+
+ <h2><img border="0" src="SourcePage.JPG" width="827" height="731"></h2>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.html
new file mode 100644
index 0000000000..9cd2adbb8a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.html
@@ -0,0 +1,19 @@
+<html>
+
+ <head>
+ <title>Testing Overview</title>
+ </head>
+
+ <body>
+ <h1>Testing Overview</h1>
+ The purpose of this section is to familiarize testers with the information
+ needed to perform test development and debugging using Eclipse. The first
+ section refers to the OSEE User Training and all others will guide you through
+ the test-specific information.
+ <br></br>
+ <a href="training.html">Training</a><br></br>
+
+ <a href="train_cvs.html">CVS Repository</a><br></br>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.xml
new file mode 100644
index 0000000000..445eb1d118
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/testing.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Testing" topic="help/testing.html">
+
+ <topic label="Training" href="help/training.html"/>
+
+</toc>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.html
new file mode 100644
index 0000000000..880d2e4f5b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.html
@@ -0,0 +1,19 @@
+
+<html>
+
+ <head>
+ <title>OSEE Test Manager Users Guide</title>
+ </head>
+
+ <body>
+ <h1>OSEE Test Manager Users Guide</h1>
+ <p></p>
+ The OSEE Test Manager Users guide is for any person who will be using OSEE for testing.
+ <br></br>
+ <a href="training.html">Training</a><br></br>
+ <p></p>
+ <a href="testing.html">Testing</a><br></br>
+ <p></p>
+ </body>
+
+</html>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.xml
new file mode 100644
index 0000000000..a46b77a025
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/toc.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc link_to="../org.eclipse.osee.ote.core/help/toc.xml#tools" label="OSEE Test Manager Users Guide" topic="help/help.html">
+
+ <topic label="Test Manager">
+ <topic label="Overview" href="help/overview.html" />
+ <topic label="Overview Page" href="help/overviewPage.html" />
+ <topic label="Hosts Page" href="help/hostsPage.html" />
+ <topic label="Scripts Page" href="help/scriptsPage.html" />
+ <topic label="Advanced Page" href="help/advancedPage.html" />
+ <topic label="Source Page" href="help/sourcePage.html" />
+ </topic>
+
+</toc>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javadev.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javadev.html
new file mode 100644
index 0000000000..b704148182
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javadev.html
@@ -0,0 +1,24 @@
+<html>
+
+ <head>
+ <title>OSEE Java Development Environment</title>
+ </head>
+
+ <body>
+ <h1>OSEE Java Development Environment</h1>
+
+ <br></br>
+ The purpose of this section is to focus the training of the
+ <b><font color = "midnightblue">Java Development Users Guide</font></b>
+ specifically for OSEE Test Users.
+ <br></br>
+ It is recommend that OSEE Test Users read through all information contained in this
+ section of the training.
+ <br></br>
+ <font size="-1">Note: All information in the
+ <b><font color = "midnightblue">Java Development Users Guide</font></b> is
+ useful but the information contained in this section has been selected
+ to focus on for the purpose of introductory training. As time permits other topics
+ should be read for further training.</font>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javaprog.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javaprog.html
new file mode 100644
index 0000000000..0d58ea7694
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_javaprog.html
@@ -0,0 +1,25 @@
+<html>
+
+ <head>
+ <title>Java Programming Language</title>
+ </head>
+
+ <body>
+ <h1>Java Programming Language</h1>
+
+ <p>The purpose of this section is to provide resources to train engineers of various
+ experience levels in the Java programming language.</p>
+ <p>Select one or more of the following resources for Java Programming Language training
+ (more options will be added later for different levels of programming experience):</p>
+
+ <p></p>
+ <a href="http://java.sun.com/docs/white/langenv/index.html" target="_blank">Beginner Java - Overview</a><br></br>
+ or copy and paste <b>http://java.sun.com/docs/white/langenv/index.html</b> into your browser <p></p>
+ <a href="http://java.sun.com/docs/books/tutorial/java/index.html" target="_blank">Beginner Java Training</a><br></br>
+ or copy and paste <b>http://java.sun.com/docs/books/tutorial/java/index.html</b> into your browser <p></p>
+ <p></p>
+
+ <p></p>
+ <p></p>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_wbench.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_wbench.html
new file mode 100644
index 0000000000..d7d6072196
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/train_wbench.html
@@ -0,0 +1,32 @@
+<html>
+
+ <head>
+ <title>OSEE Workbench</title>
+ </head>
+
+ <body>
+ <h1>OSEE Workbench</h1>
+
+ <p>The purpose of this section is to focus the training of the <img src="../icons/document_sm.gif" alt=""/>
+ <b><font color = "midnightblue">Workbench Users Guide</font></b> specifically for OSEE Users.
+ The following sections should be read for training on the OSEE Workbench:
+ </p>
+
+ <ul><li>Basic Tutorial</li>
+ <li>Workbench</li>
+ <li>Perspectives</li>
+ <li>Editors</li>
+ <li>Toolbars</li>
+ <li>Help System</li>
+ <li>Team programming with CVS</li></ul>
+
+
+ <p>
+ <font size="-1"/>Note: All information in the <img src="../icons/document_sm.gif" alt=""/>
+ <font color="midnightblue"/><b>Workbench Users Guide</b><font color="black"/> is
+ useful but the above areas have been selected to focus on for the purpose
+ of introductory training. As time permits other topics should be read for
+ further training.
+ </p>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.html b/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.html
new file mode 100644
index 0000000000..e8a7e45af6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.html
@@ -0,0 +1,25 @@
+
+<html>
+
+ <head>
+ <title>Training</title>
+ </head>
+
+ <body>
+ <h1>Training</h1>
+ <p></p>
+ <p>The purpose of this section is to provide training to all OSEE Test Users.
+ The three topics of training listed below should be completed in the order in which you see.
+ </p>
+ <p></p>
+ <p> </p>
+
+ <a href="train_wbench.html">OSEE Workbench</a><br></br>
+ <p></p>
+ <a href="train_javadev.html">Java Development Environment</a><br></br>
+ <p></p>
+ <a href="train_javaprog.html">Java Programming Language</a><br></br>
+ <p></p>
+ </body>
+
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.xml
new file mode 100644
index 0000000000..0bb6cd6a86
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/help/training.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Training" topic="help/training.html">
+ <topic label="OSEE Workbench" href="help/train_wbench.html">
+ <link toc = "../org.eclipse.platform.doc.user/topics_GettingStarted.xml"/>
+ <link toc = "../org.eclipse.platform.doc.user/topics_Concepts.xml"/>
+ </topic>
+ <topic label="OSEE Java Development Environment"
+ href="help/train_javadev.html">
+ <link toc = "../org.eclipse.jdt.doc.user/topics_GettingStarted.xml"/>
+ <link toc = "../org.eclipse.jdt.doc.user/topics_Concepts.xml"/>
+ </topic>
+ <topic label="Java Programming Language" href="help/train_javaprog.html"/>
+</toc>
+
+
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/add.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/add.gif
new file mode 100644
index 0000000000..6cf3b5f1ca
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/add.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/alert_obj.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/alert_obj.gif
new file mode 100644
index 0000000000..7a49f6d454
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/alert_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/binoculars.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/binoculars.gif
new file mode 100644
index 0000000000..b04deb3c26
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/binoculars.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/check.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/check.gif
new file mode 100644
index 0000000000..6b3078b35c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/check.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_disabled.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_disabled.gif
new file mode 100644
index 0000000000..7aa131aedb
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_disabled.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_enabled.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_enabled.gif
new file mode 100644
index 0000000000..9cacb96dca
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/chkbox_enabled.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected.gif
new file mode 100644
index 0000000000..8290462e35
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_plug.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_plug.gif
new file mode 100644
index 0000000000..8493df40df
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_plug.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_sm.gif
new file mode 100644
index 0000000000..b397d8b2c1
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/connected_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput.gif
new file mode 100644
index 0000000000..d18ebcb646
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput_sm.gif
new file mode 100644
index 0000000000..2e74d0afbe
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/debugOutput_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/delete.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/delete.gif
new file mode 100644
index 0000000000..2cd9c54443
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/delete.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/disconnected_plug.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/disconnected_plug.gif
new file mode 100644
index 0000000000..61648a3d15
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/disconnected_plug.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/environment.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/environment.gif
new file mode 100644
index 0000000000..f3377f38f8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/environment.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/error.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/error.gif
new file mode 100644
index 0000000000..8612eaff59
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/error.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/error_stack.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/error_stack.gif
new file mode 100644
index 0000000000..e61fc24f93
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/error_stack.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/file.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/file.gif
new file mode 100644
index 0000000000..7ccc6a7031
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/file.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/file_delete.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/file_delete.gif
new file mode 100644
index 0000000000..45699b57db
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/file_delete.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput.gif
new file mode 100644
index 0000000000..bbfa55fe56
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput_sm.gif
new file mode 100644
index 0000000000..64b499c97f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/flatOutput_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/fldr_obj.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/fldr_obj.gif
new file mode 100644
index 0000000000..b6858690c8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/fldr_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/glasses.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/glasses.gif
new file mode 100644
index 0000000000..9bdbc128f4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/glasses.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/green_bug.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/green_bug.gif
new file mode 100644
index 0000000000..1c36fc1a90
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/green_bug.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/import_wiz.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/import_wiz.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/import_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/light_bolt.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/light_bolt.gif
new file mode 100644
index 0000000000..4bc7dd4930
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/light_bolt.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/loadConfig.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/loadConfig.gif
new file mode 100644
index 0000000000..f92b0e803f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/loadConfig.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput.gif
new file mode 100644
index 0000000000..eea2973668
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput_sm.gif
new file mode 100644
index 0000000000..12c7902016
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/normalOutput_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/ofp.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/ofp.gif
new file mode 100644
index 0000000000..d19d763eb3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/ofp.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/red_bug.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/red_bug.gif
new file mode 100644
index 0000000000..df3ed441bf
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/red_bug.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/save_edit.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/save_edit.gif
new file mode 100644
index 0000000000..9302c4ec68
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/save_edit.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/saveas_edit.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/saveas_edit.gif
new file mode 100644
index 0000000000..d7f9c61449
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/saveas_edit.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled.gif
new file mode 100644
index 0000000000..6cb4431c61
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled_sm.gif
new file mode 100644
index 0000000000..a1feb00a6b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelled_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling.gif
new file mode 100644
index 0000000000..41991b2e3e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling_sm.gif
new file mode 100644
index 0000000000..e1dde912dc
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptCancelling_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete.gif
new file mode 100644
index 0000000000..da16deae3c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete_sm.gif
new file mode 100644
index 0000000000..e7903b5c4d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptComplete_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue.gif
new file mode 100644
index 0000000000..dcdb06c0f7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue_sm.gif
new file mode 100644
index 0000000000..f96466208d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptInQueue_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput.gif
new file mode 100644
index 0000000000..7793f3b823
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput_sm.gif
new file mode 100644
index 0000000000..ad403d95d3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptOutput_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady.gif
new file mode 100644
index 0000000000..b8e969feb9
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady_sm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady_sm.gif
new file mode 100644
index 0000000000..07c5346e0c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptReady_sm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptRunning.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptRunning.gif
new file mode 100644
index 0000000000..0849e03b62
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/scriptRunning.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_abort_stop.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_abort_stop.gif
new file mode 100644
index 0000000000..8fa8ea101d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_abort_stop.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_batch_abort_stop.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_batch_abort_stop.gif
new file mode 100644
index 0000000000..f0b55748b7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_batch_abort_stop.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_run_exec.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_run_exec.gif
new file mode 100644
index 0000000000..4a70a050ca
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/sel_run_exec.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/showerr_tsk.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/showerr_tsk.gif
new file mode 100644
index 0000000000..170b0e15f2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/showerr_tsk.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/test.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/test.gif
new file mode 100644
index 0000000000..d4848c0e18
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/test.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/tm.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tm.gif
new file mode 100644
index 0000000000..c0b47e1958
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tm.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/tmError.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tmError.gif
new file mode 100644
index 0000000000..96f464d679
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tmError.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/tracability.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tracability.gif
new file mode 100644
index 0000000000..28f1fd5eec
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/tracability.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_abort_stop.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_abort_stop.gif
new file mode 100644
index 0000000000..9ba15cf846
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_abort_stop.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_batch_abort_stop.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_batch_abort_stop.gif
new file mode 100644
index 0000000000..deee2f43c6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_batch_abort_stop.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_run_exec.gif b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_run_exec.gif
new file mode 100644
index 0000000000..d7726f75b5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/images/unsel_run_exec.gif
Binary files differ
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/plugin.xml b/plugins/org.eclipse.osee.ote.ui.test.manager/plugin.xml
new file mode 100644
index 0000000000..8070f24d60
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/plugin.xml
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="OSEE TM"
+ visible="true"
+ id="org.eclipse.osee.ote.ui.test.manager.actionSet">
+
+
+ </actionSet>
+ </extension>
+
+
+<!-- this changes the marker image in the editor marker bar -->
+
+
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="Test Manager"
+ id="org.eclipse.osee.ote.ui.test.manager">
+ </category>
+ <wizard
+ name="Test Manager File"
+ icon="images/tm.gif"
+ category="org.eclipse.osee.ote.ui.test.manager"
+ class="org.eclipse.osee.ote.ui.test.manager.wizards.TestManagerNewWizard"
+ id="org.eclipse.osee.ote.ui.test.manager.wizards.TestManagerNewWizard">
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="help/toc.xml"
+ primary="false">
+ </toc>
+ <toc
+ file="help/training.xml">
+ </toc>
+ <toc
+ file="help/testing.xml">
+ </toc>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ objectClass="org.eclipse.jdt.core.ICompilationUnit"
+ nameFilter="*"
+ id="org.eclipse.osee.ote.ui.test.manager.contribution1">
+ <menu
+ label="Test Manager"
+ path="additions"
+ id="org.eclipse.osee.ote.ui.test.manager.menu1">
+ <separator
+ name="markers">
+ </separator>
+ </menu>
+ <action
+ enablesFor="1"
+ label="Add to Test Manager"
+ icon="images/tm.gif"
+ class="org.eclipse.osee.ote.ui.test.manager.actions.AddToTestManagerPopupAction"
+ menubarPath="org.eclipse.osee.ote.ui.test.manager.menu1/markers"
+ id="org.eclipse.osee.ote.ui.test.manager.addtotestmanager">
+ </action>
+ </objectContribution>
+ <viewerContribution
+ targetID="#CompilationUnitEditorContext"
+ id="viewConf">
+ <action
+ label="Add To Test Manager"
+ icon="images/tm.gif"
+ menubarPath="org.eclipse.jdt.ui.source.menu"
+ id="org.eclipse.osee.ote.ui.test.manager.actions.AddToTestManagerEditorAction"
+ class="org.eclipse.osee.ote.ui.test.manager.actions.AddToTestManagerEditorAction"/>
+ </viewerContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.osee.ote.ui.test.manager.TestManagerMenu"
+ objectClass="org.eclipse.jdt.core.IJavaProject">
+ <menu
+ id="org.eclipse.osee.ote.ui.test.manager.menu1"
+ label="Test Batch"
+ path="additions">
+ <separator
+ name="separator1">
+ </separator>
+ </menu>
+ </objectContribution>
+ <objectContribution
+ id="org.eclipse.osee.ote.ui.test.manager.TestBatchActions"
+ objectClass="org.eclipse.jdt.core.IJavaProject">
+ <visibility>
+ <not>
+ <objectState
+ name="nature"
+ value="org.eclipse.osee.ote.ui.test.manager.TestBatchProjectNature">
+ </objectState>
+ </not>
+ </visibility>
+ <action
+ class="org.eclipse.osee.ote.ui.test.manager.batches.actions.AddTestBatchProjectNature"
+ enablesFor="1"
+ icon="images/add.gif"
+ id="org.eclipse.osee.ote.ui.test.manager.action1"
+ label="Add Test Batch Nature"
+ menubarPath="org.eclipse.osee.ote.ui.test.manager.menu1/separator1">
+ </action>
+ </objectContribution>
+ <objectContribution
+ id="org.eclipse.osee.ote.ui.test.manager.TestBatchProjects"
+ objectClass="org.eclipse.jdt.core.IJavaProject">
+ <visibility>
+ <objectState
+ name="nature"
+ value="org.eclipse.osee.ote.ui.test.manager.TestBatchProjectNature">
+ </objectState>
+ </visibility>
+ <action
+ class="org.eclipse.osee.ote.ui.test.manager.batches.actions.RemoveTestBatchProjectNature"
+ enablesFor="1"
+ icon="images/delete.gif"
+ id="org.eclipse.osee.ote.ui.test.manager.action2"
+ label="Remove Test Batch Nature"
+ menubarPath="org.eclipse.osee.ote.ui.test.manager.menu1/separator1">
+ </action>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.osee.framework.ui.skynet.OseePreferencePage"
+ class="org.eclipse.osee.ote.ui.test.manager.preferences.TestManagerPreferencePage"
+ id="org.eclipse.osee.ote.ui.test.manager.PreferencePage"
+ name="Test Manager"/>
+ </extension>
+ <extension
+ point="org.eclipse.help.contexts">
+ <contexts file="contexts/tmAdvancedPage.xml"/>
+ <contexts file="contexts/tmHostsPage.xml"/>
+ <contexts file="contexts/tmScriptsPage.xml"/>
+ <contexts file="contexts/tmOverviewPage.xml"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.ui.plugin.PropertyStoreControl">
+ <PropertyStoreControl
+ classname="org.eclipse.osee.ote.ui.test.manager.pages.contributions.ScriptExecutionContribution"
+ viewId="org.eclipse.osee.ote.ui.test.manager">
+ </PropertyStoreControl>
+ </extension>
+
+ <extension
+ id="TestBatchProjectNature"
+ name="Test Batch Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.eclipse.osee.ote.ui.test.manager.batches.TestBatchProjectNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ adaptable="true"
+ class="org.eclipse.osee.ote.ui.test.manager.batches.TestBatchDecorator"
+ icon="images/test.gif"
+ id="org.eclipse.osee.ote.ui.test.manager.decorator"
+ label="Test Batch Project"
+ lightweight="true"
+ location="TOP_RIGHT"
+ state="true">
+ <description>
+ A Test Batch Project contains project set files and test manager batch config files which allow users to quickly setup their test manager and workspace.
+ </description>
+ <enablement>
+ <or>
+ <and>
+ <objectClass name="org.eclipse.jdt.core.IJavaProject"/>
+ <objectState
+ value="org.eclipse.osee.ote.ui.test.manager.TestBatchProjectNature"
+ name="nature"/>
+ </and>
+ <and>
+ <objectClass name="org.eclipse.core.resources.IProject"/>
+ <objectState
+ value="org.eclipse.osee.ote.ui.test.manager.TestBatchProjectNature"
+ name="nature"/>
+ </and>
+ </or>
+ </enablement>
+ </decorator>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.ui.plugin.XNavigateItem">
+ <XNavigateItem
+ classname="org.eclipse.osee.ote.ui.test.manager.batches.navigate.TestBatchSetupViewItems"
+ viewId="org.eclipse.osee.ote.ui.navigate.OteNavigateView">
+ </XNavigateItem>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_executionOptions.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_executionOptions.html
new file mode 100644
index 0000000000..e6e6cbb85c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_executionOptions.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_markerOptions.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_markerOptions.html
new file mode 100644
index 0000000000..e6e6cbb85c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_markerOptions.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_scriptOptions.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_scriptOptions.html
new file mode 100644
index 0000000000..e6e6cbb85c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_advancedPage_scriptOptions.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_hostsPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_hostsPage.html
new file mode 100644
index 0000000000..c8bae8da01
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_hostsPage.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_overviewPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_overviewPage.html
new file mode 100644
index 0000000000..e6e6cbb85c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_overviewPage.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_scriptsPage.html b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_scriptsPage.html
new file mode 100644
index 0000000000..e6e6cbb85c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/references/tm_scriptsPage.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Artifact Explorer</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h2>Help Under Construction</h2>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/ITestManagerFactory.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/ITestManagerFactory.java
new file mode 100644
index 0000000000..d703e08bb4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/ITestManagerFactory.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.ui.test.manager;
+
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.pages.AdvancedPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * TODO Add a summary of extension points and other classes that will need to be added to create a new test manager.
+ *
+ * @author Roberto E. Escobar
+ */
+public interface ITestManagerFactory {
+
+ public AdvancedPage getAdvancedPageNewInstance(Composite parent, int style, TestManagerEditor parentTestManager);
+
+ public String getEditorId();
+
+ public String getEditorLastOpenedKey();
+
+ public ScriptPage getScriptPageNewInstance(Composite parent, int style, TestManagerEditor parentTestManager);
+
+ public String getTestManagerExtension();
+
+ public String getTestManagerFileName();
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/OteTestManagerImage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/OteTestManagerImage.java
new file mode 100644
index 0000000000..7dd13c446d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/OteTestManagerImage.java
@@ -0,0 +1,73 @@
+/*
+ * Created on Jun 12, 2009
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ote.ui.test.manager;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+
+/**
+ * @author Andrew M. Finkbeiner
+ * @author Ryan Schmitt
+ */
+public enum OteTestManagerImage implements KeyedImage {
+ ADD("add.gif"),
+ ALERT_OBJ("alert_obj.gif"),
+ CHECK("check.gif"),
+ CHECKBOX_ENABLED("chkbox_enabled.gif"),
+ CHECKBOX_DISABLED("chkbox_disabled.gif"),
+ DELETE("delete.gif"),
+ ENVIRONMENT("environment.gif"),
+ ERROR("error.gif"),
+ ERROR_STACK("error_stack.gif"),
+ FILE("file.gif"),
+ FILE_DELETE("file_delete.gif"),
+ FLDR_OBJ("fldr_obj.gif"),
+ LOAD_CONFIG("loadConfig.gif"),
+ OFP("ofp.gif"),
+ PROJECT_SET_IMAGE("import_wiz.gif"),
+ SAVE_EDIT("save_edit.gif"),
+ SAVEAS_EDIT("saveas_edit.gif"),
+ SEL_ABORT_STOP("sel_abort_stop.gif"),
+ SEL_BATCH_ABORT_STOP("sel_batch_abort_stop.gif"),
+ SEL_RUN_EXEC("sel_run_exec.gif"),
+ SCRIPT_CANCELLED("scriptCancelled.gif"),
+ SCRIPT_CANCELLED_SM("scriptCancelled_sm.gif"),
+ SCRIPT_CANCELLING("scriptCancelling.gif"),
+ SCRIPT_CANCELLING_SM("scriptCancelling_sm.gif"),
+ SCRIPT_COMPLETE("scriptComplete.gif"),
+ SCRIPT_COMPLETE_SM("scriptComplete_sm.gif"),
+ SCRIPT_IN_QUEUE("scriptInQueue.gif"),
+ SCRIPT_IN_QUEUE_SM("scriptInQueue_sm.gif"),
+ SCRIPT_OUTPUT("scriptOutput.gif"),
+ SCRIPT_OUTPUT_SM("scriptOutput_sm.gif"),
+ SCRIPT_READY("scriptReady.gif"),
+ SCRIPT_READY_SM("scriptReady_sm.gif"),
+ SCRIPT_RUNNING("scriptRunning.gif"),
+ TEST("test.gif"),
+ TEST_BATCH_IMAGE("file.gif"),
+ TEST_MANAGER("tm.gif"),
+ UNSEL_ABORT_STOP("unsel_abort_stop.gif"),
+ UNSEL_BATCH_ABORT_STOP("unsel_batch_abort_stop.gif"),
+ UNSEL_RUN_EXEC("unsel_run_exec.gif");
+
+ private final String fileName;
+
+ private OteTestManagerImage(String fileName) {
+ this.fileName = fileName;
+ }
+
+ @Override
+ public ImageDescriptor createImageDescriptor() {
+ return ImageManager.createImageDescriptor(TestManagerPlugin.PLUGIN_ID, "images", fileName);
+ }
+
+ @Override
+ public String getImageKey() {
+ return TestManagerPlugin.PLUGIN_ID + ".images." + fileName;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerEditorAction.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerEditorAction.java
new file mode 100644
index 0000000000..fe5a5663bf
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerEditorAction.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.ui.test.manager.actions;
+
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.operations.AddIFileToTestManager;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+
+public class AddToTestManagerEditorAction implements IEditorActionDelegate {
+
+
+ public void run(IAction action) {
+ // Get IFile of current editor
+ IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ IEditorInput editorInput = editorPart.getEditorInput();
+ IFile iFile = null;
+ if (editorInput instanceof IFileEditorInput) {
+ iFile = ((IFileEditorInput) editorInput).getFile();
+ if (iFile != null) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "iFile *" + iFile + "*");
+ }
+ }
+ if (iFile == null) {
+ AWorkbench.popup("ERROR", "Can't retrieve IFile");
+ return;
+ }
+ AddIFileToTestManager.getOperation().addIFileToScriptsPage(iFile.getLocation().toOSString());
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java
new file mode 100644
index 0000000000..7178852dfc
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/AddToTestManagerPopupAction.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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.ui.test.manager.actions;
+
+import java.util.Iterator;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkspace;
+import org.eclipse.osee.ote.ui.test.manager.operations.AddIFileToTestManager;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public class AddToTestManagerPopupAction implements IWorkbenchWindowActionDelegate {
+
+ public static String getSelection() {
+ StructuredSelection sel = AWorkspace.getSelection();
+ Iterator<?> i = sel.iterator();
+ String selection = "";
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof IResource) {
+ IResource resource = (IResource) obj;
+ if (resource != null) selection = resource.getLocation().toOSString();
+ } else if (obj instanceof ICompilationUnit) {
+ ICompilationUnit resource = (ICompilationUnit) obj;
+ if (resource != null) selection = resource.getResource().getLocation().toOSString();
+ }
+ }
+ return selection;
+ }
+
+ IWorkbenchWindow activeWindow = null;
+
+ // IWorkbenchWindowActionDelegate method
+ public void dispose() {
+ // nothing to do
+ }
+
+ // IWorkbenchWindowActionDelegate method
+ public void init(IWorkbenchWindow window) {
+ activeWindow = window;
+ }
+
+ public void run(IAction proxyAction) {
+ String file = getSelection();
+ if (file == null || file.equals("")) {
+ AWorkbench.popup("ERROR", "Can't retrieve file");
+ return;
+ }
+ AddIFileToTestManager.getOperation().addIFileToScriptsPage(file);
+ }
+
+ // IActionDelegate method
+ public void selectionChanged(IAction proxyAction, ISelection selection) {
+
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/TMBugAction.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/TMBugAction.java
new file mode 100644
index 0000000000..ec487ae7b2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/actions/TMBugAction.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.ui.test.manager.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+
+public class TMBugAction implements IEditorActionDelegate {
+
+ public void run(IAction action) {
+
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchDecorator.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchDecorator.java
new file mode 100644
index 0000000000..a741d8089d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchDecorator.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches;
+
+import java.util.logging.Level;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.batches.util.SelectionUtil;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestBatchDecorator extends LabelProvider implements ILightweightLabelDecorator {
+ private static final String DECORATOR_ID = "org.eclipse.osee.ote.ui.test.manager.decorator";
+ private static final ImageDescriptor IMAGE = ImageManager.getImageDescriptor(OteTestManagerImage.TEST);
+
+ public void decorate(Object element, IDecoration decoration) {
+ try {
+ IProject project = null;
+ if (element instanceof IJavaProject) {
+ project = ((IJavaProject) element).getProject();
+ } else {
+ project = (IProject) element;
+ }
+ if (project.isOpen() && project.hasNature(TestBatchProjectNature.NATURE_ID)) {
+ decoration.addOverlay(IMAGE);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, SelectionUtil.getStatusMessages(ex));
+ }
+ }
+
+ private void startDecoratorUpdate(IProject project) {
+ final LabelProviderChangedEvent evnt = new LabelProviderChangedEvent(this, project);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ fireLabelProviderChanged(evnt);
+ }
+ });
+ }
+
+ public static void performLabelDecoratorUpdate(IProject project) {
+ IDecoratorManager decoratorManager = TestManagerPlugin.getInstance().getWorkbench().getDecoratorManager();
+ IBaseLabelProvider provider = decoratorManager.getBaseLabelProvider(DECORATOR_ID);
+ if (provider != null) {
+ TestBatchDecorator decorator = (TestBatchDecorator) provider;
+ decorator.startDecoratorUpdate(project);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchProjectNature.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchProjectNature.java
new file mode 100644
index 0000000000..2bffb82bef
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/TestBatchProjectNature.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches;
+
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.batches.navigate.TestBatchRegistry;
+import org.eclipse.osee.ote.ui.test.manager.batches.navigate.TestBatchSetupViewItems;
+import org.eclipse.osee.ote.ui.test.manager.batches.util.ResourceFinder;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestBatchProjectNature implements IProjectNature {
+ public static final String NATURE_ID = "org.eclipse.osee.ote.ui.test.manager.TestBatchProjectNature";
+ private IProject project;
+ private final ResourceFinder resourceFinder;
+ private final IResourceChangeListener resourceChangeListener;
+ private final IResourceChangeListener projectClosedListener;
+ private final IResourceChangeListener projectDeletedListener;
+ private final FindResourceWorker worker;
+
+ public TestBatchProjectNature() {
+ this.resourceFinder = new ResourceFinder();
+ this.resourceChangeListener = new TestBatchResourceChangeListener();
+ this.projectClosedListener = new TestBatchProjectClosedListener();
+ this.projectDeletedListener = new TestBatchProjectDeletedListener();
+ this.worker = new FindResourceWorker(this);
+ }
+
+ @Override
+ public void configure() throws CoreException {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ workspace.addResourceChangeListener(projectClosedListener, IResourceChangeEvent.PRE_CLOSE);
+ workspace.addResourceChangeListener(projectDeletedListener, IResourceChangeEvent.PRE_DELETE);
+ ResourcesPlugin.getWorkspace().getRoot().getWorkspace().run(worker, new NullProgressMonitor());
+ }
+
+ @Override
+ public void deconfigure() throws CoreException {
+ TestBatchRegistry registry = TestBatchSetupViewItems.getInstance().getRegistry();
+ for (String key : resourceFinder.getIds()) {
+ registry.deregisterTestBatch(key);
+ }
+ TestBatchDecorator.performLabelDecoratorUpdate(project);
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.removeResourceChangeListener(resourceChangeListener);
+ workspace.removeResourceChangeListener(projectClosedListener);
+ workspace.removeResourceChangeListener(projectDeletedListener);
+ }
+
+ @Override
+ public IProject getProject() {
+ return this.project;
+ }
+
+ @Override
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ public ResourceFinder getResourceFinder() {
+ return resourceFinder;
+ }
+
+ public FindResourceWorker getWorker() {
+ return worker;
+ }
+
+ public static void initializeProjectSet() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (IProject project : projects) {
+ try {
+ if (project != null && project.isOpen() == true) {
+ IProjectNature nature = project.getNature(TestBatchProjectNature.NATURE_ID);
+ if (nature != null) {
+ nature.configure();
+ }
+ }
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "Error initializing project nature", ex);
+ }
+ }
+ }
+ });
+ }
+
+ private final class TestBatchProjectDeletedListener implements IResourceChangeListener {
+
+ @Override
+ public void resourceChanged(IResourceChangeEvent event) {
+ try {
+ IResource resource = event.getResource();
+ if (resource != null) {
+ IProject project = resource.getProject();
+ if (project != null) {
+ final IProjectNature nature = project.getNature(NATURE_ID);
+ if (nature != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ TestBatchProjectNature batchProjectNature = (TestBatchProjectNature) nature;
+ TestBatchRegistry registry = TestBatchSetupViewItems.getInstance().getRegistry();
+ for (String key : batchProjectNature.getResourceFinder().getIds()) {
+ registry.deregisterTestBatch(key);
+ }
+ }
+ });
+ }
+ }
+ }
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "Error during resource change event", ex);
+ }
+ }
+
+ }
+
+ private final class TestBatchProjectClosedListener implements IResourceChangeListener {
+ @Override
+ public void resourceChanged(IResourceChangeEvent event) {
+ try {
+ IResource resource = event.getResource();
+ if (resource != null) {
+ IProject project = resource.getProject();
+ if (project != null) {
+ final IProjectNature nature = project.getNature(NATURE_ID);
+ if (nature != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ TestBatchProjectNature tbpNature = (TestBatchProjectNature) nature;
+ TestBatchRegistry registry = TestBatchSetupViewItems.getInstance().getRegistry();
+ for (String key : tbpNature.getResourceFinder().getIds()) {
+ registry.deregisterTestBatch(key);
+ }
+ }
+ });
+ }
+ }
+ }
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "Error during resource change event", ex);
+ }
+ }
+ }
+
+ private final class TestBatchResourceChangeListener implements IResourceChangeListener {
+ @Override
+ public void resourceChanged(IResourceChangeEvent event) {
+ try {
+ IResourceDelta delta = event.getDelta();
+ IResourceDelta[] children = delta.getAffectedChildren();
+ for (IResourceDelta childDelta : children) {
+ IResource resource = childDelta.getResource();
+ if (resource != null) {
+ IProject project = resource.getProject();
+ if (project != null) {
+ if (project.isOpen() != false && project.isNatureEnabled(NATURE_ID)) {
+ final IProjectNature nature = project.getNature(NATURE_ID);
+ if (nature != null) {
+ handleProjectFilesChanging((TestBatchProjectNature) nature);
+ }
+ }
+ }
+ }
+ }
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "Error during resource change event", ex);
+ }
+ }
+
+ private void handleProjectFilesChanging(final TestBatchProjectNature nature) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ nature.getWorker().run(new NullProgressMonitor());
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+ };
+
+ private final class FindResourceWorker implements IWorkspaceRunnable {
+
+ private final TestBatchProjectNature nature;
+
+ public FindResourceWorker(TestBatchProjectNature nature) {
+ this.nature = nature;
+ }
+
+ @Override
+ public void run(IProgressMonitor monitor) throws CoreException {
+ ResourceFinder finder = nature.getResourceFinder();
+ finder.findBatchAndProjectFiles(nature.getProject());
+ TestBatchRegistry registry = TestBatchSetupViewItems.getInstance().getRegistry();
+ for (String key : finder.getIds()) {
+ Pair<IFile, IFile> fileSet = finder.getFileSet(key);
+ registry.registerTestBatch(key, fileSet.getFirst().getLocationURI(), fileSet.getSecond().getLocationURI());
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ TestBatchDecorator.performLabelDecoratorUpdate(nature.getProject());
+ }
+ });
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/AddTestBatchProjectNature.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/AddTestBatchProjectNature.java
new file mode 100644
index 0000000000..5cf8397ffd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/AddTestBatchProjectNature.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.actions;
+
+import java.util.logging.Level;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.batches.TestBatchProjectNature;
+import org.eclipse.osee.ote.ui.test.manager.batches.util.SelectionUtil;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AddTestBatchProjectNature implements IObjectActionDelegate {
+ private static final String NATURE_ADDED = "Test Batch Nature Added";
+ private static final String ADDING_NATURE = "Adding Test Batch Nature";
+
+ private IJavaProject currentJavaProject;
+ private IProject currentProject;
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // Do Nothing
+ }
+
+ public void run(IAction action) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ Cursor waitCursor = new Cursor(window.getShell().getDisplay(), SWT.CURSOR_WAIT);
+ try {
+ window.getShell().setCursor(waitCursor);
+ ((ApplicationWindow) window).setStatus(ADDING_NATURE);
+
+ //new way
+ if (currentJavaProject == null) {
+ // if the java nature is not present
+ // it must be added, along with the test batch nature
+ IProjectDescription description = currentProject.getDescription();
+ String[] natureIds = description.getNatureIds();
+ String[] newNatures = new String[natureIds.length + 2];
+ System.arraycopy(natureIds, 0, newNatures, 0, natureIds.length);
+ newNatures[newNatures.length - 2] = JavaCore.NATURE_ID;
+ newNatures[newNatures.length - 1] = TestBatchProjectNature.NATURE_ID;
+ description.setNatureIds(newNatures);
+ currentProject.setDescription(description, null);
+
+ currentJavaProject = (IJavaProject) JavaCore.create((IProject) currentProject);
+ } else {
+ //add the test batch nature, the java nature is already present
+ IProjectDescription description = currentJavaProject.getProject().getDescription();
+ String[] natures = description.getNatureIds();
+ String[] newNatures = new String[natures.length + 1];
+ System.arraycopy(natures, 0, newNatures, 0, natures.length);
+ newNatures[natures.length] = TestBatchProjectNature.NATURE_ID;
+ description.setNatureIds(newNatures);
+ currentJavaProject.getProject().setDescription(description, null);
+ }
+
+ // refresh project so user sees new files, libraries, etc
+ currentJavaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ ((ApplicationWindow) window).setStatus(NATURE_ADDED);
+
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, String.format("Error adding test batch nature on [%s]",
+ currentJavaProject.getProject().getName()), ex);
+ Shell shell = new Shell();
+ MessageDialog.openInformation(shell, TestManagerPlugin.PLUGIN_ID,
+ "Error adding test batch nature:\n" + SelectionUtil.getStatusMessages(ex));
+ } finally {
+ window.getShell().setCursor(null);
+ waitCursor.dispose();
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ currentJavaProject = SelectionUtil.findSelectedJavaProject(selection);
+ if (currentJavaProject == null) {
+ currentProject = SelectionUtil.findSelectedProject(selection);
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/RemoveTestBatchProjectNature.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/RemoveTestBatchProjectNature.java
new file mode 100644
index 0000000000..83b681386e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/actions/RemoveTestBatchProjectNature.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.batches.TestBatchProjectNature;
+import org.eclipse.osee.ote.ui.test.manager.batches.util.SelectionUtil;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class RemoveTestBatchProjectNature implements IObjectActionDelegate {
+ private static final String NATURE_REMOVED = "Test Batch Nature Removed";
+ private static final String REMOVING_NATURE = "Removing Test Batch Nature";
+ private IJavaProject currentJavaProject;
+ private IProject currentProject;
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // Do Nothing
+ }
+
+ private static String[] removeTestBatchNature(String[] natures) {
+ List<String> list = new ArrayList<String>();
+
+ for (int i = 0; i < natures.length; i++) {
+ if (!(natures[i].equalsIgnoreCase(TestBatchProjectNature.NATURE_ID))) {
+ list.add(natures[i]);
+ }
+ }
+ String[] newNatures = new String[list.size()];
+ for (int i = 0; i < list.size(); i++) {
+ newNatures[i] = (String) list.get(i);
+ }
+ return newNatures;
+ }
+
+ public void run(IAction action) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ try {
+ ((ApplicationWindow) window).setStatus(REMOVING_NATURE);
+
+ if (currentJavaProject == null) {
+ currentJavaProject = JavaCore.create(currentProject);
+ }
+ // //Shutdown server if running for the current project
+ // if (DerbyServerUtils.getDefault().getRunning(currentJavaProject.getProject())) {
+ // DerbyServerUtils.getDefault().stopDerbyServer(currentJavaProject.getProject());
+ // }
+ // IClasspathEntry[] rawClasspath = currentJavaProject.getRawClasspath();
+ //
+ // List<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
+ // for (IClasspathEntry e : rawClasspath) {
+ // if (e.getEntryKind() != IClasspathEntry.CPE_CONTAINER) {
+ // newEntries.add(e);
+ // } else if (!e.getPath().equals(DerbyClasspathContainer.CONTAINER_ID)) {
+ // newEntries.add(e);
+ // }
+ // }
+
+ // IClasspathEntry[] newEntriesArray = new IClasspathEntry[newEntries.size()];
+ // newEntriesArray = (IClasspathEntry[]) newEntries.toArray(newEntriesArray);
+ // currentJavaProject.setRawClasspath(newEntriesArray, null);
+
+ IProjectDescription description = currentJavaProject.getProject().getDescription();
+ String[] natures = description.getNatureIds();
+
+ description.setNatureIds(removeTestBatchNature(natures));
+ currentJavaProject.getProject().setDescription(description, null);
+ // refresh project so user sees changes
+ currentJavaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ ((ApplicationWindow) window).setStatus(NATURE_REMOVED);
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, String.format("Error removing test batch nature on [%s]",
+ currentJavaProject.getProject().getName()), ex);
+ Shell shell = new Shell();
+ MessageDialog.openInformation(shell, TestManagerPlugin.PLUGIN_ID,
+ "Error removing test batch nature:\n" + SelectionUtil.getStatusMessages(ex));
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ currentJavaProject = SelectionUtil.findSelectedJavaProject(selection);
+ if (currentJavaProject == null) {
+ currentProject = SelectionUtil.findSelectedProject(selection);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ITestBatchDataListener.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ITestBatchDataListener.java
new file mode 100644
index 0000000000..32c5685a5d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ITestBatchDataListener.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.ui.test.manager.batches.navigate;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface ITestBatchDataListener {
+
+ public void dataAddedEvent(TestBatchData data);
+
+ public void dataRemovedEvent(TestBatchData data);
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ProjectSetupItem.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ProjectSetupItem.java
new file mode 100644
index 0000000000..2c9baf987c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/ProjectSetupItem.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.navigate;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.svn.CheckoutProjectSetJob;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+
+/**
+ * @author Roberto E. Escobar
+ */
+final class ProjectSetupItem extends XNavigateItem implements Runnable {
+ private URI projectSetFile;
+ private String jobName;
+
+ public ProjectSetupItem(XNavigateItem parent, String name, KeyedImage oseeImage, URI projectSetFile) {
+ super(parent, name, oseeImage);
+ this.jobName = String.format("Project Configuration: [%s]", name);
+ this.projectSetFile = projectSetFile;
+ }
+
+ public void run() {
+ try {
+ URL url = projectSetFile.toURL();
+ Job job = new CheckoutProjectSetJob(jobName, getName(), url);
+ job.setUser(true);
+ job.schedule();
+ } catch (MalformedURLException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/RefreshOteNavigator.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/RefreshOteNavigator.java
new file mode 100644
index 0000000000..15a94d4c86
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/RefreshOteNavigator.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.ui.test.manager.batches.navigate;
+
+import org.eclipse.osee.ote.ui.navigate.OteNavigateView;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class RefreshOteNavigator implements ITestBatchDataListener {
+
+ @Override
+ public void dataAddedEvent(TestBatchData data) {
+ OteNavigateView navigator = getOteNavigator();
+ if (navigator != null) {
+ navigator.refresh();
+ }
+ }
+
+ @Override
+ public void dataRemovedEvent(TestBatchData data) {
+ OteNavigateView navigator = getOteNavigator();
+ if (navigator != null) {
+ navigator.refresh();
+ }
+ }
+
+ private OteNavigateView getOteNavigator() {
+ OteNavigateView toReturn = null;
+ IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
+ for (IWorkbenchPage page : pages) {
+ IViewPart part = page.findView(OteNavigateView.VIEW_ID);
+ if (part != null) {
+ if (part instanceof OteNavigateView) {
+ toReturn = (OteNavigateView) part;
+ break;
+ }
+ }
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchData.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchData.java
new file mode 100644
index 0000000000..f83fa55f77
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchData.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.navigate;
+
+import java.net.URI;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestBatchData {
+
+ private String name;
+ private XNavigateItem itemFolder;
+ private URI testBatchFile;
+ private URI projectSetFile;
+
+ protected TestBatchData(XNavigateItem itemFolder, String name, URI projectSetFile, URI testBatchFile) {
+ this.name = name;
+ this.testBatchFile = testBatchFile;
+ this.projectSetFile = projectSetFile;
+ this.itemFolder = itemFolder;
+ }
+
+ public String getId() {
+ return name;
+ }
+
+ public URI getTestBatchFile() {
+ return testBatchFile;
+ }
+
+ public URI getProjectSetFile() {
+ return projectSetFile;
+ }
+
+ public XNavigateItem getXNavigateItem() {
+ return itemFolder;
+ }
+
+ public void dispose() {
+ XNavigateItem parent = itemFolder.getParent();
+ if (parent != null) {
+ parent.removeChild(itemFolder);
+ itemFolder.setParent(null);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchRegistry.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchRegistry.java
new file mode 100644
index 0000000000..1866340247
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchRegistry.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.ui.test.manager.batches.navigate;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestBatchRegistry {
+
+ private final Map<String, TestBatchData> itemsMap;
+ private final Set<ITestBatchDataListener> listeners;
+ private final XNavigateItem parent;
+
+ public TestBatchRegistry(XNavigateItem parent) {
+ this.itemsMap = new HashMap<String, TestBatchData>();
+ this.listeners = new HashSet<ITestBatchDataListener>();
+ this.parent = parent;
+ }
+
+ public List<XNavigateItem> getXNavigateItems() {
+ List<XNavigateItem> toReturn = new ArrayList<XNavigateItem>();
+ for (TestBatchData data : itemsMap.values()) {
+ toReturn.add(data.getXNavigateItem());
+ }
+ return toReturn;
+ }
+
+ public void deregisterTestBatch(String id) {
+ TestBatchData data = this.itemsMap.get(id);
+ if (data != null) {
+ data.dispose();
+ this.itemsMap.remove(id);
+ notifyAddEvent(data);
+ }
+ }
+
+ public void registerTestBatch(String id, URI projectSetFile, URI testBatchFile) {
+ if (itemsMap.containsKey(id) != true) {
+ TestBatchData data = createNewTestBatchItem(id, projectSetFile, testBatchFile);
+ this.itemsMap.put(data.getId(), data);
+ notifyRemoveEvent(data);
+ }
+ }
+
+ public void addListener(ITestBatchDataListener listener) {
+ synchronized (listeners) {
+ listeners.add(listener);
+ }
+ }
+
+ public void removeListener(ITestBatchDataListener listener) {
+ synchronized (listeners) {
+ listeners.remove(listener);
+ }
+ }
+
+ private void notifyAddEvent(final TestBatchData data) {
+ synchronized (listeners) {
+ for (ITestBatchDataListener listener : listeners) {
+ listener.dataAddedEvent(data);
+ }
+ }
+ }
+
+ private void notifyRemoveEvent(final TestBatchData data) {
+ synchronized (listeners) {
+ for (ITestBatchDataListener listener : listeners) {
+ listener.dataRemovedEvent(data);
+ }
+ }
+ }
+
+ private TestBatchData createNewTestBatchItem(String id, URI projectSetFile, URI testBatchFile) {
+ // Chain Items
+ XNavigateItem parentFolder = new XNavigateItem(parent, id, PluginUiImage.FOLDER);
+ new ProjectSetupItem(parentFolder, id + " Checkout", OteTestManagerImage.PROJECT_SET_IMAGE, projectSetFile);
+ new TestBatchSetupItem(parentFolder, id + " Test Manager Batch Config", OteTestManagerImage.TEST_BATCH_IMAGE, testBatchFile);
+
+ // Store into dataObject
+ return new TestBatchData(parentFolder, id, projectSetFile, testBatchFile);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java
new file mode 100644
index 0000000000..9e50cdb05f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.navigate;
+
+import java.io.File;
+import java.net.URI;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.osee.ote.ui.test.manager.configuration.LoadConfigurationOperation;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.util.PluginUtil;
+import org.eclipse.osee.ote.ui.test.manager.util.TestManagerSelectDialog;
+import org.eclipse.ui.progress.UIJob;
+
+/**
+ * @author Roberto E. Escobar
+ */
+final class TestBatchSetupItem extends XNavigateItem implements Runnable {
+ private URI testBatchFile;
+ private String jobName;
+
+ public TestBatchSetupItem(XNavigateItem parent, String name, KeyedImage oseeImage, URI testBatchFile) {
+ super(parent, name, oseeImage);
+ this.jobName = String.format("Test Manager Configuration: [%s]", name);
+ this.testBatchFile = testBatchFile;
+ }
+
+ public void run() {
+ Job job = new UIJob(jobName) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IStatus status = Status.CANCEL_STATUS;
+ if (PluginUtil.areTestManagersAvailable() != true) {
+ Exception exception =
+ new IllegalStateException("Test Manager was not opened before this operation was selected.");
+ status =
+ new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID, Status.ERROR,
+ "A Test Manager must be opened for this operation to work.", exception);
+ } else {
+ TestManagerEditor[] itemsToOpen = PluginUtil.getTestManagers();
+ if (itemsToOpen.length > 1) {
+ itemsToOpen = TestManagerSelectDialog.getTestManagerFromUser();
+ }
+
+ if (itemsToOpen.length > 0) {
+ boolean result = configureSelectedItems(itemsToOpen);
+ if (result != false) {
+ status = Status.OK_STATUS;
+ } else {
+ Exception exception = new IllegalStateException("Test Manager setup failed.");
+ status =
+ new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID,
+ "Test Manager configuration failed for some unknown reason. Please try again.",
+ exception);
+ }
+ } else {
+ Exception exception = new IllegalStateException("No Test Manager was selected.");
+ status =
+ new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID,
+ "A Test Manager must be selected for this operation to work.", exception);
+ }
+ }
+ return status;
+ }
+
+ private boolean configureSelectedItems(TestManagerEditor[] items) {
+ boolean result = true;
+ for (TestManagerEditor testManager : items) {
+ result &= LoadConfigurationOperation.load(testManager, new File(testBatchFile));
+ }
+ return result;
+ }
+ };
+ job.setUser(true);
+ job.schedule();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupViewItems.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupViewItems.java
new file mode 100644
index 0000000000..e8e110a1e5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupViewItems.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.ui.test.manager.batches.navigate;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.IXNavigateContainer;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.ote.ui.test.manager.batches.TestBatchProjectNature;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestBatchSetupViewItems implements IXNavigateContainer {
+ private static final String PARENT_FOLDER_NAME = "Test Batch Setup";
+
+ private static TestBatchSetupViewItems instance = null;
+ private TestBatchRegistry registry;
+ private XNavigateItem parentFolder;
+
+ public TestBatchSetupViewItems() {
+ this.parentFolder = new XNavigateItem(null, PARENT_FOLDER_NAME, PluginUiImage.FOLDER);
+ this.registry = new TestBatchRegistry(parentFolder);
+ this.registry.addListener(new RefreshOteNavigator());
+
+ TestBatchProjectNature.initializeProjectSet();
+ }
+
+ public static TestBatchSetupViewItems getInstance() {
+ if (instance == null) {
+ instance = new TestBatchSetupViewItems();
+ }
+ return instance;
+ }
+
+ public List<XNavigateItem> getNavigateItems() {
+ List<XNavigateItem> items = new ArrayList<XNavigateItem>();
+ items.add(parentFolder);
+ return items;
+ }
+
+ public TestBatchRegistry getRegistry() {
+ return registry;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/ResourceFinder.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/ResourceFinder.java
new file mode 100644
index 0000000000..ef3e8de318
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/ResourceFinder.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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.ui.test.manager.batches.util;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ResourceFinder {
+ private static final String PROJECT_SET_EXTENSION = "psf";
+ private static final String TEST_BATCH_SET_EXTENSION = "xml";
+
+ private HashCollection<String, IFile> resourceMap;
+
+ public ResourceFinder() {
+ this.resourceMap = new HashCollection<String, IFile>();
+ }
+
+ public Set<String> getIds() {
+ return resourceMap.keySet();
+ }
+
+ public Pair<IFile, IFile> getFileSet(String key) {
+ IFile project = null;
+ IFile testBatch = null;
+
+ Collection<IFile> items = this.resourceMap.getValues(key);
+ for (IFile file : items) {
+ if (file.getFileExtension().equals(PROJECT_SET_EXTENSION)) {
+ project = file;
+ } else {
+ testBatch = file;
+ }
+ }
+ return new Pair<IFile, IFile>(project, testBatch);
+ }
+
+ public void findBatchAndProjectFiles(IProject project) {
+ final HashCollection<String, IFile> localMap = new HashCollection<String, IFile>();
+
+ try {
+ project.accept(new IResourceVisitor() {
+
+ @Override
+ public boolean visit(IResource resource) throws CoreException {
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ if (isValid(file) != false) {
+ String key = file.getName();
+ key = key.replace(file.getFileExtension(), "");
+ if (key.endsWith(".")) {
+ key = key.substring(0, key.length() - 1);
+ }
+ localMap.put(key, file);
+ }
+ }
+ return true;
+ }
+ });
+
+ } catch (CoreException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ // Remove incompletes
+ this.resourceMap.clear();
+ for (String key : localMap.keySet()) {
+ Collection<IFile> values = localMap.getValues(key);
+ if (values != null && values.size() == 2) {
+ this.resourceMap.put(key, values);
+ }
+ }
+ }
+
+ private boolean isValid(IFile file) {
+ boolean result = false;
+ if (file != null && file.isAccessible() != false) {
+ String extension = file.getFileExtension();
+ result =
+ extension.equalsIgnoreCase(PROJECT_SET_EXTENSION) || extension.equalsIgnoreCase(TEST_BATCH_SET_EXTENSION);
+ }
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/SelectionUtil.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/SelectionUtil.java
new file mode 100644
index 0000000000..3ecc72b3df
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/util/SelectionUtil.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.ui.test.manager.batches.util;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class SelectionUtil {
+ public static IProject findSelectedProject(ISelection selection) {
+ IProject currentProject = null;
+ if (selection != null) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ Object obj = ss.getFirstElement();
+ if (obj instanceof IProject) {
+ currentProject = (IProject) obj;
+ }
+ }
+ }
+ return currentProject;
+ }
+
+ public static IJavaProject findSelectedJavaProject(ISelection selection) {
+ IJavaProject currentProject = null;
+ if (selection != null) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ Object obj = ss.getFirstElement();
+ if (obj instanceof IJavaProject) {
+ currentProject = (IJavaProject) obj;
+ }
+ }
+ }
+ return currentProject;
+ }
+
+ public static String getStatusMessages(Exception e) {
+ String msg = e.getMessage();
+ if (e instanceof CoreException) {
+ CoreException ce = (CoreException) e;
+ IStatus status = ce.getStatus();
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++)
+ msg += "\n" + children[i].getMessage();
+ System.err.println(msg);
+ ce.printStackTrace(System.err);
+ }
+ return msg;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFactory.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFactory.java
new file mode 100644
index 0000000000..2b75728bdb
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFactory.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration;
+
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.configuration.pages.LoadScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.configuration.pages.SaveScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.AdvancedPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.TestManagerPage;
+
+public class ConfigFactory {
+ private static ConfigFactory instance = null;
+
+ private ConfigFactory() {
+ }
+
+ public static ConfigFactory getInstance() {
+ if (instance == null) {
+ instance = new ConfigFactory();
+ }
+ return instance;
+ }
+
+ public ILoadConfig getLoadConfigHandler(TestManagerPage tmPage) {
+ ILoadConfig toReturn = null;
+
+ if (tmPage instanceof ScriptPage) {
+ toReturn = new LoadScriptPage((ScriptPage) tmPage);
+ } else if (tmPage instanceof AdvancedPage) {
+ // toReturn = new AdvancedPageLoad(tmPage);
+ }
+ return toReturn;
+ }
+
+ public ISaveConfig getSaveConfigHandler(TestManagerPage tmPage) {
+ ISaveConfig toReturn = null;
+
+ if (tmPage instanceof ScriptPage) {
+ try {
+ toReturn = new SaveScriptPage((ScriptPage) tmPage);
+ } catch (ParserConfigurationException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ } else if (tmPage instanceof AdvancedPage) {
+ // toReturn = new AdvancedPageSave(tmPage);
+ }
+ return toReturn;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFileHandler.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFileHandler.java
new file mode 100644
index 0000000000..32635e4650
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ConfigFileHandler.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration;
+
+import java.io.File;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class ConfigFileHandler {
+
+ /**
+ * Writes the XML in sourceDoc to the test manager config file specified. If the destination file
+ * already exists, and contains the XML specified for the sourceDoc's root node, it will be
+ * replaced, otherwise it will be appended to the file. If the file does not exist, a new file
+ * will be created only containing the sourceDoc underneath a root TestManagerConfig node.
+ *
+ * @param sourceDoc
+ * @param fileString
+ * @throws Exception
+ */
+ public static void writeFile(Document sourceDoc, String fileString) throws Exception {
+ Document doc;
+ File file = new File(fileString);
+ if (file.exists()) {
+ doc = writeSectionToFile(sourceDoc, file);
+ }
+ else {
+ doc = Jaxp.newDocument();
+ Element root = doc.createElement("TestManagerConfig");
+ root.appendChild(doc.importNode(sourceDoc.getDocumentElement(), true));
+ doc.appendChild(root);
+ }
+ Jaxp.writeXmlDocument(doc, file, Jaxp.getPrettyFormat(doc));
+ }
+
+ private static Document writeSectionToFile(Document docToAdd, File file) throws Exception {
+ Element nodeToAdd = docToAdd.getDocumentElement();
+ String configType = nodeToAdd.getNodeName();
+ Document doc = Jaxp.readXmlDocument(file);
+ Element root = doc.getDocumentElement();
+ Element configNode = Jaxp.getChild(root, configType);
+ if (configNode != null) {
+ root.removeChild(configNode);
+ root.appendChild(doc.importNode(nodeToAdd, true));
+ }
+ else {
+ root.appendChild(doc.importNode(nodeToAdd, true));
+ }
+ return doc;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ILoadConfig.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ILoadConfig.java
new file mode 100644
index 0000000000..5917a33ac1
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ILoadConfig.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.ui.test.manager.configuration;
+
+import java.io.File;
+
+public abstract interface ILoadConfig {
+
+ public abstract void loadConfiguration(File toProcess) throws Exception;
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ISaveConfig.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ISaveConfig.java
new file mode 100644
index 0000000000..109ce1f143
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/ISaveConfig.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.ui.test.manager.configuration;
+
+import java.io.File;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public abstract interface ISaveConfig {
+
+ public abstract Element toXml(Document doc);
+ public abstract void saveConfig(File fileName) throws Exception;
+ public abstract void printXmlTree();
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadConfigurationOperation.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadConfigurationOperation.java
new file mode 100644
index 0000000000..ad774318db
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadConfigurationOperation.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration;
+
+import java.io.File;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.StatusWindowWidget;
+import org.eclipse.osee.ote.ui.test.manager.util.Dialogs;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class LoadConfigurationOperation {
+
+ private LoadConfigurationOperation() {
+ }
+
+ public static boolean load(TestManagerEditor testManager, File selectedFile) {
+ boolean isOk = updateFileStatus(testManager, selectedFile);
+ if (isOk != false) {
+ isOk &= reLoad(testManager);
+ }
+ return isOk;
+ }
+
+ private static boolean updateFileStatus(TestManagerEditor testManager, File selectedFile) {
+ boolean result = false;
+ StatusWindowWidget statusWindow = testManager.getPageManager().getScriptPage().getStatusWindow();
+ if (statusWindow != null) {
+ String filePath = selectedFile.getAbsolutePath();
+ statusWindow.setValue(ScriptPage.UpdateableLabel.CONFIGPATHLABEL.name(), filePath);
+ testManager.storeValue(testManager.configFileName, filePath);
+ statusWindow.refresh();
+ result = true;
+ }
+ return result;
+ }
+
+ public static boolean reLoad(TestManagerEditor testManager) {
+ boolean result = false;
+ String configFile = testManager.loadValue(testManager.configFileName);
+
+ ILoadConfig loadConfig =
+ ConfigFactory.getInstance().getLoadConfigHandler(testManager.getPageManager().getScriptPage());
+ try {
+ loadConfig.loadConfiguration(new File(configFile));
+ result = true;
+ } catch (Exception ex) {
+ Dialogs.popupError("Error Loading File", String.format("Error loading file: [%s]\n%s", configFile,
+ TestManagerPlugin.getStackMessages(ex)));
+ }
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadWidget.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadWidget.java
new file mode 100644
index 0000000000..1a746332ee
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/LoadWidget.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration;
+
+import java.io.File;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.StatusWindowWidget;
+import org.eclipse.osee.ote.ui.test.manager.pages.TestManagerPage;
+import org.eclipse.osee.ote.ui.test.manager.util.Dialogs;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+public class LoadWidget {
+ public static final OseeUiActivator plugin = TestManagerPlugin.getInstance();
+ private StatusWindowWidget statusWindow;
+ private final TestManagerPage tmPage;
+
+ public LoadWidget(TestManagerPage tmPage) {
+ this.tmPage = tmPage;
+ this.statusWindow = null;
+ }
+
+ public void createToolItem(final ToolBar toolBar) {
+ final Shell shell = toolBar.getShell();
+
+ final Menu menu = new Menu(shell, SWT.POP_UP);
+
+ MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
+ menuItem.setText("Load File...");
+ menuItem.setImage(ImageManager.getImage(OteTestManagerImage.FLDR_OBJ));
+ menuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String[] filterExtensions = {"*.xml"};
+ FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
+ fileDialog.setText("Load " + tmPage.getPageName() + "Page Settings From...");
+ fileDialog.setFilterExtensions(filterExtensions);
+
+ String defaultConfigDir = statusWindow.getValue(ScriptPage.UpdateableLabel.CONFIGPATHLABEL.name());
+ File dir = new File(defaultConfigDir);
+ if (dir.isFile() || dir.isDirectory()) {
+ fileDialog.setFilterPath(defaultConfigDir);
+ } else {
+ fileDialog.setFilterPath("Y:\\");
+ }
+ String result = fileDialog.open();
+
+ if (result != null && !result.equals("")) {
+ File newFile = new File(result);
+ if (newFile.exists() && newFile.isFile()) {
+ LoadConfigurationOperation.load(tmPage.getTestManager(), newFile);
+ } else {
+ handleFileSelectError();
+ }
+ }
+ }
+ });
+
+ final ToolItem item = new ToolItem(toolBar, SWT.DROP_DOWN);
+ item.setImage(ImageManager.getImage(OteTestManagerImage.LOAD_CONFIG));
+ item.setToolTipText("Load current page configuration from file");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ // If they clicked the arrow, we show the list
+ if (event.detail == SWT.ARROW) {
+ // Determine where to put the dropdown list
+ ToolItem item = (ToolItem) event.widget;
+ Rectangle rect = item.getBounds();
+ Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
+ menu.setLocation(pt.x, pt.y + rect.height);
+ menu.setVisible(true);
+ } else {
+ LoadConfigurationOperation.reLoad(tmPage.getTestManager());
+ }
+ }
+ });
+ toolBar.pack();
+ }
+
+ public void setStatusLabel(StatusWindowWidget statusWindow) {
+ this.statusWindow = statusWindow;
+ }
+
+ private void handleFileSelectError() {
+ Dialogs.popupError("Load Configuration File", "Invalid Configuration File Selected.");
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/SaveWidget.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/SaveWidget.java
new file mode 100644
index 0000000000..f73205c297
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/SaveWidget.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration;
+
+import java.io.File;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.StatusWindowWidget;
+import org.eclipse.osee.ote.ui.test.manager.pages.TestManagerPage;
+import org.eclipse.osee.ote.ui.test.manager.util.Dialogs;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+public class SaveWidget {
+ public static final OseeUiActivator plugin = TestManagerPlugin.getInstance();
+ private StatusWindowWidget statusWindow;
+ private String selectedFile;
+ private final TestManagerPage tmPage;
+
+ public SaveWidget(TestManagerPage tmPage) {
+ this.tmPage = tmPage;
+ selectedFile = null;
+ statusWindow = null;
+ }
+
+ public void createToolItem(final ToolBar toolBar) {
+ final Shell shell = toolBar.getShell();
+
+ final Menu menu = new Menu(shell, SWT.POP_UP);
+
+ MenuItem saveAsMenuItem = new MenuItem(menu, SWT.PUSH);
+ saveAsMenuItem.setText("SaveAs...");
+ saveAsMenuItem.setImage(ImageManager.getImage(OteTestManagerImage.SAVEAS_EDIT));
+ saveAsMenuItem.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ String[] filterExtensions = {"*.xml"};
+ FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
+ fileDialog.setText("Save " + tmPage.getPageName() + "Page Settings To...");
+ fileDialog.setFilterExtensions(filterExtensions);
+
+ String defaultConfigDir = statusWindow.getValue(ScriptPage.UpdateableLabel.CONFIGPATHLABEL.name());
+
+ File dir = new File(defaultConfigDir);
+ if (dir.isFile() || dir.isDirectory()) {
+ fileDialog.setFilterPath(defaultConfigDir);
+ } else {
+ fileDialog.setFilterPath("Y:\\");
+ }
+
+ String result = fileDialog.open();
+
+ if (result != null && !result.equals("")) {
+ selectedFile = result;
+ if (statusWindow != null) {
+ statusWindow.setValue(ScriptPage.UpdateableLabel.CONFIGPATHLABEL.name(), selectedFile);
+ TestManagerEditor tm = tmPage.getTestManager();
+ tm.storeValue(tm.configFileName, selectedFile);
+ statusWindow.refresh();
+ handleSaveEvent();
+ } else {
+ handleFileSelectError();
+ }
+ }
+ }
+ });
+
+ final ToolItem item = new ToolItem(toolBar, SWT.DROP_DOWN);
+ item.setImage(ImageManager.getImage(OteTestManagerImage.SAVE_EDIT));
+ item.setToolTipText("Saves current page configuration to file");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ // If they clicked the arrow, we show the list
+ if (event.detail == SWT.ARROW) {
+ // Determine where to put the dropdown list
+ ToolItem item = (ToolItem) event.widget;
+ Rectangle rect = item.getBounds();
+ Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
+ menu.setLocation(pt.x, pt.y + rect.height);
+ menu.setVisible(true);
+ } else {
+ handleSaveEvent();
+ }
+ }
+ });
+ toolBar.pack();
+ }
+
+ public void setStatusLabel(StatusWindowWidget statusWindow) {
+ this.statusWindow = statusWindow;
+ selectedFile = statusWindow.getValue(ScriptPage.UpdateableLabel.CONFIGPATHLABEL.name());
+ }
+
+ private void handleFileSelectError() {
+ Dialogs.popupError("Save Configuration File", "Invalid Configuration File Selected");
+ }
+
+ private void handleSaveEvent() {
+ TestManagerEditor tm = tmPage.getTestManager();
+ String configFile = tm.loadValue(tm.configFileName);
+
+ ISaveConfig saveConfig = ConfigFactory.getInstance().getSaveConfigHandler(tmPage);
+ try {
+
+ saveConfig.saveConfig(new File(configFile));
+ } catch (Exception ex) {
+ Dialogs.popupError("Error Saving File", String.format("Error saving file: [%s]\n%s", configFile,
+ TestManagerPlugin.getStackMessages(ex)));
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/LoadScriptPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/LoadScriptPage.java
new file mode 100644
index 0000000000..b4bb056e16
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/LoadScriptPage.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration.pages;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Vector;
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ILoadConfig;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTableViewer;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.swt.widgets.Display;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class LoadScriptPage implements ILoadConfig, ScriptPageConstants {
+
+ private final ScriptPage scriptPage;
+ private final ScriptTableViewer scriptTableViewer;
+ private final Vector<ScriptTask> scriptTasks;
+
+ public LoadScriptPage(ScriptPage tmPage) {
+ this.scriptPage = tmPage;
+ this.scriptTableViewer = scriptPage.getScriptTableViewer();
+ scriptTasks = new Vector<ScriptTask>();
+ }
+
+ public void loadConfiguration(final File toProcess) throws Exception {
+
+ Job job = new Job(String.format("Loading Script Run List [%s]", toProcess.getName())) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ Document doc;
+ try {
+ doc = Jaxp.readXmlDocument(toProcess);
+ parseConfig(doc);
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ scriptTableViewer.loadTasksFromList(scriptTasks);
+ scriptTableViewer.refresh();
+ debug(toProcess.getAbsolutePath());
+ }
+ });
+ } catch (ParserConfigurationException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ } catch (SAXException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ } catch (IOException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
+ }
+
+ private void debug(String val) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "Loaded From: " + val);
+ }
+
+ private void parseConfig(Document doc) {
+ NodeList nl = doc.getElementsByTagName(ScriptPageConstants.SCRIPTPAGE_CONFIG);
+
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element element = (Element) nl.item(i);
+ parseMiscellaneousInfo(element);
+ parseScriptEntries(element);
+ }
+ }
+
+ private void parseMiscellaneousInfo(Element element) {
+ // Iterator iterator = node.getDescendants(new RegExElementFilter(
+ // Pattern.compile(ScriptPageConstants.SERVICES_ENTRY)));
+ // while (iterator.hasNext()) {
+ // Element child = (Element) iterator.next();
+ // TODO load miscellaneous information to page
+ // }
+ }
+
+ private class LoadScriptHelper implements Runnable {
+ private boolean stopLoading = false;
+ private final String path;
+
+ public LoadScriptHelper(String path) {
+ this.path = path;
+ }
+
+ public void run() {
+ if (!MessageDialog.openQuestion(
+ Display.getDefault().getActiveShell(),
+ "Script not found",
+ "The script " + path + " was not found in this workspace. Do you want to continue loading from the script list file. ")) {
+ stopLoading = true;
+ }
+ }
+
+ public boolean stop() {
+ return stopLoading;
+ }
+ }
+
+ private void parseScriptEntries(Element element) {
+ NodeList nl = element.getElementsByTagName(ScriptPageConstants.SCRIPT_ENTRY);
+ String alternatePath = scriptPage.getTestManager().getAlternateOutputDir();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Element child = (Element) nl.item(i);
+ final String path = Jaxp.getChildText(child, ScriptPageConstants.RAW_FILENAME_FIELD);
+ String runnable = Jaxp.getChildText(child, ScriptPageConstants.RUNNABLE_FIELD);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path));
+ if (file.exists()) {
+ try {
+ ScriptTask task = new ScriptTask(file.getLocation().toString(), alternatePath);
+ task.setRun(Boolean.parseBoolean(runnable));
+ scriptTasks.add(task);
+ } catch (NullPointerException e) {
+ e.printStackTrace();
+ }
+ } else {
+ LoadScriptHelper helper = new LoadScriptHelper(path);
+ Display.getDefault().syncExec(helper);
+ if (helper.stop()) {
+ break;
+ }
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/SaveScriptPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/SaveScriptPage.java
new file mode 100644
index 0000000000..86cac66232
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/SaveScriptPage.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.ui.test.manager.configuration.pages;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Vector;
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.osee.framework.jdk.core.persistence.Xmlizable;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ConfigFileHandler;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ISaveConfig;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTableViewer;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class SaveScriptPage implements ISaveConfig, ScriptPageConstants, Xmlizable{
+
+ private Document doc;
+ private Element root;
+ private ScriptPage scriptPage;
+
+ public SaveScriptPage(ScriptPage tmPage) throws ParserConfigurationException {
+ this.scriptPage = tmPage;
+ doc = Jaxp.newDocument();
+ root = doc.createElement(ScriptPageConstants.SCRIPTPAGE_CONFIG);
+ doc.appendChild(root);
+ }
+
+ public void printXmlTree() {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "Script Page Tree: ");
+ try {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, Jaxp.xmlToString(doc, Jaxp.getPrettyFormat(doc)));
+ }
+ catch (IOException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ public void saveConfig(File fileName) throws Exception {
+ ScriptTableViewer scriptTable = scriptPage.getScriptTableViewer();
+ Vector<ScriptTask> tasks = scriptTable.getTasks();
+
+ root.appendChild(miscellaneousInfoToXml(doc));
+
+ for (ScriptTask task : tasks) {
+ root.appendChild(scriptTaskToXml(doc, task));
+ }
+
+ ConfigFileHandler.writeFile(doc, fileName.getAbsolutePath());
+ debug(fileName.getAbsolutePath());
+ }
+
+ public Element toXml(Document doc) {
+ return root;
+ }
+
+ private void debug(String val) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "Saved to: " + val);
+ }
+
+ private Element miscellaneousInfoToXml(Document doc) {
+ Element node = doc.createElement(ScriptPageConstants.SERVICES_ENTRY);
+ // TODO add preferred host
+ // TODO add ofp
+ // TODO add view if unit test config
+
+ return node;
+ }
+
+ private Element scriptTaskToXml(Document doc, ScriptTask task) {
+ Element taskRoot = doc.createElement(ScriptPageConstants.SCRIPT_ENTRY);
+ taskRoot.appendChild(Jaxp.createElement(doc, ScriptPageConstants.SCRIPT_NAME_FIELD,task.getName()));
+ taskRoot.appendChild(Jaxp.createElement(doc, ScriptPageConstants.RAW_FILENAME_FIELD,task.getScriptModel().getWorkspaceRelativePath()));
+ taskRoot.appendChild(Jaxp.createElement(doc, ScriptPageConstants.RUNNABLE_FIELD,Boolean.toString(task.isRunnable())));
+ return taskRoot;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/ScriptPageConstants.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/ScriptPageConstants.java
new file mode 100644
index 0000000000..e63f986444
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/configuration/pages/ScriptPageConstants.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.ui.test.manager.configuration.pages;
+
+public interface ScriptPageConstants {
+
+ public static final String RAW_FILENAME_FIELD = "Path";
+ public static final String RESULT_FIELD = "Result";
+ public static final String RUNNABLE_FIELD = "IsRunnable";
+ public static final String SCRIPT_ENTRY = "ScriptEntry";
+ public static final String SCRIPT_NAME_FIELD = "Name";
+ public static final String SCRIPTPAGE_CONFIG = "ScriptPageConfig";
+ public static final String SERVICES_ENTRY = "ServicesSettings";
+ public static final String STATUS_FIELD = "Status";
+ public static final String CLASS_NAME = "ClassName";
+ public static final String CLASS_PATH = "ClassPath";
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptManager.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptManager.java
new file mode 100644
index 0000000000..3d80544955
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptManager.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * 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.ui.test.manager.connection;
+
+import java.rmi.RemoteException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.ote.core.environment.UserTestSessionKey;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusListener;
+import org.eclipse.osee.ote.core.environment.status.TestComplete;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.jobs.StoreOutfileJob;
+import org.eclipse.osee.ote.ui.test.manager.models.OutputModelJob;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask.ScriptStatusEnum;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public abstract class ScriptManager implements Runnable {
+ private final Map<String, ScriptTask> guidToScriptTask = new HashMap<String, ScriptTask>();
+ private TestManagerStatusListener statusListenerImpl;
+ private final TestManagerEditor testManager;
+
+ private volatile boolean updateScriptTable;
+ private StructuredViewer stv;
+ private ScheduledExecutorService updater;
+ private Set<ScriptTask> tasksToUpdate;
+ private ITestEnvironment connectedEnv;
+ private UserTestSessionKey sessionKey;
+
+ public ScriptManager(TestManagerEditor testManager, StructuredViewer stv) {
+ this.testManager = testManager;
+ this.stv = stv;
+
+ tasksToUpdate = new HashSet<ScriptTask>();
+ updater = Executors.newScheduledThreadPool(1, new ThreadFactory() {
+
+ public Thread newThread(Runnable r) {
+ Thread th = new Thread(r, "TM Table updater");
+ th.setDaemon(true);
+ return th;
+ }
+
+ });
+ updater.scheduleAtFixedRate(this, 0, 2000, TimeUnit.MILLISECONDS);
+ OutputModelJob.createSingleton(this);
+ }
+
+ public abstract void abortScript(boolean isBatchAbort) throws RemoteException;
+
+ public void notifyScriptDequeued(String className) {
+ ScriptTask task = guidToScriptTask.get(className);
+ if (task != null) {
+ guidToScriptTask.remove(task);
+ }
+ }
+
+ /**
+ * This should be called after the environment is received in order to
+ * configure necessary items.
+ *
+ * @return null if successful, otherwise a string describing the error
+ * @throws RemoteException
+ */
+ public boolean connect(ConnectionEvent event) {
+
+ connectedEnv = event.getEnvironment();
+ sessionKey = event.getSessionKey();
+ try {
+ /*
+ * Setup the status listener for commands
+ */
+ statusListenerImpl = new TestManagerStatusListener(testManager, this);
+
+ connectedEnv.addStatusListener((IServiceStatusListener) event.getConnector().export(statusListenerImpl));
+ return false;
+ } catch (Exception e) {
+ TestManagerPlugin.log(Level.SEVERE, "failed to connect script manager", e);
+ return true;
+ }
+ }
+
+ /**
+ * This should NOT be called directly, users should call the HostDataStore's
+ * disconnect.
+ */
+ public boolean disconnect(ConnectionEvent event) {
+ connectedEnv = null;
+ sessionKey = null;
+ guidToScriptTask.clear();
+ try {
+
+ event.getEnvironment().removeStatusListener((IServiceStatusListener) event.getConnector().findExport(statusListenerImpl));
+ return false;
+ } catch (RemoteException e) {
+ TestManagerPlugin.log(Level.SEVERE, "problems removing listener", e);
+ return true;
+ }
+ }
+
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ connectedEnv = null;
+ sessionKey = null;
+ guidToScriptTask.clear();
+ return false;
+ }
+
+ public ScriptTask getScriptTask(String name) {
+ return guidToScriptTask.get(name);
+ }
+
+ public void notifyScriptQueued(GUID theGUID, final ScriptTask script) {
+ guidToScriptTask.put(script.getScriptModel().getTestClass(), script);
+ script.setStatus(ScriptStatusEnum.IN_QUEUE);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (stv.getControl().isDisposed()) {
+ return;
+ }
+ stv.refresh(script);
+ }
+ });
+ }
+
+ public void updateScriptTableViewer(final ScriptTask task) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (stv.getControl().isDisposed()) {
+ return;
+ }
+ stv.refresh(task);
+ }
+ });
+ }
+
+ public void updateScriptTableViewerTimed(ScriptTask task) {
+ updateScriptTable = true;
+ synchronized (tasksToUpdate) {
+ tasksToUpdate.add(task);
+ }
+ }
+
+ public void run() {
+ if (updateScriptTable) {
+ updateScriptTable = false;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ synchronized (tasksToUpdate) {
+ if (stv.getControl().isDisposed()) {
+ return;
+ }
+ for (ScriptTask task : tasksToUpdate) {
+ stv.refresh(task);
+ }
+ tasksToUpdate.clear();
+ }
+ }
+ });
+ }
+ }
+
+ protected TestManagerEditor getTestManagerEditor() {
+ return testManager;
+ }
+
+ public abstract void addTestsToQueue(List<ScriptTask> scripts);
+
+ /**
+ * @param task
+ */
+ public void notifyScriptStart(final ScriptTask task) {
+ task.setStatus(ScriptStatusEnum.RUNNING);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ stv.refresh(task);
+ }
+ });
+ }
+
+ public void storeOutFile(ScriptTask task, TestComplete testComplete, boolean isValidRun) {
+ if (task.getScriptModel() != null) {
+ Job job = new StoreOutfileJob(connectedEnv, testManager, this, task, testComplete.getClientOutfilePath(), testComplete.getServerOutfilePath(),
+ isValidRun);
+ StoreOutfileJob.scheduleJob(job);
+ }
+ }
+
+ protected UserTestSessionKey getSessionKey() {
+ return sessionKey;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptQueue.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptQueue.java
new file mode 100644
index 0000000000..8cc763b2fe
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/ScriptQueue.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.ui.test.manager.connection;
+
+import java.util.List;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+
+public abstract class ScriptQueue implements Runnable {
+
+ private List<ScriptTask> scripts;
+ private TestManagerEditor testManager;
+
+ public ScriptQueue(List<ScriptTask> scripts, TestManagerEditor testManager) {
+ super();
+ this.scripts = scripts;
+ this.testManager = testManager;
+ }
+
+ public abstract void run();
+
+ protected List<ScriptTask> getScriptsToExecute() {
+ return scripts;
+ }
+
+ protected TestManagerEditor getTestManagerEditor() {
+ return testManager;
+ }
+
+ protected ScriptManager getScriptManager() {
+ return testManager.getPageManager().getScriptPage().getScriptManager();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.done b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.done
new file mode 100644
index 0000000000..9a76b02f4f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.done
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.ui.test.manager.connection;
+
+import java.util.concurrent.Callable;
+
+/**
+ * @author b1528444
+ *
+ */
+public abstract class StatusBoardRecieveEvent<V> implements Callable<V> {
+
+ private V data;
+
+ /**
+ *
+ */
+ public StatusBoardRecieveEvent(V data) {
+ this.data = data;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.Callable#call()
+ */
+ @Override
+ public V call() throws Exception {
+ run();
+ return data;
+ }
+
+ public abstract void run();
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.java
new file mode 100644
index 0000000000..19c3a73530
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/StatusBoardRecieveEvent.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.ui.test.manager.connection;
+
+import java.util.concurrent.Callable;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public abstract class StatusBoardRecieveEvent<V> implements Callable<V> {
+
+ private V data;
+
+ /**
+ *
+ */
+ public StatusBoardRecieveEvent(V data) {
+ this.data = data;
+ }
+
+ @Override
+ public V call() throws Exception {
+ run();
+ return data;
+ }
+
+ public abstract void run();
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java
new file mode 100644
index 0000000000..c6c16ba5e0
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerServiceStatusDataVisitor.java
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * 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.ui.test.manager.connection;
+
+import java.rmi.RemoteException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.logging.Level;
+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.core.environment.status.CommandAdded;
+import org.eclipse.osee.ote.core.environment.status.CommandEndedStatusEnum;
+import org.eclipse.osee.ote.core.environment.status.CommandRemoved;
+import org.eclipse.osee.ote.core.environment.status.EnvironmentError;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusData;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusDataCommand;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusDataVisitor;
+import org.eclipse.osee.ote.core.environment.status.SequentialCommandBegan;
+import org.eclipse.osee.ote.core.environment.status.SequentialCommandEnded;
+import org.eclipse.osee.ote.core.environment.status.TestComplete;
+import org.eclipse.osee.ote.core.environment.status.TestPointUpdate;
+import org.eclipse.osee.ote.core.environment.status.TestServerCommandComplete;
+import org.eclipse.osee.ote.core.environment.status.TestStart;
+import org.eclipse.osee.ote.core.framework.command.ITestCommandResult;
+import org.eclipse.osee.ote.core.framework.command.TestCommandStatus;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask.ScriptStatusEnum;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Roberto E. Escobar
+ */
+final class TestManagerServiceStatusDataVisitor implements IServiceStatusDataVisitor {
+
+ private final ScriptManager scriptManager;
+ private final TestManagerEditor testManagerEditor;
+ private final ExecutorService executor;
+
+ protected TestManagerServiceStatusDataVisitor(ScriptManager scriptManager, TestManagerEditor testManagerEditor) {
+ this.scriptManager = scriptManager;
+ this.testManagerEditor = testManagerEditor;
+ executor = Executors.newSingleThreadExecutor();
+
+ }
+
+ public void asCommandAdded(final CommandAdded commandAdded) {
+ executor.submit(new StatusBoardRecieveEvent<CommandAdded>(commandAdded) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(commandAdded);
+ logServiceStatusData(commandAdded);
+ final ScriptTask task = getScriptTask(commandAdded);
+ if (task != null) {
+ task.setStatus(ScriptStatusEnum.IN_QUEUE);
+ scriptManager.updateScriptTableViewer(task);
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asCommandRemoved(final CommandRemoved commandRemoved) {
+ executor.submit(new StatusBoardRecieveEvent<CommandRemoved>(commandRemoved) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(commandRemoved);
+ logServiceStatusData(commandRemoved);
+
+ final ScriptTask task = getScriptTask(commandRemoved);
+ if (task != null) {
+ CommandEndedStatusEnum cmdStat = commandRemoved.getReason();
+ if (cmdStat.equals(CommandEndedStatusEnum.ABORTED)) {
+ logOnConsole(Level.SEVERE, String.format("Test Aborted: [%s]", task.getName()));
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ }
+ notifyExecutionComplete(task);
+ // userEnvironment.notifyScriptDequeued(task.getGuid());
+ scriptManager.updateScriptTableViewer(task);
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asEnvironmentError(final EnvironmentError environmentError) {
+ executor.submit(new StatusBoardRecieveEvent<EnvironmentError>(environmentError) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(environmentError);
+
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE,
+ "errorOccured: " + environmentError.getErr().getMessage());
+ environmentError.getErr().printStackTrace();
+ final String msg = Lib.exceptionToString(environmentError.getErr());
+ logOnConsole(Level.SEVERE, String.format("Test Environment Error: [%s]", msg));
+ disconnectOnError(msg);
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asSequentialCommandBegan(final SequentialCommandBegan sequentialCommandBegan) {
+ executor.submit(new StatusBoardRecieveEvent<SequentialCommandBegan>(sequentialCommandBegan) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(sequentialCommandBegan);
+ logServiceStatusData(sequentialCommandBegan);
+
+ final ScriptTask task = getScriptTask(sequentialCommandBegan);
+ if (task != null && task.getScriptModel() != null) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, String.format("Script Task: [%s]", task));
+ logOnConsole(Level.INFO, String.format("Test Starting: [%s]", task.getName()));
+ task.setStatus(ScriptStatusEnum.RUNNING);
+ scriptManager.updateScriptTableViewer(task);
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asSequentialCommandEnded(final SequentialCommandEnded sequentialCommandEnded) {
+
+ executor.submit(new StatusBoardRecieveEvent<SequentialCommandEnded>(sequentialCommandEnded) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(sequentialCommandEnded);
+ logServiceStatusData(sequentialCommandEnded);
+ final ScriptTask task = getScriptTask(sequentialCommandEnded);
+ if (task != null) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, String.format("Script Task: [%s]", task));
+ CommandEndedStatusEnum cmdStat = sequentialCommandEnded.getStatus();
+ switch (cmdStat) {
+ case ABORTED:
+ logOnConsole(Level.SEVERE, String.format("Test Aborted: [%s]", task.getName()));
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ break;
+ case EXCEPTION:
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ logOnConsole(Level.SEVERE,
+ String.format("Test Aborted: [%s] - Exception Occurred", task.getName()));
+ break;
+ case HUNG:
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ logOnConsole(Level.SEVERE, String.format("Test Hung: [%s]", task.getName()));
+ break;
+ case RAN_TO_COMPLETION:
+ task.setStatus(ScriptStatusEnum.COMPLETE);
+ break;
+ default:
+ task.setStatus(ScriptStatusEnum.COMPLETE);
+ logOnConsole(Level.SEVERE, String.format("Test Ended Unexpectedly: [%s]", task.getName()));
+ break;
+ }
+ // onOutfileSave(task, sequentialCommandEnded.getDescription(),
+ // isValidRun);
+ logOnConsole(Level.INFO, String.format("Test Completed: [%s]", task.getName()));
+ notifyExecutionComplete(task);
+ // userEnvironment.notifyScriptDequeued(task.getGuid());
+ scriptManager.updateScriptTableViewer(task);
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asTestPointUpdate(final TestPointUpdate testPointUpdate) {
+ executor.submit(new StatusBoardRecieveEvent<TestPointUpdate>(testPointUpdate) {
+ @Override
+ public void run() {
+ checkServiceStatusDataValid(testPointUpdate);
+ final ScriptTask task = scriptManager.getScriptTask(testPointUpdate.getClassName());
+ // final ScriptTask task = getScriptTask(testPointUpdate);
+ if (task != null) {
+ task.getScriptModel().getOutputModel().setPassedTestPoints(testPointUpdate.getPass());
+ task.getScriptModel().getOutputModel().setFailedTestPoints(testPointUpdate.getFail());
+ scriptManager.updateScriptTableViewerTimed(task);
+ } else {
+ OseeLog.log(TestManagerPlugin.class, Level.WARNING, "testPointsUpdated: task is null");
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ private synchronized void logOnConsole(final Level level, final String msg) {
+ if (level.equals(Level.SEVERE)) {
+ TestManagerPlugin.getInstance().getOteConsoleService().writeError(msg);
+ } else {
+ TestManagerPlugin.getInstance().getOteConsoleService().write(msg);
+ }
+ }
+
+ private void checkServiceStatusDataValid(IServiceStatusData statusData) {
+ if (statusData == null) {
+ throw new IllegalArgumentException(String.format("Error [%s] was null.", IServiceStatusData.class.getName()));
+ }
+ }
+
+ private void disconnectOnError(final String cause) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ TestManagerPlugin.getInstance().getOteConsoleService().writeError(cause);
+ }
+ });
+ }
+
+ private void logServiceStatusData(IServiceStatusDataCommand statusData) {
+ OseeLog.log(TestManagerPlugin.class, Level.FINE, String.format("%s: %s ", statusData.getClass().getName(),
+ statusData.getDescription()));
+ }
+
+ private ScriptTask getScriptTask(IServiceStatusDataCommand statusData) {
+ // statusData.getDescription().getDescription()
+ return scriptManager.getScriptTask(statusData.getDescription().getDescription());
+ }
+
+ private void notifyExecutionComplete(ScriptTask scriptTask) {
+ // if (userEnvironment.getLastGUIDToRun() != null &&
+ // scriptTask.getGuid().equals(userEnvironment.getLastGUIDToRun())) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ testManagerEditor.executionCompleted();
+ }
+ });
+ logExecutorSize();
+ // }
+ }
+
+ public void asTestServerCommandComplete(final TestServerCommandComplete end) {
+
+ executor.submit(new StatusBoardRecieveEvent<TestServerCommandComplete>(end) {
+ @Override
+ public void run() {
+ try {
+ ITestCommandResult result = end.getHandle().get();
+ TestCommandStatus status = result.getStatus();
+ Throwable th = result.getThrowable();
+ if (th != null) {
+ th.printStackTrace();
+ }
+ if (status != null) {
+ System.out.println(status.name());
+ }
+ } catch (RemoteException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+
+ notifyExecutionComplete(null);
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asTestComplete(final TestComplete testComplete) {
+ executor.submit(new StatusBoardRecieveEvent<TestComplete>(testComplete) {
+ @Override
+ public void run() {
+ ScriptTask task = scriptManager.getScriptTask(testComplete.getClassName());
+ if (task != null) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, String.format("Script Task: [%s]", task));
+ boolean isValidRun = true;
+ CommandEndedStatusEnum cmdStat = testComplete.getStatus();
+ switch (cmdStat) {
+ case ABORTED:
+ logOnConsole(Level.SEVERE, String.format("Test Aborted: [%s]", task.getName()));
+ for (IHealthStatus status : testComplete.getHealthStatus()) {
+ String msg;
+ if (status.getException() != null) {
+ msg = Lib.exceptionToString(status.getException());
+ } else {
+ msg = status.getMessage();
+ }
+ logOnConsole(status.getLevel(), msg);
+ }
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ break;
+ case EXCEPTION:
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ logOnConsole(Level.SEVERE, String.format("Test Exception: [%s] - Exception Occurred",
+ task.getName()));
+ StringBuilder sb = new StringBuilder();
+ try {
+ for (IHealthStatus status : testComplete.getHealthStatus()) {
+ if (status.getException() != null) {
+ sb.append(Lib.exceptionToString(status.getException()));
+ } else if (status.getLevel().intValue() >= Level.SEVERE.intValue()) {
+ sb.append(status.getMessage());
+ }
+ }
+ logOnConsole(Level.SEVERE, sb.toString());
+ } catch (Throwable th) {
+ th.printStackTrace();
+ }
+ break;
+ case HUNG:
+ task.setStatus(ScriptStatusEnum.CANCELLED);
+ logOnConsole(Level.SEVERE, String.format("Test Hung: [%s]", task.getName()));
+ break;
+ case RAN_TO_COMPLETION:
+ task.setStatus(ScriptStatusEnum.COMPLETE);
+ break;
+ default:
+ task.setStatus(ScriptStatusEnum.COMPLETE);
+ logOnConsole(Level.SEVERE, String.format("Test Ended Unexpectedly: [%s]", task.getName()));
+ isValidRun = false;
+ break;
+ }
+ scriptManager.storeOutFile(task, testComplete, isValidRun);
+ logOnConsole(Level.INFO, String.format("Test Completed: [%s]", task.getName()));
+
+ scriptManager.notifyScriptDequeued(testComplete.getClassName());
+ scriptManager.updateScriptTableViewer(task);
+
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ public void asTestStart(final TestStart testStart) {
+ executor.submit(new StatusBoardRecieveEvent<TestStart>(testStart) {
+ @Override
+ public void run() {
+ ScriptTask task = scriptManager.getScriptTask(testStart.getTestClassName());
+ if (task != null) {
+ scriptManager.notifyScriptStart(task);
+ logOnConsole(Level.INFO, String.format("Test Started: [%s]", task.getName()));
+ }
+ }
+ });
+ logExecutorSize();
+ }
+
+ private void logExecutorSize() {
+ if (executor instanceof ThreadPoolExecutor) {
+ OseeLog.log(TestManagerServiceStatusDataVisitor.class, Level.FINE, String.format(
+ "Current StatusBoard Executor Size [%d]", ((ThreadPoolExecutor) executor).getQueue().size()));
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerStatusListener.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerStatusListener.java
new file mode 100644
index 0000000000..082dfc5cc7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/connection/TestManagerStatusListener.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.ui.test.manager.connection;
+
+import java.rmi.RemoteException;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusData;
+import org.eclipse.osee.ote.core.environment.status.IServiceStatusListener;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public final class TestManagerStatusListener implements IServiceStatusListener {
+
+ private TestManagerServiceStatusDataVisitor testManagerServiceDataVisitor;
+
+ public TestManagerStatusListener(TestManagerEditor testManagerEditor, ScriptManager userEnvironment) {
+ this.testManagerServiceDataVisitor = new TestManagerServiceStatusDataVisitor(userEnvironment, testManagerEditor);
+ }
+
+ public void statusBoardUpdated(IServiceStatusData statusData) throws RemoteException {
+ statusData.accept(testManagerServiceDataVisitor);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/PageManager.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/PageManager.java
new file mode 100644
index 0000000000..8dd64e1c7a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/PageManager.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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.ui.test.manager.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.ITestManagerFactory;
+import org.eclipse.osee.ote.ui.test.manager.pages.AdvancedPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.HostPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.OverviewPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.TestManagerPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class PageManager {
+
+ protected AdvancedPage advancedPage;
+ protected HostPage hostPage;
+ protected OverviewPage overviewPage;
+ protected ScriptPage scriptPage;
+ private List<TestManagerPage> pages;
+
+ private TestManagerEditor testManager;
+ private ITestManagerFactory factory;
+
+ public PageManager(ITestManagerFactory factory, TestManagerEditor testManager) {
+ this.factory = factory;
+ this.testManager = testManager;
+ this.pages = new ArrayList<TestManagerPage>();
+ }
+
+ protected void createPages(Composite parent) {
+ overviewPage = new OverviewPage(parent, SWT.NONE, testManager);
+ registerPage(overviewPage);
+
+ hostPage = new HostPage(parent, SWT.NONE, testManager);
+ registerPage(hostPage);
+
+ scriptPage = this.factory.getScriptPageNewInstance(parent, SWT.NONE, testManager);
+ scriptPage.createPage();
+ registerPage(scriptPage);
+
+ advancedPage = this.factory.getAdvancedPageNewInstance(parent, SWT.NONE, testManager);
+ advancedPage.createPage();
+ registerPage(advancedPage);
+
+ }
+
+ private void registerPage(TestManagerPage page) {
+ pages.add(page);
+ testManager.registerPage(testManager.addPage(page), page.getPageName());
+ }
+
+ /**
+ * Dispose pages
+ */
+ public void dispose() {
+ for (TestManagerPage page : pages) {
+ page.dispose();
+ }
+ pages.clear();
+ }
+
+ /**
+ * Save page settings to storage
+ */
+ public void save() {
+ for (TestManagerPage page : pages) {
+ page.saveData();
+ }
+ }
+
+ /**
+ * Restore page from stored settings
+ */
+ public void restore() {
+ for (TestManagerPage page : pages) {
+ page.restoreData();
+ }
+ }
+
+ /**
+ * @return the advancedPage
+ */
+ public AdvancedPage getAdvancedPage() {
+ return advancedPage;
+ }
+
+ /**
+ * @return the hostPage
+ */
+ public HostPage getHostPage() {
+ return hostPage;
+ }
+
+ /**
+ * @return the overviewPage
+ */
+ public OverviewPage getOverviewPage() {
+ return overviewPage;
+ }
+
+ /**
+ * @return the scriptPage
+ */
+ public ScriptPage getScriptPage() {
+ return scriptPage;
+ }
+
+ /**
+ * Checks that all page setting are set correctly for a script run
+ *
+ * @return <b>True</b> if page setting are valid for script run
+ */
+ public boolean areSettingsValidForRun() {
+ boolean result = true;
+ for (TestManagerPage page : pages) {
+ result &= page.areSettingsValidForRun();
+ }
+ return result;
+ }
+
+ /**
+ * Gets page error message
+ *
+ * @return The Page error message
+ */
+ public String getErrorMessage() {
+ StringBuilder builder = new StringBuilder();
+ for (TestManagerPage page : pages) {
+ String pageMessage = page.getErrorMessage();
+ if (Strings.isValid(pageMessage)) {
+ if (builder.length() > 0) {
+ builder.append("\n");
+ }
+ builder.append(page.getPageName());
+ builder.append(" Page:[");
+ builder.append(pageMessage);
+ builder.append("]");
+ }
+ }
+ return builder.toString();
+ }
+
+ public boolean onPostConnect(ConnectionEvent event) {
+ boolean problemEncountered = false;
+ for (TestManagerPage page : pages) {
+ problemEncountered |= page.onConnection(event);
+ }
+ return problemEncountered;
+ }
+
+ public boolean onPreDisconnect(ConnectionEvent event) {
+ boolean problemEncountered = false;
+ for (TestManagerPage page : pages) {
+ problemEncountered |= page.onDisconnect(event);
+ }
+ return problemEncountered;
+ }
+
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ boolean problemEncountered = false;
+ for (TestManagerPage page : pages) {
+ problemEncountered |= page.onConnectionLost(testHost);
+ }
+ return problemEncountered;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditor.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditor.java
new file mode 100644
index 0000000000..b25020d288
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditor.java
@@ -0,0 +1,588 @@
+/*******************************************************************************
+ * 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.ui.test.manager.core;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.connection.service.IServiceConnector;
+import org.eclipse.osee.framework.jdk.core.type.IPropertyStore;
+import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.plugin.core.IActionable;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.service.ITestConnectionListener;
+import org.eclipse.osee.ote.ui.test.manager.ITestManagerFactory;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.contributions.TestManagerStorageKeys;
+import org.eclipse.osee.ote.ui.testclassserver.ClassServerInst;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+/**
+ * Resource Test Manager Editor Pages:
+ * <ul>
+ * <li>Overview Page
+ * <li>Target Page
+ * <li>Scripts Page
+ * <li>Advanced Page
+ * <li>Source Page
+ * </ul>
+ */
+public abstract class TestManagerEditor extends MultiPageEditorPart implements IActionable, ITestConnectionListener {
+ private static final Image errorImage = ImageManager.getImage(OteTestManagerImage.ERROR);
+ public static final String namespace = "org.eclipse.osee.ote.ui.test.manager.editors.TestManagerEditor";
+
+ public final QualifiedName clearCaseViewName = new QualifiedName(namespace, "CLEARCASEVIEW");
+ public final QualifiedName configFileName = new QualifiedName(namespace, "CONFIGFILENAME");
+ public final QualifiedName ofpQualName = new QualifiedName(namespace, "OFP");
+ public final QualifiedName scriptsQualName = new QualifiedName(namespace, "SCRIPTS");
+
+ private boolean fileIsDirty = false;
+
+ private boolean fileWasSaved = false;
+
+ private int lastPageIndex = 0;
+
+ private final TestManagerModel model;
+
+ private boolean reloadSourcePage = false;
+
+ private int scriptPageIndex;
+
+ private TextEditor sourceEditor;
+
+ private int sourcePage;
+
+ private final ITestManagerFactory testManagerFactory;
+
+ private IFile thisIFile = null;
+
+ private String xmlText;
+
+ private final IPropertyStore propertyStore;
+
+ private final PageManager pageManager;
+
+ private ITestEnvironment connectedEnv = null;
+ private IServiceConnector connector = null;
+
+ public TestManagerEditor(final ITestManagerFactory testManagerFactory) {
+ super();
+
+ this.testManagerFactory = testManagerFactory;
+ this.pageManager = new PageManager(testManagerFactory, this);
+ this.model = new TestManagerModel();
+ this.propertyStore = new PropertyStore(testManagerFactory.getClass().getSimpleName());
+ }
+
+ public void activateScriptsPage() {
+ setActivePage(scriptPageIndex);
+ }
+
+ public void addFile(String fullPath) {
+ pageManager.getScriptPage().addFile(fullPath);
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ TestManagerPlugin.getInstance().getOteClientService().removeConnectionListener(this);
+ try {
+ pageManager.dispose();
+ } catch (Throwable t) {
+ TestManagerPlugin.log(Level.SEVERE, "exception while disposing test manager", t);
+ }
+ }
+
+ /**
+ * Saves the multi-page editor's document.
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ if (getActivePage() != sourcePage) {
+ pageSourceLoad();
+ }
+ getEditor(sourcePage).doSave(monitor);
+ fileIsDirty = false;
+ fileWasSaved = true;
+ doSave();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /**
+ * Saves the multi-page editor's document as another file. Also updates the text for page 0's tab, and updates this
+ * multi-page editor's input to correspond to the nested editor's.
+ */
+ @Override
+ public void doSaveAs() {
+ if (getActivePage() != sourcePage) {
+ pageSourceLoad();
+ }
+ IEditorPart editor = getEditor(sourcePage);
+ editor.doSaveAs();
+ setPageText(sourcePage, "Source");
+ setInput(editor.getEditorInput());
+ readXmlData();
+ doSave();
+ }
+
+ protected void registerPage(int pageNumber, String pageName) {
+ setPageText(pageNumber, pageName);
+ }
+
+ public void executionCompleted() {
+ pageManager.getScriptPage().onScriptRunning(false);
+ }
+
+ public void fireSaveNeeded() {
+ fileIsDirty = true;
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ public String getAlternateOutputDir() {
+ String scriptOutput = "";
+
+ IPropertyStore propertyStore = getPropertyStore();
+ scriptOutput = propertyStore.get(TestManagerStorageKeys.SCRIPT_OUTPUT_DIRECTORY_KEY);
+ if (scriptOutput == null) {
+ scriptOutput = "";
+ // TODO: Escobar
+ // try {
+ // IEditorInput coreinput = getEditorInput();
+ // if (coreinput instanceof IFileEditorInput) {
+ // scriptOutput =
+ // thisIFile.getPersistentProperty(scriptOutputQualName);
+ // } else if (coreinput instanceof TestManagerInput) {
+ // TestManagerInput input = (TestManagerInput) getEditorInput();
+ // scriptOutput =
+ // input.getValue(scriptOutputQualName.getLocalName());
+ // }
+ //
+ // scriptOutput =
+ // thisIFile.getPersistentProperty(scriptOutputQualName);
+ // } catch (CoreException e) {
+ // e.printStackTrace();
+ // }
+ }
+ return scriptOutput;
+ }
+
+ public String getDefaultConfigPath() {
+ Location user = Platform.getUserLocation();
+ String path = user.getURL().getPath();
+ File file = new File(path + File.separator + "org.eclipse.osee.ote.ui.test.manager");
+ file.mkdirs();
+ file =
+ new File(
+ path + File.separator + "org.eclipse.osee.ote.ui.test.manager" + File.separator + this.getClass().getName() + ".scriptConfig.xml");
+ file.getParentFile().mkdirs();
+ return file.getAbsolutePath();
+ }
+
+ /**
+ * @return Returns the model.
+ */
+ public TestManagerModel getModel() {
+ return model;
+ }
+
+ public String getName() {
+ return this.getTitle();
+ }
+
+ public ClassServerInst getScriptClassServer() {
+ return ClassServerInst.getInstance();
+ }
+
+ public ITestManagerFactory getTestManagerFactory() {
+ return testManagerFactory;
+ }
+
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
+ if (!(editorInput instanceof IFileEditorInput || editorInput instanceof TestManagerInput || editorInput instanceof IEditorInput)) {
+ throw new PartInitException("Invalid Input: Must be IFileEditorInput");
+ }
+ super.init(site, editorInput);
+ }
+
+ @Override
+ public boolean isDirty() {
+ if (super.isDirty()) {
+ return true;
+ }
+ return fileIsDirty;
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * Retrieves the value for the key. See <code>storeValue</code>. If the key could not be found, an empty string is
+ * returned.
+ *
+ * @param key The <code>QualifiedName</code> whose value is to be retrieved.
+ * @return The value of key, or an empty string if the key does not exist.
+ */
+ public String loadValue(QualifiedName key) {
+ TestManagerPlugin.log(Level.INFO, "loadValue: " + key.getQualifier());
+ try {
+ IEditorInput coreinput = getEditorInput();
+ if (coreinput instanceof IFileEditorInput) {
+ return thisIFile.getPersistentProperty(key);
+ } else if (coreinput instanceof TestManagerInput) {
+ TestManagerInput input = (TestManagerInput) getEditorInput();
+ return input.getValue(key.getLocalName());
+ }
+ } catch (CoreException ex) {
+ TestManagerPlugin.log(Level.SEVERE, "Can't get value: " + ex);
+ }
+ return "";
+ }
+
+ public void setPageError(int page, boolean set) {
+ if (set) {
+ setPageImage(page, errorImage);
+ } else {
+ setPageImage(page, null);
+ }
+ }
+
+ /**
+ * Stores the value for the key. The key should be one of the publicly available <code>QualifiedName</code>'s in
+ * <code>this</code>.
+ *
+ * @param key The <code>QualifiedName</code> associated with the value to be stored
+ * @param value What will be stored under the key.
+ */
+ public void storeValue(QualifiedName key, String value) {
+ TestManagerPlugin.log(Level.INFO, "storeValue: " + key.getQualifier());
+ try {
+ IEditorInput coreinput = getEditorInput();
+ if (coreinput instanceof IFileEditorInput) {
+ thisIFile.setPersistentProperty(key, value);
+ } else if (coreinput instanceof TestManagerInput) {
+ TestManagerInput input = (TestManagerInput) getEditorInput();
+ input.storeValue(key.getLocalName(), value);
+ }
+ } catch (Exception ex) {
+ TestManagerPlugin.log(Level.SEVERE, "Can't set value: " + ex);
+ }
+ }
+
+ private void pageSourceCheck() {
+ setPageError(sourcePage, model.hasParseExceptions());
+ }
+
+ private void readXmlData() {
+ TestManagerPlugin.log(Level.INFO, "readXmlData");
+ IEditorInput coreinput = getEditorInput();
+ if (coreinput instanceof IFileEditorInput) {
+ IFileEditorInput input = (IFileEditorInput) getEditorInput();
+ thisIFile = input.getFile();
+ String name = thisIFile.getName();
+ this.setPartName(name);
+ model.setConfiguration(name);
+ if (thisIFile != null) {
+ IPath containerPath = thisIFile.getRawLocation();
+ model.filename = containerPath.toOSString();
+ try {
+
+ xmlText = Lib.inputStreamToString(thisIFile.getContents());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ } else {
+ TestManagerPlugin.log(Level.SEVERE, "Can't open xml file!");
+ }
+ } else if (coreinput instanceof TestManagerInput) {
+ TestManagerInput input = (TestManagerInput) getEditorInput();
+ String name = "TestManager";
+ this.setPartName(name);
+ model.setConfiguration(name);
+ xmlText = input.getDefaultXML();
+ }
+ }
+
+ /**
+ * Creates the pages of the multi-page editor.
+ */
+ @Override
+ protected void createPages() {
+ readXmlData();
+
+ if (model.setFromXml(xmlText)) {
+ pageManager.createPages(getContainer());
+ pageSourceCreate();
+
+ fileIsDirty = false;
+ reloadSourcePage = false;
+ pageSourceCheck();
+ restoreSettings();
+ }
+ // If parse errors, send to sourcePage and set error on page
+ else {
+ if (sourceEditor == null) {
+ pageSourceCreate();
+ setActivePage(sourcePage);
+ return;
+ }
+ pageSourceCheck();
+ setPageImage(sourcePage, errorImage);
+ setActivePage(sourcePage);
+ }
+ fileIsDirty = false;
+ firePropertyChange(PROP_DIRTY);
+ TestManagerPlugin.getInstance().getOteClientService().addConnectionListener(this);
+ }
+
+ protected void handleSelection() {
+ fireSaveNeeded();
+ reloadSourcePage = true;
+ }
+
+ /**
+ * reloads pages as necessary
+ */
+ @Override
+ protected void pageChange(int newPageIndex) {
+ // NOTE: Hosts page will be updated continuously, even it if it is not
+ // the current page.
+ // so it is unnecessary to update it on pageChange.
+
+ super.pageChange(newPageIndex);
+ if (newPageIndex == sourcePage) {
+ pageSourceLoad();
+ } else {
+ if (sourceEditor == null) {
+ return;
+ }
+ String newXml = sourceEditor.getDocumentProvider().getDocument(sourceEditor.getEditorInput()).get();
+ if (sourceEditor.isDirty() || fileWasSaved) {
+ fileWasSaved = false;
+ // If we just came from sourcePage, re-parse
+ if (lastPageIndex == sourcePage) {
+ // if parse error, goto source and error
+ if (!model.setFromXml(newXml)) {
+ setActivePage(sourcePage);
+ setPageError(sourcePage, true);
+ MessageDialog.openError(getSite().getShell(), "Source Page Error",
+ "Error parsing Source page\n\n" + model.getParseExceptions());
+ return;
+ }
+ setPageError(sourcePage, false);
+ }
+ }
+ }
+ lastPageIndex = newPageIndex;
+ }
+
+ void pageSourceCreate() {
+ try {
+ if (getEditorInput() instanceof IFileEditorInput) {
+ sourceEditor = new TextEditor();
+ int index = addPage(sourceEditor, getEditorInput());
+ sourcePage = index;
+ setPageText(sourcePage, "Source");
+ }
+ } catch (PartInitException e) {
+ TestManagerPlugin.log(Level.SEVERE, "Error creating nested text editor", e);
+ ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus());
+ }
+ }
+
+ void pageSourceLoad() {
+ if (reloadSourcePage) {
+ sourceEditor.getDocumentProvider().getDocument(sourceEditor.getEditorInput()).set(model.getRawXml());
+ reloadSourcePage = false;
+ }
+ pageSourceCheck();
+ }
+
+ public void doSave() {
+ readXmlData();
+ model.setFromXml(xmlText);
+ pageManager.save();
+ OutputStream outputStream = null;
+ try {
+ File file = OseeData.getFile("testManagerSettings.xml");
+ outputStream = new FileOutputStream(file);
+ getPropertyStore().save(outputStream);
+ } catch (Exception ex) {
+ TestManagerPlugin.log(Level.SEVERE, "Error storing settings.", ex);
+ } finally {
+ if (outputStream != null) {
+ try {
+ outputStream.close();
+ } catch (IOException ex) {
+ TestManagerPlugin.log(Level.WARNING, "Error closing stream during settings storage.", ex);
+ }
+ }
+ }
+ }
+
+ public void restoreSettings() {
+ InputStream inputStream = null;
+ try {
+ File file = OseeData.getFile("testManagerSettings.xml");
+ inputStream = new FileInputStream(file);
+ getPropertyStore().load(inputStream);
+ pageManager.restore();
+ } catch (Exception ex) {
+ TestManagerPlugin.log(Level.WARNING, "Stored settings not available. Using defaults.", ex);
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException ex) {
+ TestManagerPlugin.log(Level.WARNING, "Error closing stream while loading settings.", ex);
+ }
+ }
+ }
+ }
+
+ public IPropertyStore getPropertyStore() {
+ return propertyStore;
+ }
+
+ public PageManager getPageManager() {
+ return pageManager;
+ }
+
+ public String getActionDescription() {
+ String version =
+ (String) Platform.getBundle("org.eclipse.osee.ote.ui.test.manager").getHeaders().get("Bundle-Version");
+ String serverVersion = "";
+ try {
+ serverVersion = (String) Platform.getBundle("org.eclipse.osee.ote.core").getHeaders().get("Bundle-Version");
+ } catch (Exception ex) {
+ // do nothing
+ }
+ StringBuilder builder = new StringBuilder();
+ builder.append("Problem found on OSEE TM Version: ");
+ builder.append(version);
+ builder.append("\nServer Version: ");
+ builder.append(serverVersion);
+ builder.append("\nTM File: ");
+ builder.append(getTitle());
+ builder.append("\n");
+ builder.append("OFP: \"");
+ builder.append(pageManager.getScriptPage().getOFP());
+ builder.append("\"\n");
+ builder.append("Scripts: \n");
+ builder.append(pageManager.getScriptPage().getScripts());
+ builder.append("\n");
+
+ builder.append(getPropertyStore().toString());
+
+ return builder.toString();
+ }
+
+ @Override
+ public void onConnectionLost(IServiceConnector connector, IHostTestEnvironment testHost) {
+ connectedEnv = null;
+ connector = null;
+ boolean problemEncountered = pageManager.onConnectionLost(testHost);
+ if (problemEncountered) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Disconnect Error",
+ "Test manager has encountered a problem while processing the disconnect event. See Error Log for details");
+ }
+ });
+ }
+ }
+
+ @Override
+ public void onPostConnect(ConnectionEvent event) {
+ connectedEnv = event.getEnvironment();
+ connector = event.getConnector();
+ boolean problemEncountered = pageManager.onPostConnect(event);
+ if (problemEncountered) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Connection Error",
+ "Test manager has encountered a problem while processing the connection event. See Error Log for details");
+ }
+ });
+ }
+ }
+
+ @Override
+ public void onPreDisconnect(ConnectionEvent event) {
+ event.getEnvironment();
+ connectedEnv = null;
+ connector = null;
+ boolean problemEncountered = pageManager.onPreDisconnect(event);
+ if (problemEncountered) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Disconnect Error",
+ "Test manager has encountered a problem while processing the disconnect event. See Error Log for details");
+ }
+ });
+ }
+ }
+
+ public boolean isConnected() {
+ return connectedEnv != null;
+ }
+
+ public ITestEnvironment getConnectedEnvironment() {
+ return connectedEnv;
+ }
+
+ public IServiceConnector getConnector() {
+ return connector;
+ }
+
+ public abstract void createHostWidget(Composite parent);
+
+ /**
+ * @param array
+ */
+ public void addFiles(String[] files) {
+ pageManager.getScriptPage().addFiles(files);
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorContributor.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorContributor.java
new file mode 100644
index 0000000000..afdb7b8c95
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorContributor.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.ui.test.manager.core;
+
+import java.util.logging.Level;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+
+/**
+ * Manages the installation/deinstallation of global actions for multi-page editors. Responsible for the redirection of
+ * global actions to the active editor. Multi-page contributor replaces the contributors for the individual editors in
+ * the multi-page editor.
+ */
+public class TestManagerEditorContributor extends MultiPageEditorActionBarContributor {
+ private IEditorPart activeEditorPart;
+
+ /**
+ * Creates a multi-page contributor.
+ */
+ public TestManagerEditorContributor() {
+ super();
+ createActions();
+ }
+
+ public void setActivePage(IEditorPart part) {
+ if (activeEditorPart == part) return;
+
+ activeEditorPart = part;
+
+ IActionBars actionBars = getActionBars();
+ if (actionBars != null) {
+
+ ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
+
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor,
+ ITextEditorActionConstants.DELETE));
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor,
+ ITextEditorActionConstants.UNDO));
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor,
+ ITextEditorActionConstants.REDO));
+ actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor,
+ ITextEditorActionConstants.COPY));
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor,
+ ITextEditorActionConstants.PASTE));
+ actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor,
+ ITextEditorActionConstants.SELECT_ALL));
+ actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor,
+ ITextEditorActionConstants.FIND));
+ actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor,
+ IDEActionFactory.BOOKMARK.getId()));
+ actionBars.updateActionBars();
+ }
+ }
+
+ /**
+ * Returns the action registered with the given text editor.
+ *
+ * @return IAction or null if editor is null.
+ */
+ protected IAction getAction(ITextEditor editor, String actionID) {
+ return (editor == null ? null : editor.getAction(actionID));
+ }
+
+ private void createActions() {
+ //Left here for future actions that might want to be contributed to the status
+ //line for Test Manager.
+ }
+
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+
+ if (part instanceof TestManagerEditor) {
+
+ //Left here for future actions that might want to be contributed to the status
+ //line for Test Manager.
+ }
+
+ }
+
+ @Override
+ public void contributeToStatusLine(final IStatusLineManager statusLineManager) {
+ super.contributeToStatusLine(statusLineManager);
+ try {
+ /*Job addStatusLineManager = new Job("TM contributing to the status line.") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ OseeContributionItem.addTo(statusLineManager);
+ } catch (Throwable th) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, th.getMessage(), th);
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ addStatusLineManager.schedule();*/
+
+ } catch (Throwable th) {
+ OseeLog.log(TestManagerPlugin.class, Level.WARNING, "Unable to contribute to the status line.", th);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInput.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInput.java
new file mode 100644
index 0000000000..3126d19223
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInput.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * 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.ui.test.manager.core;
+
+import java.io.File;
+import java.io.InputStream;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkspace;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+
+public class TestManagerEditorInput implements IFileEditorInput, IPersistableElement {
+
+ private static final String FACTORY_ID = TestManagerEditorInputFactory.class.getCanonicalName();
+ private IFile iFile;
+
+ public TestManagerEditorInput(File file) {
+ this(AWorkspace.fileToIFile(file));
+ }
+
+ public TestManagerEditorInput(IFile iFile) {
+ super();
+ this.iFile = iFile;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+
+ if (iFile != null && o instanceof TestManagerEditorInput) {
+ TestManagerEditorInput input = (TestManagerEditorInput) o;
+ return iFile.equals(input.getFile());
+ }
+ return false;
+ }
+
+ /*
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ public boolean exists() {
+ return true;
+ }
+
+ /*
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return iFile.getAdapter(adapter);
+ }
+
+ public String getFactoryId() {
+ return FACTORY_ID;
+ }
+
+ public IFile getFile() {
+ return iFile;
+ }
+
+ /*
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ // /*
+ // * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
+ // */
+ // public IPath getPath(Object element) {
+ // if (element instanceof NonExistingFileEditorInput) {
+ // NonExistingFileEditorInput input= (NonExistingFileEditorInput) element;
+ // return Path.fromOSString(input.fFile.getAbsolutePath());
+ // }
+ // return null;
+ // }
+
+ /*
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ public String getName() {
+ return iFile.getName();
+ }
+
+ /*
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return this;
+ }
+
+ public IStorage getStorage() throws CoreException {
+ return new IStorage() {
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return iFile.getAdapter(adapter);
+ }
+
+ public InputStream getContents() throws CoreException {
+ return iFile.getContents();
+ }
+
+ public IPath getFullPath() {
+ return iFile.getFullPath();
+ }
+
+ public String getName() {
+ return iFile.getName();
+ }
+
+ public boolean isReadOnly() {
+ return false;
+ }
+
+ };
+ }
+
+ /*
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return iFile.getName();
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return iFile.hashCode();
+ }
+
+ public void saveState(IMemento memento) {
+ if (iFile != null && iFile.getLocation().toFile().exists()) {
+ memento.putString("path", iFile.getLocation().toFile().getAbsolutePath());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInputFactory.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInputFactory.java
new file mode 100644
index 0000000000..51011bf24b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerEditorInputFactory.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.ui.test.manager.core;
+
+import java.io.File;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.IMemento;
+
+public class TestManagerEditorInputFactory implements IElementFactory {
+
+ public TestManagerEditorInputFactory() {
+ }
+
+ public IAdaptable createElement(IMemento memento) {
+ String path = memento.getString("path");
+ File file = new File(path);
+ TestManagerEditorInput input = new TestManagerEditorInput(file);
+ return input;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerInput.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerInput.java
new file mode 100644
index 0000000000..c7acf21571
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerInput.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * 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.ui.test.manager.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class TestManagerInput implements IEditorInput {
+ private HashMap<String, String> keyValue;
+
+ public TestManagerInput() {
+ keyValue = new HashMap<String, String>();
+ loadFromFile();
+ }
+
+ public boolean equals(Object object) {
+ if (object instanceof TestManagerInput) return true;
+ return false;
+ }
+
+ public boolean exists() {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public String getDefaultXML() {
+ return "<testManager>" + "<contact></contact>" + "<description>Test Manager</description>" + "</testManager>";
+
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return "TestManager";
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ return "OSEE TestManager";
+ }
+
+ public String getValue(String key) {
+ return keyValue.get(key);
+ }
+
+ public void storeValue(String key, String value) throws ParserConfigurationException, TransformerException, IOException {
+ keyValue.put(key, value);
+ saveToFile();
+ }
+
+ private File getFile() {
+ Location user = Platform.getUserLocation();
+ String path = user.getURL().getPath();
+ File file =
+ new File(
+ path + File.separator + "org.eclipse.osee.ote.ui.test.manager" + File.separator + this.getClass().getName() + ".xml");
+ file.getParentFile().mkdirs();
+ return file;
+ }
+
+ private void loadFromFile() {
+ keyValue.clear();
+ Document document;
+ try {
+ document = Jaxp.readXmlDocument(getFile());
+ NodeList viewList = document.getElementsByTagName("Pair");
+ for (int index = 0; index < viewList.getLength(); index++) {
+ Node node = viewList.item(index);
+ if (node != null && node instanceof Element) {
+ Element element = (Element) node;
+ String key = Jaxp.getChildText(element, "Key");
+ String value = Jaxp.getChildText(element, "Value");
+ if (key != null && value != null && !key.equals("") && !value.equals("")) {
+ keyValue.put(key, value);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void saveToFile() throws ParserConfigurationException, TransformerException, IOException {
+ Document document = Jaxp.newDocument();
+ Element root = document.createElement("ValuePairs");
+ document.appendChild(root);
+
+ Iterator<String> it = keyValue.keySet().iterator();
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ String value = keyValue.get(key);
+ if (key != null && value != null && !key.equals("") && !value.equals("")) {
+ Element pair = document.createElement("Pair");
+
+ Element keyElement = document.createElement("Key");
+ keyElement.setTextContent(key);
+ pair.appendChild(keyElement);
+
+ Element valueElement = document.createElement("Value");
+ valueElement.setTextContent(value);
+ pair.appendChild(valueElement);
+ root.appendChild(pair);
+ }
+ }
+
+ Jaxp.writeXmlDocument(document, getFile(), Jaxp.getPrettyFormat(document));
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerModel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerModel.java
new file mode 100644
index 0000000000..6c2ba18da9
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/core/TestManagerModel.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * 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.ui.test.manager.core;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+
+/**
+ * Base Class for all TestManagers
+ */
+public class TestManagerModel {
+
+
+ final static String CONFIGURATION = "configuration";
+ final static String CONTACT = "contact";
+ final static String DESCRIPTION = "description";
+ final static String MACHINE = "machine";
+ final static String OFP = "ofp";
+ final static String PORT = "port";
+ final static String ROOTNAME = "testManager";
+ final static String TARGET = "target";
+ public boolean finished = false;
+ private String configuration = "";
+ private String contact = "";
+ private String description = "";
+ private String[] ofps = null;
+ private List<String> parseExceptions = new ArrayList<String>();
+ private String rawXml = "";
+ private String[] targets = null;
+ protected String filename = "";
+
+ public TestManagerModel() {
+ }
+
+ /**
+ * @return Returns the configuration.
+ */
+ public String getConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * @return Returns the contact.
+ */
+ public String getContact() {
+ return contact;
+ }
+
+ /**
+ * @return Returns the description.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return Returns the ofps.
+ */
+ public String[] getOfps() {
+ return ofps;
+ }
+
+ /**
+ * @return Returns the parseExceptions.
+ */
+ public String getParseExceptions() {
+ String str = "";
+ for (int i = 0; i < parseExceptions.size(); i++) {
+ str += parseExceptions.get(i) + "\n";
+ }
+ return str;
+ }
+
+ /**
+ * @return Returns the rawXml.
+ */
+ public String getRawXml() {
+ return rawXml;
+ }
+
+ /**
+ * @return Returns the targets.
+ */
+ public String[] getTargets() {
+ return targets;
+ }
+
+ public boolean hasParseExceptions() {
+ return !parseExceptions.isEmpty();
+ }
+
+ /**
+ * @param configuration The configuration to set.
+ */
+ public void setConfiguration(String configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * @param contact The contact to set.
+ */
+ public void setContact(String contact) {
+ this.contact = contact;
+ }
+
+ /**
+ * @param description The description to set.
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * load model from xmlString; return true if successful
+ */
+ public boolean setFromXml(String xmlString) {
+ parseExceptions.clear();
+ try {
+ // Create a DOM builder and parse the fragment
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+
+ // Call this to catch parse errors
+ factory.newDocumentBuilder().parse(new InputSource(new StringReader(xmlString)));
+
+ parseDocument(xmlString);
+
+ }
+ catch (ParserConfigurationException e) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, e.toString());
+ parseExceptions.add(e.toString());
+ return false;
+ }
+ catch (SAXException e) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, e.toString());
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "xmlText *" + xmlString + "*");
+ parseExceptions.add(e.toString());
+ return false;
+ }
+ catch (IOException e) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, e.toString());
+ parseExceptions.add(e.toString());
+ return false;
+ }
+ rawXml = xmlString;
+ return true;
+ }
+
+ /**
+ * load model from filename
+ *
+ * @param filename the Name of the file to be read
+ */
+ public void setFromXmlFile(String filename) {
+ this.filename = filename;
+ setFromXml(AFile.readFile(filename));
+ }
+
+ /**
+ * @param ofps The ofps to set.
+ */
+ public void setOfps(String[] ofps) {
+ this.ofps = ofps;
+ }
+
+ /**
+ * @param targets The targets to set.
+ */
+ public void setTargets(String[] targets) {
+ this.targets = targets;
+ }
+
+ private void parseDocument(String xmlString) {
+ description = AXml.getTagData(xmlString, DESCRIPTION);
+ contact = AXml.getTagData(xmlString, CONTACT);
+ ofps = AXml.getTagDataArray(xmlString, OFP);
+ String targetArray[] = AXml.getTagDataArray(xmlString, TARGET);
+ List<String> targetVector = new ArrayList<String>();
+ for (int i = 0; i < targetArray.length; i++) {
+ String machine = AXml.getTagData(targetArray[i], MACHINE);
+ String port = AXml.getTagData(targetArray[i], PORT);
+ if (machine != null && port != null)
+ targetVector.add(machine + "," + port);
+ }
+ targets = targetVector.toArray(new String[targetVector.size()]);
+
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "description *" + description + "*");
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "contact *" + contact + "*");
+ for (int i = 0; i < ofps.length; i++) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "ofp *" + ofps[i] + "*");
+ }
+ for (int i = 0; i < targets.length; i++) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "target *" + targets[i] + "*");
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/internal/TestManagerPlugin.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/internal/TestManagerPlugin.java
new file mode 100644
index 0000000000..35571785dd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/internal/TestManagerPlugin.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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.ui.test.manager.internal;
+
+import java.util.logging.Level;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.ote.service.IOteClientService;
+import org.eclipse.osee.ote.ui.IOteConsoleService;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class TestManagerPlugin extends OseeUiActivator {
+ private static TestManagerPlugin pluginInstance; // The shared instance.
+ public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.test.manager";
+
+ private static String username = null;
+
+ private ServiceTracker oteClientServiceTracker;
+ private ServiceTracker oteConsoleServiceTracker;
+
+ /**
+ * Returns the shared instance.
+ */
+ public static TestManagerPlugin getInstance() {
+ return pluginInstance;
+ }
+
+ @Override
+ public String getPluginName() {
+ return pluginInstance.toString();
+ }
+
+ public static String getUsername() {
+ if (username == null) {
+ username = java.lang.System.getProperty("user.name");
+ username = username.replaceAll("b", "");
+ if (username.length() == 6) {
+ username = "0" + username;
+ }
+ }
+ return username;
+ }
+
+ /**
+ * The constructor.
+ */
+ public TestManagerPlugin() {
+ super();
+ pluginInstance = this;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ oteClientServiceTracker = new ServiceTracker(context, IOteClientService.class.getName(), null);
+ oteClientServiceTracker.open();
+
+ oteConsoleServiceTracker = new ServiceTracker(context, IOteConsoleService.class.getName(), null);
+ oteConsoleServiceTracker.open();
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (oteConsoleServiceTracker != null) {
+ oteConsoleServiceTracker.close();
+ }
+ if (oteClientServiceTracker != null) {
+ oteClientServiceTracker.close();
+ }
+ super.stop(context);
+ }
+
+ public IOteClientService getOteClientService() {
+ return (IOteClientService) oteClientServiceTracker.getService();
+ }
+
+ public IOteConsoleService getOteConsoleService() {
+ return (IOteConsoleService) oteConsoleServiceTracker.getService();
+ }
+
+ public static void log(Level level, String message, Throwable t) {
+ OseeLog.log(TestManagerPlugin.class, level, message, t);
+ }
+
+ public static void log(Level level, String message) {
+ log(level, message, null);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/ScriptRunJob.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/ScriptRunJob.java
new file mode 100644
index 0000000000..5367e82a33
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/ScriptRunJob.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * 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.ui.test.manager.jobs;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.ScriptPage;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ScriptRunJob extends Job {
+ private static final String JOB_NAME = "Script Run Job";
+
+ private final TestManagerEditor testManagerEditor;
+ private final List<ScriptTask> runTasks;
+
+ public ScriptRunJob(TestManagerEditor testManagerEditor) {
+ super(JOB_NAME);
+ this.testManagerEditor = testManagerEditor;
+ this.testManagerEditor.doSave();
+ ScriptPage scriptPage = getScriptPage();
+ scriptPage.getScriptTableViewer().refresh();
+ this.runTasks = scriptPage.getScriptTableViewer().getRunTasks();
+ }
+
+ public IStatus verifyOutfileLocations() {
+ final LinkedList<IStatus> failedLocations = new LinkedList<IStatus>();
+ for (ScriptTask task : runTasks) {
+ final String fileName = task.getScriptModel().getOutputModel().getRawFilename();
+ final File file = new File(fileName);
+ if (file.exists() && (!file.canWrite() || !file.canRead())) {
+ failedLocations.add(new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID, "could not access " + fileName));
+ } else if (!file.getParentFile().canWrite()) {
+ failedLocations.add(new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID, "could not access " + fileName));
+ }
+ }
+ if (failedLocations.isEmpty()) {
+ return Status.OK_STATUS;
+ } else {
+ return new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID, "unable to access out files") {
+
+ @Override
+ public boolean isMultiStatus() {
+ return true;
+ }
+
+ @Override
+ public IStatus[] getChildren() {
+ return failedLocations.toArray(new IStatus[failedLocations.size()]);
+ }
+
+ };
+ }
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ final IStatus status = verifyOutfileLocations();
+
+ if (status != Status.OK_STATUS) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ ErrorDialog.openError(
+ Display.getDefault().getActiveShell(),
+ "Script Run Error",
+ "Could not access some out file locations. Check access permissions. Click Details to see a list of failed locations",
+ status, -1);
+ }
+
+ });
+
+ return Status.OK_STATUS;
+ }
+
+ long time = System.currentTimeMillis();
+
+ clearMarkers();
+ getScriptPage().onScriptRunning(true);
+
+ long elapsed = System.currentTimeMillis() - time;
+ OseeLog.log(TestManagerPlugin.class, Level.FINE, String.format("%d milliseconds to initialize the running of scripts.", elapsed));
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, String.format("%d scripts have been batched.", runTasks.size()));
+
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ getScriptPage().getScriptManager().addTestsToQueue(runTasks);
+ }
+
+ });
+ toReturn = Status.OK_STATUS;
+ return toReturn;
+ }
+
+ private ScriptPage getScriptPage() {
+ return this.testManagerEditor.getPageManager().getScriptPage();
+ }
+
+ public boolean isRunAllowed() {
+
+ return this.testManagerEditor.getPageManager().areSettingsValidForRun();
+
+ }
+
+ private void clearMarkers() {
+ // TODO can we somehow wait until the script is actually run to remove
+ // the markers? Otherwise if the run is aborted before the script
+ // runs...
+
+ // Remove markers from scripts to be run
+ // for (ScriptTask task : runTasks) {
+ // try {
+ // MarkerSupport.deleteMarkersFromInputFile(task.getScriptModel().getIFile());
+ // }
+ // catch (Exception ex) {
+ // OseeLog.log(Activator.class, Level.SEVERE, "Unable to clear the tests markers before
+ // running the test.", ex);
+ // }
+ // }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java
new file mode 100644
index 0000000000..c8c47180c8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/jobs/StoreOutfileJob.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * 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.ui.test.manager.jobs;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.AIFile;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkspace;
+import org.eclipse.osee.framework.ui.plugin.util.OseeConsole;
+import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
+import org.eclipse.osee.ote.ui.markers.MarkerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.connection.ScriptManager;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.models.OutputModel;
+import org.eclipse.osee.ote.ui.test.manager.pages.contributions.TestManagerStorageKeys;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StoreOutfileJob extends Job {
+
+ private final ScriptManager userEnvironment;
+ private final ScriptTask scriptTask;
+ private final boolean isValidRun;
+ private final TestManagerEditor testManagerEditor;
+ private final ITestEnvironment env;
+
+ private final String clientOutfilePath;
+
+ private final String serverOutfilePath;
+
+ public StoreOutfileJob(ITestEnvironment env, TestManagerEditor testManagerEditor, ScriptManager userEnvironment, ScriptTask scriptTask, String clientOutfilePath, String serverOutfilePath, boolean isValidRun) {
+ super("Store: " + scriptTask.getName());
+ this.env = env;
+ this.scriptTask = scriptTask;
+ this.testManagerEditor = testManagerEditor;
+ this.userEnvironment = userEnvironment;
+ this.isValidRun = isValidRun;
+ this.clientOutfilePath = clientOutfilePath;
+ this.serverOutfilePath = serverOutfilePath;
+ }
+
+ public static void scheduleJob(Job job) {
+ job.setUser(false);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ if (isValidRun == true) {
+ try {
+ storeOutfile(scriptTask);
+ } catch (Exception e) {
+ return new Status(Status.ERROR, TestManagerPlugin.PLUGIN_ID, "Failed to write out file to workspace", e);
+ }
+ }
+ // scriptTask.computeExists();
+ userEnvironment.updateScriptTableViewer(scriptTask);
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ // Display.getDefault().asyncExec(new Runnable() {
+ // public void run() {
+ processOutFile(scriptTask);
+ // }
+ // });
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ return Status.OK_STATUS;
+ }
+
+ public void processOutFile(ScriptTask task) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "Processing Outfile: " + task.getName());
+ // task.computeExists();
+ File xmlSourceFile = task.getScriptModel().getOutputModel().getFile();
+ IFile javaSourceIFile = task.getScriptModel().getIFile();
+
+ if (!xmlSourceFile.exists()) {
+ TestManagerPlugin.getInstance().getOteConsoleService().writeError("Output File Not Created");
+ } else {
+ // Refresh the parent so the workspace knows the new tmo file exists
+ AWorkspace.refreshResource(javaSourceIFile);
+ task.getScriptModel().getOutputModel().updateTestPointsFromOutfile();
+ int failedPoints = task.getScriptModel().getOutputModel().getFailedTestPoints();
+ userEnvironment.updateScriptTableViewer(scriptTask);
+ if (failedPoints > 0) {
+ // Print fails in red, but don't force the console to popup
+ TestManagerPlugin.getInstance().getOteConsoleService().write(
+ String.format("Test Point Failures => %s[%d]", task.getName(), failedPoints),
+ OseeConsole.CONSOLE_ERROR, false);
+ }
+ }
+ }
+
+ private boolean isKeepSavedOutfileEnabled() {
+ return testManagerEditor.getPropertyStore().getBoolean(TestManagerStorageKeys.KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY);
+ }
+
+ private void storeOutfile(ScriptTask scriptTask) throws Exception {
+ if (clientOutfilePath.equals(serverOutfilePath) != true) {
+ // the paths are different so we need to copy the file
+ byte[] outBytes = env.getScriptOutfile(serverOutfilePath);
+ if (outBytes != null && outBytes.length > 0) {
+
+ if (isKeepSavedOutfileEnabled()) {
+ moveOutputToNextAvailableSpot(scriptTask);
+ }
+ // else {
+ // task.getScriptModel().getOutputModel().getIFile().delete(true, null);
+ // }
+ IFile file = AIFile.constructIFile(clientOutfilePath);
+ if (file != null) {
+ AIFile.writeToFile(file, new ByteArrayInputStream(outBytes));
+ MarkerPlugin.getDefault().addMarkers(file);
+ } else {
+ Lib.writeBytesToFile(outBytes, new File(clientOutfilePath));
+ }
+ }
+ }
+ }
+
+ private void moveOutputToNextAvailableSpot(ScriptTask task) {
+ OutputModel outputModel = task.getScriptModel().getOutputModel();
+ File oldFile = outputModel.getFile();
+ if (oldFile != null && oldFile.exists() && oldFile.isFile() && oldFile.canRead()) {
+ String outputExtension = "." + outputModel.getFileExtension();
+ int fileNum = 1;
+ File destFile =
+ new File(oldFile.getAbsoluteFile().toString().replaceFirst(outputExtension,
+ "." + fileNum + outputExtension));
+ if (destFile.exists()) {
+ while (destFile.exists()) {
+ fileNum++;
+ destFile =
+ new File(oldFile.getAbsoluteFile().toString().replaceFirst(outputExtension,
+ "." + fileNum + outputExtension));
+ }
+ }
+ try {
+ Lib.copyFile(oldFile, destFile);
+ } catch (IOException e2) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "Failed to move output file to next available spot", e2);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/FileModel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/FileModel.java
new file mode 100644
index 0000000000..9acb777e71
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/FileModel.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * 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.ui.test.manager.models;
+
+import java.io.File;
+import java.util.logging.Level;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkspace;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.ui.PlatformUI;
+
+
+
+public class FileModel {
+
+
+ private File file = null;
+ private IFile iFile = null;
+ private long lastModified = 0;
+ private String path = "";
+ private String rawFilename = "";
+ private String text = null;
+
+ public FileModel(String rawFilename) {
+ this.rawFilename = rawFilename;
+ if (getIFile() != null)
+ lastModified = getIFile().getModificationStamp();
+ }
+
+ public boolean exists() {
+ return getFile().exists();
+ }
+
+ /**
+ * @return Returns the file.
+ */
+ public File getFile() {
+ if (file == null) {
+ file = new File(rawFilename);
+ }
+ return file;
+ }
+
+ /**
+ * @return Returns the iFile.
+ */
+ public IFile getIFile() {
+ if (iFile == null) {
+ if (path.equals("")) {
+ if (!rawFilename.equals("")) {
+ iFile = AWorkspace.getIFile(rawFilename);
+ }
+ }
+ }
+ return iFile;
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return AFile.justFilename(rawFilename);
+ }
+
+ /**
+ * @return Returns the path.
+ */
+ public String getPath() {
+ if (iFile == null)
+ iFile = getIFile();
+ if (iFile != null)
+ path = iFile.getFullPath().toString();
+ return path;
+ }
+
+ /**
+ * @return Returns the rawFilename.
+ */
+ public String getRawFilename() {
+ return rawFilename;
+ }
+
+ public String getWorkspaceRelativePath() {
+ IWorkspace ws = ResourcesPlugin.getWorkspace();
+ IFile ifile = ws.getRoot().getFileForLocation(new Path(rawFilename));
+ if (!ifile.exists()) {
+ return null;
+ } else {
+ return ifile.getFullPath().toString();
+ }
+ }
+
+ public String getText() {
+ if (iFile == null)
+ getIFile();
+ if (iFile == null)
+ return "";
+ if (text == null || iFile.getModificationStamp() != lastModified) {
+ text = AFile.readFile(rawFilename);
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "getText: Reading file " + getName());
+ }
+ else
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "getText: Using buffered file " + getName());
+ lastModified = iFile.getModificationStamp();
+ return text;
+ }
+
+ public boolean isModified() {
+ if (iFile == null)
+ getIFile();
+ if (iFile == null) {
+ OseeLog.log(TestManagerPlugin.class, Level.WARNING, "Can't Read iFile");
+ return true;
+ }
+ return (iFile.getModificationStamp() != lastModified);
+ }
+
+ public void openEditor() {
+ if(getIFile() != null){
+ AWorkspace.openEditor(getIFile());
+ }
+ }
+
+ public void openPackageExplorer() {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "Show in explorer " + getName());
+ // Open in Package Explorer and error if can't
+ boolean success = AWorkspace.showInPackageExplorer(getIFile());
+// if(!success){
+// success = AWorkspace.showInResourceNavigator(getIFile());
+// }
+ if (!success) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Open Error",
+ "Can't Show in Explorer\n\n" + getName());
+ }
+ // As a convenience, open in Navigator, but don't error
+ success = AWorkspace.showInResourceNavigator(getIFile());
+ }
+
+ /**
+ * @param path The path to set.
+ */
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ /**
+ * @param rawFilename The rawFilename to set.
+ */
+ public void setRawFilename(String rawFilename) {
+ this.rawFilename = rawFilename;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModel.java
new file mode 100644
index 0000000000..bc329653c8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModel.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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.ui.test.manager.models;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Base Class for all TestManagers
+ */
+public class OutputModel extends FileModel {
+
+ private static final String OUTPUT_EXTENSION = "tmo";
+
+ private int failedTestPoints = 0;
+ private int passedTestPoints = 0;
+ private boolean aborted = false;
+ private boolean exists = false;
+
+ public OutputModel(String rawFilename) {
+ super(rawFilename);
+ }
+
+ public boolean doesOutfileExist() {
+ return exists;
+ }
+
+ public void updateTestPointsFromOutfile() {
+ try {
+ File outfile = getFile();
+ exists = outfile.exists();
+ if (outfile.exists() && outfile.length() > 0) {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ xmlReader.setContentHandler(new ParseTestPoints());
+ xmlReader.parse(new InputSource(new FileInputStream(outfile)));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ public int getFailedTestPoints() {
+ return failedTestPoints;
+ }
+
+ public int getPassedTestPoints() {
+ return passedTestPoints;
+ }
+
+ public void setFailedTestPoints(int failedTestPoints) {
+ this.failedTestPoints = failedTestPoints;
+ }
+
+ public void setPassedTestPoints(int passedTestPoints) {
+ this.passedTestPoints = passedTestPoints;
+ }
+
+ private class ParseTestPoints extends AbstractSaxHandler {
+
+ @Override
+ public void endElementFound(String uri, String localName, String name) throws SAXException {
+ }
+
+ @Override
+ public void startElementFound(String uri, String localName, String name, Attributes attributes) throws SAXException {
+ if ("TestPointResults".equals(name)) {
+ String fail = attributes.getValue("fail");
+ String pass = attributes.getValue("pass");
+ String aborted = attributes.getValue("aborted");
+ try {
+ failedTestPoints = Integer.parseInt(fail);
+ passedTestPoints = Integer.parseInt(pass);
+ if (aborted != null && aborted.length() > 0) {
+ OutputModel.this.aborted = Boolean.parseBoolean(aborted);
+ }
+ } catch (NumberFormatException ex) {
+
+ }
+ }
+ }
+ }
+
+ public String getFileExtension() {
+ return OUTPUT_EXTENSION;
+ }
+
+ public boolean isAborted() {
+ return aborted;
+ }
+
+ public void setAborted(boolean b) {
+ aborted = b;
+
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.done b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.done
new file mode 100644
index 0000000000..bc716d4df8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.done
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.ui.test.manager.models;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ote.ui.test.manager.connection.ScriptManager;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+
+/**
+ * @author b1528444
+ *
+ */
+public class OutputModelJob extends Job {
+
+ private static OutputModelJob singleton = null;
+ private ScriptManager scriptManager;
+ private ConcurrentLinkedQueue<ScriptTask> outputModels = new ConcurrentLinkedQueue<ScriptTask>();
+
+
+ public static void createSingleton(ScriptManager scriptManager){
+ if(singleton == null){
+ singleton = new OutputModelJob(scriptManager);
+ }
+ }
+
+ public static OutputModelJob getSingleton(){
+ return singleton;
+ }
+
+ /**
+ * @param name
+ */
+ private OutputModelJob(ScriptManager scriptManager) {
+ super("Parsing OTE Output File");
+ setUser(false);
+ this.scriptManager = scriptManager;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ while(!outputModels.isEmpty()){
+ ScriptTask task = outputModels.remove();
+ task.getScriptModel().getOutputModel().updateTestPointsFromOutfile();
+ task.getPassFail();
+ scriptManager.updateScriptTableViewerTimed(task);
+ }
+ return Status.OK_STATUS;
+ }
+
+ public void addTask(ScriptTask task){
+ outputModels.add(task);
+ schedule();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.java
new file mode 100644
index 0000000000..25a676ef41
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/OutputModelJob.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.ui.test.manager.models;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ote.ui.test.manager.connection.ScriptManager;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class OutputModelJob extends Job {
+
+ private static OutputModelJob singleton = null;
+ private ScriptManager scriptManager;
+ private ConcurrentLinkedQueue<ScriptTask> outputModels = new ConcurrentLinkedQueue<ScriptTask>();
+
+
+ public static void createSingleton(ScriptManager scriptManager){
+ if(singleton == null){
+ singleton = new OutputModelJob(scriptManager);
+ }
+ }
+
+ public static OutputModelJob getSingleton(){
+ return singleton;
+ }
+
+ /**
+ * @param name
+ */
+ private OutputModelJob(ScriptManager scriptManager) {
+ super("Parsing OTE Output File");
+ setUser(false);
+ this.scriptManager = scriptManager;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ while(!outputModels.isEmpty()){
+ ScriptTask task = outputModels.remove();
+ task.getScriptModel().getOutputModel().updateTestPointsFromOutfile();
+ task.getPassFail();
+ scriptManager.updateScriptTableViewerTimed(task);
+ }
+ return Status.OK_STATUS;
+ }
+
+ public void addTask(ScriptTask task){
+ outputModels.add(task);
+ schedule();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/ScriptModel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/ScriptModel.java
new file mode 100644
index 0000000000..6ecbae346b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/models/ScriptModel.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * 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.ui.test.manager.models;
+
+import java.io.File;
+import org.eclipse.core.filebuffers.manipulation.ContainerCreator;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osee.framework.svn.VersionControl;
+import org.eclipse.osee.framework.svn.entry.IRepositoryEntry;
+import org.eclipse.osee.framework.ui.plugin.util.AJavaProject;
+import org.eclipse.osee.ote.core.TestScript;
+import org.eclipse.osee.ote.core.environment.config.ScriptVersionConfig;
+
+public class ScriptModel extends FileModel {
+
+
+ public enum ScriptInteractionEnum {
+ BATCH, MANUAL, UNKNOWN
+ }
+
+ public class TestFileData {
+ public String absoluteFilePath = null;
+ public String classPath = null;
+ public String error = "";
+ public String name = null;
+ public String outFile = null;
+ public String projectPath = null;
+ public String rawFileName;
+
+ public ScriptVersionConfig getVersionInfo() {
+ ScriptVersionConfig scriptVersion = new ScriptVersionConfig();
+ File javaFile = new File(rawFileName);
+ if (javaFile != null && javaFile.exists() && javaFile.canRead()) {
+ IRepositoryEntry entry = VersionControl.getInstance()
+ .getRepositoryEntry(javaFile);
+ if (entry != null) {
+ scriptVersion.setRevision(entry.getVersion());
+ scriptVersion.setLocation(entry.getURL());
+ scriptVersion.setRepositoryType(entry
+ .getVersionControlSystem());
+ scriptVersion.setLastAuthor(entry.getLastAuthor());
+ scriptVersion.setLastModificationDate(entry
+ .getLastModificationDate());
+ scriptVersion.setModifiedFlag(entry.getModifiedFlag());
+ }
+ }
+ return scriptVersion;
+ }
+ }
+
+ private TestFileData javaFileData;
+ private OutputModel outputModel;
+ private TestScript testScript;
+
+
+ /**
+ * @param rawFilename
+ * @param outputDir
+ * alternate output directory for tmo output files null will
+ * default to script directory
+ */
+ public ScriptModel(String rawFilename, String outputDir) {
+ super(rawFilename);
+ javaFileData = new TestFileData();
+ javaFileData = getSunData(outputDir);
+ javaFileData.rawFileName = rawFilename;
+ outputModel = new OutputModel(javaFileData.outFile);
+ }
+
+ public ScriptInteractionEnum getInteraction() {
+ if (testScript == null)
+ return ScriptInteractionEnum.UNKNOWN;
+ if (testScript.isBatchable())
+ return ScriptInteractionEnum.BATCH;
+ else
+ return ScriptInteractionEnum.MANUAL;
+ }
+
+ /**
+ * @return Returns the outputModel.
+ */
+ public OutputModel getOutputModel() {
+ outputModel.setRawFilename(javaFileData.outFile);
+ return outputModel;
+
+ }
+
+ /**
+ * @param alternateOutputDir
+ * place output files here instead of at location of the script
+ * @return Returns sun data.
+ */
+ private TestFileData getSunData(String alternateOutputDir) {
+ javaFileData.absoluteFilePath = getRawFilename();
+ String temp = null;
+ if (javaFileData.absoluteFilePath.endsWith(".java")) {
+ temp = AJavaProject.getClassName(this.getRawFilename());
+ }
+ javaFileData.name = ((temp == null) ? new File(getRawFilename()).getName() : temp);
+ javaFileData.classPath = "";
+ alternateOutputDir = alternateOutputDir.trim();
+ if (alternateOutputDir == null || alternateOutputDir.equals("")) {
+ javaFileData.outFile = javaFileData.absoluteFilePath.replaceFirst(".java$", ".tmo");
+ if (!javaFileData.outFile.endsWith(".tmo")) {
+ javaFileData.outFile += ".tmo";
+ }
+ } else {
+ try{
+ File dir = new File(alternateOutputDir);
+ if (dir.exists() && dir.isDirectory()) {
+ javaFileData.outFile = alternateOutputDir;
+ } else {
+ if(getIFile() != null){
+ IProject project = getIFile().getProject();
+ IFolder folder = project.getFolder(alternateOutputDir);
+ if(!folder.exists()){
+ ContainerCreator containerCreator = new ContainerCreator(folder.getWorkspace(), folder.getFullPath());
+ containerCreator.createContainer(new NullProgressMonitor());
+ }
+ javaFileData.outFile = folder.getLocation().toFile().getAbsolutePath();
+ }
+ }
+
+ javaFileData.outFile += File.separator;
+ javaFileData.outFile += getName();
+ javaFileData.outFile = javaFileData.outFile.replaceFirst(".java$",".tmo");
+ if (!javaFileData.outFile.endsWith(".tmo")) {
+ javaFileData.outFile += ".tmo";
+ }
+ } catch (CoreException ex){
+ ex.printStackTrace();
+ javaFileData.outFile = javaFileData.absoluteFilePath.replaceFirst(".java$", ".tmo");
+ if (!javaFileData.outFile.endsWith(".tmo")) {
+ javaFileData.outFile += ".tmo";
+ }
+ }
+ }
+// outputModel = new OutputModel(javaFileData.outFile);
+
+
+// OseeLog.log(TestManagerPlugin.class, Level.FINE, "javaFileData.absoluteJavaPath *"+ javaFileData.absoluteFilePath + "*");
+// OseeLog.log(TestManagerPlugin.class, Level.FINE, "javaFileData.className *" + javaFileData.name + "*");
+// OseeLog.log(TestManagerPlugin.class, Level.FINE, "javaFileData.classPath *" + javaFileData.classPath + "*");
+// OseeLog.log(TestManagerPlugin.class, Level.FINE, "javaFileData.outFile *" + javaFileData.outFile+ "*");
+
+ return javaFileData;
+ }
+
+ public TestFileData updateScriptModelInfo(String alternateOutputDir){
+ TestFileData javaFileData = getSunData(alternateOutputDir);
+ outputModel = new OutputModel(javaFileData.outFile);
+ return javaFileData;
+ }
+
+ public String getTestClass(){
+ return javaFileData.name;
+ }
+
+ /**
+ * @param outputModel
+ * The outputModel to set.
+ */
+ public void setOutputModel(OutputModel outputModel) {
+ this.outputModel = outputModel;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/operations/AddIFileToTestManager.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/operations/AddIFileToTestManager.java
new file mode 100644
index 0000000000..652cb0b76a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/operations/AddIFileToTestManager.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.ui.test.manager.operations;
+
+import java.util.List;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.util.PluginUtil;
+import org.eclipse.osee.ote.ui.test.manager.util.TestManagerSelectDialog;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AddIFileToTestManager {
+ private static AddIFileToTestManager instance = null;
+
+ private AddIFileToTestManager() {
+ }
+
+ public static AddIFileToTestManager getOperation() {
+ if (instance == null) {
+ instance = new AddIFileToTestManager();
+ }
+ return instance;
+ }
+
+ public void removeAllScriptsFromPage() {
+ if (PluginUtil.areTestManagersAvailable() != true) {
+ AWorkbench.popup("ERROR", "Test Manager Not Opened");
+ return;
+ }
+ for(TestManagerEditor editor: PluginUtil.getTestManagers()){
+ editor.getPageManager().getScriptPage().getScriptTableViewer().getTaskList().removeAllTasks();
+ }
+ }
+
+ public void addFilesToScriptPage(List<String> files, boolean removeOtherScripts){
+ if (PluginUtil.areTestManagersAvailable() != true) {
+ AWorkbench.popup("ERROR", "Test Manager Not Opened");
+ return;
+ }
+ TestManagerEditor[] itemsToOpen = PluginUtil.getTestManagers();
+ for (TestManagerEditor tme : itemsToOpen) {
+ if(removeOtherScripts){
+ tme.getPageManager().getScriptPage().getScriptTableViewer().getTaskList().removeAllTasks();
+ }
+ tme.addFiles(files.toArray(new String[files.size()]));
+ }
+ }
+
+ public void addIFileToScriptsPage(String fullPath) {
+ if (PluginUtil.areTestManagersAvailable() != true) {
+ AWorkbench.popup("ERROR", "Test Manager Not Opened");
+ return;
+ }
+ TestManagerEditor[] itemsToOpen = PluginUtil.getTestManagers();
+ if (itemsToOpen.length > 1) {
+ TestManagerEditor[] selected = TestManagerSelectDialog.getTestManagerFromUser();
+ if (selected.length > 0) {
+ handleItemsSelected(itemsToOpen, fullPath);
+ }
+ } else {
+ handleItemsSelected(itemsToOpen, fullPath);
+ }
+ }
+
+ private void handleItemsSelected(TestManagerEditor[] items, String fullPath) {
+ for (TestManagerEditor tme : items) {
+ tme.addFile(fullPath);
+ }
+ openFirstItemSelected(items);
+ }
+
+ private void openFirstItemSelected(TestManagerEditor[] items) {
+ // Show first Test Manager Editor
+ TestManagerEditor tme = items[0];
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ page.activate(tme.getSite().getPart());
+ tme.activateScriptsPage();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/AdvancedPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/AdvancedPage.java
new file mode 100644
index 0000000000..64fc8f9a9a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/AdvancedPage.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.jdk.core.type.IPropertyStore;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.plugin.widgets.IPropertyStoreBasedControl;
+import org.eclipse.osee.framework.ui.plugin.widgets.PropertyStoreControlContributions;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class AdvancedPage extends TestManagerPage {
+
+ public static final OseeUiActivator plugin = TestManagerPlugin.getInstance();
+ private static final String pageName = "Advanced";
+ private final List<IPropertyStoreBasedControl> contributions;
+ private volatile boolean contributionsInitialized;
+
+ public AdvancedPage(Composite parent, int style, TestManagerEditor parentTestManager) {
+ super(parent, style, parentTestManager);
+ this.contributions = new ArrayList<IPropertyStoreBasedControl>();
+ contributionsInitialized = false;
+ }
+
+ private synchronized List<IPropertyStoreBasedControl> getContributions() {
+ if (!contributionsInitialized) {
+ contributionsInitialized = true;
+ contributions.addAll(PropertyStoreControlContributions.getContributions(TestManagerPlugin.PLUGIN_ID));
+ }
+ return contributions;
+ }
+
+ @Override
+ public void createPage() {
+ super.createPage();
+ Composite parent = (Composite) getContent();
+ Composite extensionPanel = new Composite(parent, SWT.NONE);
+ GridLayout gL = new GridLayout();
+ gL.marginWidth = 0;
+ gL.marginHeight = 0;
+ extensionPanel.setLayout(gL);
+ extensionPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Collections.sort(getContributions(), new Comparator<IPropertyStoreBasedControl>() {
+
+ @Override
+ public int compare(IPropertyStoreBasedControl o1, IPropertyStoreBasedControl o2) {
+ return Integer.valueOf(o1.getPriority()).compareTo(Integer.valueOf(o2.getPriority()));
+ }
+ });
+ for (IPropertyStoreBasedControl widget : getContributions()) {
+
+ try {
+ widget.createControl(extensionPanel);
+ } catch (Throwable e) {
+ TestManagerPlugin.log(Level.SEVERE, "problem creating advance page contribution", e);
+ }
+ }
+
+ createBlankArea(parent, 0, true);
+ computeScrollSize();
+ TestManagerPlugin.getInstance().setHelp(this, "tm_advanced_page", "org.eclipse.osee.framework.help.ui");
+ }
+
+ @Override
+ public String getPageName() {
+ return pageName;
+ }
+
+ private Control createBlankArea(Composite parent, int height, boolean allVertical) {
+ Composite blank = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ GridData gd = new GridData();
+ gd.minimumHeight = height;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = allVertical;
+ blank.setLayout(gridLayout);
+ blank.setLayoutData(gd);
+ return parent;
+ }
+
+ protected void createAreaDefaultLayout(Composite parent, boolean allHorizontal, boolean allVertical) {
+ GridLayout layout = new GridLayout();
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.grabExcessHorizontalSpace = allHorizontal;
+ data.grabExcessVerticalSpace = allVertical;
+ parent.setLayout(layout);
+ parent.setLayoutData(data);
+ }
+
+ @Override
+ public void saveData() {
+ IPropertyStore propertyStore = getTestManager().getPropertyStore();
+ for (IPropertyStoreBasedControl contribution : getContributions()) {
+ contribution.save(propertyStore);
+ }
+ }
+
+ @Override
+ public void restoreData() {
+ IPropertyStore propertyStore = getTestManager().getPropertyStore();
+ for (IPropertyStoreBasedControl contribution : getContributions()) {
+ contribution.load(propertyStore);
+ }
+ }
+
+ @Override
+ public boolean areSettingsValidForRun() {
+ boolean result = true;
+ for (IPropertyStoreBasedControl contribution : getContributions()) {
+ result &= contribution.areSettingsValid();
+ }
+ return result;
+ }
+
+ @Override
+ public String getErrorMessage() {
+ StringBuilder builder = new StringBuilder();
+ for (IPropertyStoreBasedControl contribution : getContributions()) {
+ String message = contribution.getErrorMessage();
+ if (Strings.isValid(message)) {
+ if (builder.length() > 0) {
+ builder.append("\n");
+ }
+ builder.append(message);
+ }
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public boolean onConnection(ConnectionEvent event) {
+ return false;
+ }
+
+ @Override
+ public boolean onDisconnect(ConnectionEvent event) {
+ return false;
+ }
+
+ @Override
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/HostPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/HostPage.java
new file mode 100644
index 0000000000..f6f809e833
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/HostPage.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+public class HostPage extends TestManagerPage {
+
+ private static final String pageName = "Hosts";
+
+ public HostPage(Composite parent, int style,
+ TestManagerEditor parentTestManager) {
+ super(parent, style, parentTestManager);
+ createPage();
+ TestManagerPlugin.getInstance().setHelp(this, "tm_hosts_page", "org.eclipse.osee.framework.help.ui");
+ }
+
+ @Override
+ public String getPageName() {
+ return pageName;
+ }
+
+ protected void createPage() {
+ super.createPage();
+ Composite parent = (Composite) getContent();
+
+ Group hostGroup = new Group(parent, SWT.NONE);
+ hostGroup.setLayout(new GridLayout());
+ hostGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ hostGroup.setText("Double click a Host to Connect/Disconnect");
+
+ getTestManager().createHostWidget(hostGroup);
+ computeScrollSize();
+ }
+
+ @Override
+ public boolean areSettingsValidForRun() {
+ return getTestManager().isConnected();
+ }
+
+ @Override
+ public void restoreData() {
+ // Do Nothing
+ }
+
+ @Override
+ public void saveData() {
+ // Do Nothing
+ }
+
+ @Override
+ public String getErrorMessage() {
+ StringBuilder builder = new StringBuilder();
+ if (areSettingsValidForRun() != true) {
+ builder.append("Connect to a Test Server");
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public boolean onConnection(ConnectionEvent event) {
+ return false;
+
+ }
+
+ @Override
+ public boolean onDisconnect(ConnectionEvent event) {
+ return false;
+
+ }
+
+ @Override
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/OverviewPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/OverviewPage.java
new file mode 100644
index 0000000000..33d4d2c8e8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/OverviewPage.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.plugin.core.IActionable;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author David Diepenbrock
+ */
+public class OverviewPage extends TestManagerPage implements IActionable {
+
+ private static final String pageName = "Overview";
+ private static final String release = "";
+ Map<LabelEnum, Label> labelMap;
+
+ private enum LabelEnum {
+ TM_Release("This Test Manager will only work with TM Server Release " + release),
+ Configuration,
+ Contact,
+ Description;
+
+ private String toolTip;
+
+ LabelEnum() {
+ this("");
+ }
+
+ LabelEnum(String toolTip) {
+ this.toolTip = toolTip;
+ }
+
+ public String getToolTipText() {
+ return toolTip;
+ }
+
+ public String toString() {
+ return name().replaceAll("_", " ");
+ }
+ }
+
+ /**
+ * Creates and populates the Overview Page
+ *
+ * @param parent
+ * @param style
+ * @param parentTestManager
+ */
+ public OverviewPage(Composite parent, int style, TestManagerEditor parentTestManager) {
+ super(parent, style, parentTestManager);
+ createPage();
+ updateLabelText();
+ computeScrollSize();
+ TestManagerPlugin.getInstance().setHelp(this, "tm_overview_page", "org.eclipse.osee.framework.help.ui");
+ }
+
+ /**
+ * @return Returns the pageName.
+ */
+ public String getPageName() {
+ return pageName;
+ }
+
+ /**
+ * Refreshes the label's text based upon the test manager's model.
+ */
+ public void updateLabelText() {
+ for (LabelEnum enumEntry : LabelEnum.values()) {
+ String toSet = "";
+ Label label = labelMap.get(enumEntry);
+ switch (enumEntry) {
+ case TM_Release:
+ toSet = release;
+ break;
+ case Configuration:
+ toSet = getTestManager().getModel().getConfiguration();
+ break;
+ case Contact:
+ toSet = getTestManager().getModel().getContact();
+ break;
+ case Description:
+ toSet = getTestManager().getModel().getDescription();
+ break;
+ default:
+ break;
+ }
+ label.setText(toSet);
+ }
+ }
+
+ protected void createPage() {
+ super.createPage();
+ Composite parent = (Composite) getContent();
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ labelMap = new HashMap<LabelEnum, Label>();
+ for (LabelEnum enumEntry : LabelEnum.values()) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(enumEntry.toString() + ": ");
+
+ Label updateableLabel = new Label(composite, SWT.NONE);
+ updateableLabel.setToolTipText(enumEntry.getToolTipText());
+
+ labelMap.put(enumEntry, updateableLabel);
+ }
+ OseeUiActions.addButtonToEditorToolBar(this, TestManagerPlugin.getInstance(), composite, TestManagerEditor.namespace,
+ "Test Manager");
+
+ }
+
+ public String getActionDescription() {
+ return "";
+ }
+
+ @Override
+ public boolean areSettingsValidForRun() {
+ return true;
+ }
+
+ @Override
+ public void restoreData() {
+ // Do Nothing
+ }
+
+ @Override
+ public void saveData() {
+ // Do Nothing
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return "";
+ }
+
+ @Override
+ public boolean onConnection(ConnectionEvent event) {
+ return false;
+ }
+
+ @Override
+ public boolean onDisconnect(ConnectionEvent event) {
+ return false;
+
+ }
+
+ @Override
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java
new file mode 100644
index 0000000000..0e0e74ca3a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/ScriptPage.java
@@ -0,0 +1,470 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import java.rmi.RemoteException;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.configuration.LoadWidget;
+import org.eclipse.osee.ote.ui.test.manager.configuration.SaveWidget;
+import org.eclipse.osee.ote.ui.test.manager.connection.ScriptManager;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.jobs.ScriptRunJob;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.PlatformUI;
+
+public abstract class ScriptPage extends TestManagerPage {
+
+ private static final String NOT_CONNECTED = "<< NOT_CONNECTED >>";
+
+ public enum UpdateableLabel {
+ HOSTLABEL,
+ CONFIGPATHLABEL;
+ }
+
+ public static final OseeUiActivator plugin = TestManagerPlugin.getInstance();
+ private static final String pageName = "Scripts";
+ private ToolItem abortButton;
+ private ToolItem abortBatchButton;
+ private CoolBar coolBar;
+ private ToolItem deleteButton;
+ private Label hostConnectLabel;
+ private LoadWidget loadWidget;
+ protected ToolItem runButton;
+ private SaveWidget saveWidget;
+ private ScriptTableViewer scriptTable;
+ private StatusWindowWidget statusWindow;
+ private final TestManagerEditor testManagerEditor;
+
+ public ScriptPage(Composite parent, int style, TestManagerEditor parentTestManager) {
+ super(parent, style, parentTestManager);
+ this.testManagerEditor = parentTestManager;
+ }
+
+ public void addFile(String fullPath) {
+ scriptTable.addFile(fullPath);
+ }
+
+ @Override
+ public void createPage() {
+ super.createPage();
+ Composite parent = (Composite) getContent();
+ coolBar = new CoolBar(parent, SWT.FLAT);
+
+ createControlsToolBar(coolBar);
+ createConfigurationToolBar(coolBar);
+ packCoolBar();
+
+ SashForm sashForm = new SashForm(parent, SWT.NONE);
+ sashForm.setLayout(new GridLayout());
+ sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ sashForm.setOrientation(SWT.VERTICAL);
+ sashForm.SASH_WIDTH = 3;
+
+ createScriptTableSection(sashForm);
+ createStatusWindow(sashForm);
+
+ sashForm.setWeights(new int[] {8, 2});
+ computeScrollSize();
+
+ TestManagerPlugin.getInstance().setHelp(this, "tm_scripts_page", "org.eclipse.osee.framework.help.ui");
+ }
+
+ public void loadStorageString() {
+ scriptTable.loadStorageString(testManagerEditor.loadValue(testManagerEditor.scriptsQualName));
+ }
+
+ @Override
+ public void dispose() {
+ scriptTable.dispose();
+ testManagerEditor.storeValue(testManagerEditor.scriptsQualName, scriptTable.getStorageString());
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "ScriptPage Dispose Called");
+ super.dispose();
+ }
+
+ public CoolBar getCoolBar() {
+ return coolBar;
+ }
+
+ public String getOFP() {
+ if (hostConnectLabel == null) {
+ return "";
+ }
+ return hostConnectLabel.getText();
+ }
+
+ @Override
+ public String getPageName() {
+ return pageName;
+ }
+
+ public String getScripts() {
+ if (scriptTable == null) {
+ return "";
+ } else if (scriptTable.getTaskList() == null) {
+ return "";
+ }
+ return scriptTable.getTaskList().toString();
+ }
+
+ public ScriptTableViewer getScriptTableViewer() {
+ return scriptTable;
+ }
+
+ public StatusWindowWidget getStatusWindow() {
+ return statusWindow;
+ }
+
+ public void onScriptRunning(final boolean running) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (running) {
+ runButton.setEnabled(false);
+ abortButton.setEnabled(true);
+ abortBatchButton.setEnabled(true);
+ } else {
+ runButton.setEnabled(true);
+ abortButton.setEnabled(false);
+ abortBatchButton.setEnabled(false);
+ }
+ }
+ });
+ }
+
+ public void packCoolBar() {
+ Point size = this.getSize();
+ coolBar.setSize(coolBar.computeSize(size.x, size.y));
+ }
+
+ private void createConfigurationToolBar(CoolBar coolBar) {
+ CoolItem configCoolItem = new CoolItem(coolBar, SWT.NONE);
+ ToolBar configToolBar = new ToolBar(coolBar, SWT.FLAT | SWT.HORIZONTAL);
+
+ saveWidget = new SaveWidget(this);
+ saveWidget.createToolItem(configToolBar);
+
+ loadWidget = new LoadWidget(this);
+ loadWidget.createToolItem(configToolBar);
+
+ deleteButton = new ToolItem(configToolBar, SWT.PUSH | SWT.CENTER);
+ deleteButton.setImage(ImageManager.getImage(OteTestManagerImage.FILE_DELETE));
+ deleteButton.setToolTipText("Deletes Selected (highlighted) Scripts");
+ deleteButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleDeleteButton();
+ }
+ });
+ deleteButton.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.button == 3) {
+ handleDeleteButton();
+ }
+ }
+ });
+
+ configToolBar.pack();
+
+ Point size = configToolBar.getSize();
+ configCoolItem.setControl(configToolBar);
+ configCoolItem.setSize(configCoolItem.computeSize(size.x, size.y));
+ configCoolItem.setMinimumSize(size);
+ }
+
+ private void createControlsToolBar(CoolBar coolBar) {
+ CoolItem controlsCoolItem = new CoolItem(coolBar, SWT.NONE);
+ ToolBar controlsToolBar = new ToolBar(coolBar, SWT.FLAT | SWT.HORIZONTAL);
+
+ runButton = new ToolItem(controlsToolBar, SWT.PUSH | SWT.CENTER);
+ runButton.setImage(ImageManager.getImage(OteTestManagerImage.SEL_RUN_EXEC));
+ runButton.setDisabledImage(ImageManager.getImage(OteTestManagerImage.UNSEL_RUN_EXEC));
+ runButton.setToolTipText("Runs the Checked Scripts");
+ runButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleRunButton();
+ }
+ });
+ runButton.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.button == 3) {
+ handleRunButton();
+ }
+ }
+ });
+ runButton.setEnabled(false);
+
+ // Create and configure the "Abort" button
+ abortButton = new ToolItem(controlsToolBar, SWT.PUSH | SWT.CENTER);
+ abortButton.setImage(ImageManager.getImage(OteTestManagerImage.SEL_ABORT_STOP));
+ abortButton.setDisabledImage(ImageManager.getImage(OteTestManagerImage.UNSEL_ABORT_STOP));
+ abortButton.setToolTipText("Abort Currently Running Script");
+ abortButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleAbortButton();
+ abortBatchButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ Timer timer = new Timer();
+ timer.schedule(new EnabledAbortsTimer(), 30000);
+ }
+ });
+ abortButton.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.button == 3) {
+ handleAbortButton();
+ abortBatchButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ Timer timer = new Timer();
+ timer.schedule(new EnabledAbortsTimer(), 30000);
+ }
+ }
+ });
+ abortButton.setEnabled(false);
+
+ abortBatchButton = new ToolItem(controlsToolBar, SWT.PUSH | SWT.CENTER);
+ abortBatchButton.setImage(ImageManager.getImage(OteTestManagerImage.SEL_BATCH_ABORT_STOP));
+ abortBatchButton.setDisabledImage(ImageManager.getImage(OteTestManagerImage.UNSEL_BATCH_ABORT_STOP));
+ abortBatchButton.setToolTipText("Abort Script Batch");
+ abortBatchButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleBatchAbortButton();
+ abortBatchButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ Timer timer = new Timer();
+ timer.schedule(new EnabledAbortsTimer(), 30000);
+ }
+ });
+ abortBatchButton.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event e) {
+ if (e.button == 3) {
+ handleBatchAbortButton();
+ abortBatchButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ Timer timer = new Timer();
+ timer.schedule(new EnabledAbortsTimer(), 30000);
+ }
+ }
+ });
+ abortBatchButton.setEnabled(false);
+
+ controlsToolBar.pack();
+
+ Point size = controlsToolBar.getSize();
+ controlsCoolItem.setControl(controlsToolBar);
+ controlsCoolItem.setSize(controlsCoolItem.computeSize(size.x, size.y));
+ controlsCoolItem.setMinimumSize(size);
+ }
+
+ private void createScriptTableSection(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ scriptTable = new ScriptTableViewer(composite, this.getTestManager());
+ // scriptTable.addDisposeListener(new DisposeListener() {
+ // public void widgetDisposed(DisposeEvent e) {
+ // testManagerEditor.storeValue(testManagerEditor.scriptsQualName, scriptTable.getStorageString());
+ // }
+ // });
+
+ }
+
+ private void createStatusWindow(Composite parent) {
+ statusWindow = new StatusWindowWidget(parent);
+
+ statusWindow.setLabelAndValue(UpdateableLabel.HOSTLABEL.name(), "Selected Host", NOT_CONNECTED, SWT.BOLD,
+ SWT.COLOR_DARK_RED);
+
+ String selectedFile = testManagerEditor.loadValue(testManagerEditor.configFileName);
+ if (selectedFile == null || selectedFile.equals("")) {
+ selectedFile = testManagerEditor.getDefaultConfigPath();
+ testManagerEditor.storeValue(testManagerEditor.configFileName, selectedFile);
+ }
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, "The default config is: " + selectedFile);
+
+ statusWindow.setLabelAndValue(UpdateableLabel.CONFIGPATHLABEL.name(), "Config File Path", selectedFile);
+
+ saveWidget.setStatusLabel(statusWindow);
+ loadWidget.setStatusLabel(statusWindow);
+
+ // // Status ICON Labels
+ // connectStatusIconLabel = new
+ // Label(statusWindow.getStatusIconComposite(), SWT.NONE);
+ // hostWidget.setConnectStatusLabel(connectStatusIconLabel);
+ // connectStatusIconLabel.setVisible(false);
+
+ statusWindow.refresh();
+ }
+
+ // TODO this stuff needs some updating too...
+ protected void handleAbortButton() {
+ TestManagerPlugin.getInstance().getOteConsoleService().write("Aborting Test Script...");
+ try {
+ getScriptManager().abortScript(false);
+ } catch (RemoteException e) {
+ TestManagerPlugin.getInstance().getOteConsoleService().writeError(Lib.exceptionToString(e));
+ }
+ }
+
+ // TODO this stuff needs some updating too...
+ protected void handleBatchAbortButton() {
+ TestManagerPlugin.getInstance().getOteConsoleService().write("Aborting Test Script Batch...");
+ try {
+ getScriptManager().abortScript(true);
+ } catch (RemoteException e) {
+ TestManagerPlugin.getInstance().getOteConsoleService().writeError(Lib.exceptionToString(e));
+ }
+ }
+
+ private void handleDeleteButton() {
+ scriptTable.removeSelectedTasks();
+ }
+
+ private void handleRunButton() {
+ ScriptRunJob runJob = new ScriptRunJob(getTestManager());
+ if (runJob.isRunAllowed()) {
+ runJob.setPriority(Job.LONG);
+ runJob.setUser(true);
+ runJob.schedule();
+ } else {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "Test Manager Settings Error");
+ }
+ }
+
+ private class EnabledAbortsTimer extends TimerTask {
+
+ @Override
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ if (!runButton.isEnabled()) {
+ abortBatchButton.setEnabled(true);
+ abortButton.setEnabled(true);
+ }
+ } catch (Throwable th) {
+
+ }
+ }
+ });
+
+ }
+
+ }
+
+ @Override
+ public boolean areSettingsValidForRun() {
+ return getScriptTableViewer().getRunTasks().size() > 0;
+ }
+
+ @Override
+ public String getErrorMessage() {
+ StringBuilder builder = new StringBuilder();
+ if (getScriptTableViewer().getRunTasks().size() <= 0) {
+ builder.append("Scripts not selected.");
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public boolean onConnection(final ConnectionEvent event) {
+ boolean result = getScriptManager().connect(event);
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ runButton.setEnabled(true);
+ abortButton.setEnabled(false);
+ abortBatchButton.setEnabled(false);
+ scriptTable.onConnectionChanged(true);
+ statusWindow.setValue(UpdateableLabel.HOSTLABEL.name(), event.getProperties().getStation(), SWT.BOLD,
+ SWT.COLOR_DARK_GREEN);
+ statusWindow.refresh();
+ }
+
+ });
+ return result;
+ }
+
+ @Override
+ public boolean onDisconnect(ConnectionEvent event) {
+ boolean result = getScriptManager().disconnect(event);
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ runButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ abortBatchButton.setEnabled(false);
+ scriptTable.onConnectionChanged(false);
+ statusWindow.setValue(UpdateableLabel.HOSTLABEL.name(), NOT_CONNECTED, SWT.BOLD, SWT.COLOR_DARK_RED);
+ statusWindow.refresh();
+ }
+ });
+ return result;
+ }
+
+ @Override
+ public boolean onConnectionLost(IHostTestEnvironment testHost) {
+ boolean result = getScriptManager().onConnectionLost(testHost);
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ runButton.setEnabled(false);
+ abortButton.setEnabled(false);
+ abortBatchButton.setEnabled(false);
+ scriptTable.onConnectionChanged(false);
+ statusWindow.setValue(UpdateableLabel.HOSTLABEL.name(), NOT_CONNECTED, SWT.BOLD, SWT.COLOR_DARK_RED);
+ statusWindow.refresh();
+ }
+ });
+ return result;
+ }
+
+ public abstract ScriptManager getScriptManager();
+
+ /**
+ * @param files
+ */
+ public void addFiles(String[] files) {
+ scriptTable.addFiles(files);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/StatusWindowWidget.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/StatusWindowWidget.java
new file mode 100644
index 0000000000..71e656c834
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/StatusWindowWidget.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.framework.ui.swt.FormattedText;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StatusWindowWidget {
+ private Map<String, Map<EntryAttribute, Object>> labelValueMap;
+ private List<String> keys;
+ private FormattedText statusTextArea;
+
+ private enum EntryAttribute {
+ LABEL, VALUE, STYLE, COLOR;
+ }
+
+ public StatusWindowWidget(Composite parent) {
+ keys = new ArrayList<String>();
+ labelValueMap = new HashMap<String, Map<EntryAttribute, Object>>();
+ statusTextArea = new FormattedText(parent, SWT.BORDER, SWT.DEFAULT, SWT.DEFAULT, false);
+ statusTextArea.setTextAreaBackground(SWT.COLOR_WHITE);
+ }
+
+ public void setLabelAndValue(String key, String label, String value, int style, int color) {
+ if (!keys.contains(key)) {
+ keys.add(key);
+ }
+ Map<EntryAttribute, Object> entry = new HashMap<EntryAttribute, Object>();
+ entry.put(EntryAttribute.LABEL, label);
+ entry.put(EntryAttribute.VALUE, value);
+ entry.put(EntryAttribute.STYLE, new Integer(style));
+ entry.put(EntryAttribute.COLOR, new Integer(color));
+
+ labelValueMap.put(key, entry);
+ }
+
+ public void setLabelAndValue(String key, String label, String value) {
+ setLabelAndValue(key, label, value, SWT.NORMAL, SWT.COLOR_BLACK);
+ }
+
+ public String getValue(String key) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ EntryAttribute attribute = EntryAttribute.VALUE;
+ return ((entry != null && entry.get(attribute) != null) ? (String) entry.get(attribute) : "");
+ }
+
+ public String getLabel(String key) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ EntryAttribute attribute = EntryAttribute.LABEL;
+ return ((entry != null && entry.get(attribute) != null) ? (String) entry.get(attribute) : "");
+ }
+
+ public void setLabel(String key, String label) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ entry.put(EntryAttribute.LABEL, label);
+ }
+ else {
+ setLabelAndValue(key, label, "");
+ }
+ }
+
+ public void setValueStyle(String key, int style) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ entry.put(EntryAttribute.STYLE, new Integer(style));
+ }
+ }
+
+ public void setValueColor(String key, int color) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ entry.put(EntryAttribute.STYLE, new Integer(color));
+ }
+ }
+
+ public void setValue(String key, String value, int style, int color) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ entry.put(EntryAttribute.VALUE, value);
+ entry.put(EntryAttribute.STYLE, new Integer(style));
+ entry.put(EntryAttribute.COLOR, new Integer(color));
+ }
+ else {
+ setLabelAndValue(key, "", value, style, color);
+ }
+ }
+
+ public void setValue(String key, String value) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ entry.put(EntryAttribute.VALUE, value);
+ }
+ else {
+ setLabelAndValue(key, "", value);
+ }
+ }
+
+ public void refresh() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ statusTextArea.clearTextArea();
+ for (String key : keys) {
+ Map<EntryAttribute, Object> entry = labelValueMap.get(key);
+ if (entry != null) {
+ String label = (String) entry.get(EntryAttribute.LABEL);
+ String value = (String) entry.get(EntryAttribute.VALUE);
+ Integer style = (Integer) entry.get(EntryAttribute.STYLE);
+ Integer color = (Integer) entry.get(EntryAttribute.COLOR);
+ statusTextArea.addText("\t" + label + ": ", SWT.BOLD, SWT.COLOR_DARK_BLUE);
+ statusTextArea.addText(value + "\n", style, color);
+ }
+ }
+ }
+ });
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/TestManagerPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/TestManagerPage.java
new file mode 100644
index 0000000000..4eef33fee4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/TestManagerPage.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages;
+
+import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
+import org.eclipse.osee.ote.service.ConnectionEvent;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author David Diepenbrock
+ */
+public abstract class TestManagerPage extends ScrolledComposite {
+
+ private final TestManagerEditor testManager;
+ private Composite mainComposite;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public TestManagerPage(Composite parent, int style, TestManagerEditor parentTestManager) {
+ super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL);
+ this.testManager = parentTestManager;
+ }
+
+ protected void createPage() {
+ GridLayout gridLayout = new GridLayout(1, true);
+ this.setLayout(gridLayout);
+
+ this.mainComposite = new Composite(this, SWT.NONE);
+ this.mainComposite.setLayout(new GridLayout());
+ this.mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ this.setContent(mainComposite);
+ this.setExpandHorizontal(true);
+ this.setExpandVertical(true);
+ }
+
+ public void computeScrollSize() {
+ this.computeScrollSize(mainComposite);
+ }
+
+ private void computeScrollSize(Composite viewableArea) {
+ this.setMinSize(viewableArea.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ }
+
+ public TestManagerEditor getTestManager() {
+ return testManager;
+ }
+
+ public abstract String getPageName();
+
+ public abstract void saveData();
+
+ public abstract void restoreData();
+
+ public abstract boolean areSettingsValidForRun();
+
+ public abstract String getErrorMessage();
+
+ /**
+ * called when test manager is connected to a test host. A return value of true will cause test manager to prompt the
+ * user to check the log. Thus any problems that occur during connection processing should be handled and logged.
+ *
+ * @param event
+ * @return true if there were problems during processing and false otherwise.
+ */
+ public abstract boolean onConnection(ConnectionEvent event);
+
+ public abstract boolean onDisconnect(ConnectionEvent event);
+
+ public abstract boolean onConnectionLost(IHostTestEnvironment testHost);
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/ScriptExecutionContribution.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/ScriptExecutionContribution.java
new file mode 100644
index 0000000000..447bd10326
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/ScriptExecutionContribution.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.contributions;
+
+import org.eclipse.osee.framework.jdk.core.type.IPropertyStore;
+import org.eclipse.osee.framework.ui.plugin.widgets.IPropertyStoreBasedControl;
+import org.eclipse.osee.ote.ui.test.manager.panels.FileOrDirectorySelectionPanel;
+import org.eclipse.osee.ote.ui.test.manager.panels.LoggingPanel;
+import org.eclipse.osee.ote.ui.test.manager.panels.ScriptExecutionOptionsPanel;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ScriptExecutionContribution implements IPropertyStoreBasedControl {
+ private static final String GROUP_TITLE = "Script Execution Options";
+ private static final String LOGGING_GROUP = "Select a logging level";
+ private static final String EXECUTION_OPTIONS_GROUP = "Execution Options";
+ private static final String SCRIPT_OUTPUT_TOOLTIP =
+ "If the path in the text box is an existing directory all files will be written there.\n" + "If the path is empty the files will be written to the same location as the script.\n" + "In all other cases the path will be relative to the parent project of the file.\n";
+ private static final String SCRIPT_OUTPUT_LABEL = "Script Output Directory: ";
+
+ private FileOrDirectorySelectionPanel scriptDirectoryPanel;
+ private LoggingPanel loggingPanel;
+ private ScriptExecutionOptionsPanel optionsPanel;
+
+ public Control createControl(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setLayout(new GridLayout());
+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ group.setText(GROUP_TITLE);
+
+ this.scriptDirectoryPanel =
+ new FileOrDirectorySelectionPanel(group, SWT.NONE, SCRIPT_OUTPUT_LABEL, SCRIPT_OUTPUT_TOOLTIP, true);
+
+ Composite composite = new Composite(group, SWT.NONE);
+ GridLayout gl = new GridLayout(2, false);
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ composite.setLayout(gl);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ Group scriptOptionsGroup = new Group(composite, SWT.NONE);
+ scriptOptionsGroup.setLayout(new GridLayout());
+ scriptOptionsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ scriptOptionsGroup.setText(EXECUTION_OPTIONS_GROUP);
+
+ this.optionsPanel = new ScriptExecutionOptionsPanel(scriptOptionsGroup, SWT.NONE);
+
+ Group loggingGroup = new Group(composite, SWT.NONE);
+ loggingGroup.setLayout(new GridLayout());
+ loggingGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ loggingGroup.setText(LOGGING_GROUP);
+
+ this.loggingPanel = new LoggingPanel(loggingGroup, SWT.NONE);
+ return group;
+ }
+
+ public void load(IPropertyStore propertyStore) {
+ this.scriptDirectoryPanel.setSelected(propertyStore.get(TestManagerStorageKeys.SCRIPT_OUTPUT_DIRECTORY_KEY));
+
+ this.optionsPanel.setKeepOldCopiesEnabled(propertyStore.getBoolean(TestManagerStorageKeys.KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY));
+ this.optionsPanel.setBatchModeEnabled(propertyStore.getBoolean(TestManagerStorageKeys.BATCH_MODE_ENABLED_KEY));
+
+ this.loggingPanel.setSelected(propertyStore.get(TestManagerStorageKeys.LOGGING_LEVEL_KEY));
+ }
+
+ public void save(IPropertyStore propertyStore) {
+ propertyStore.put(TestManagerStorageKeys.SCRIPT_OUTPUT_DIRECTORY_KEY, this.scriptDirectoryPanel.getSelected());
+
+ propertyStore.put(TestManagerStorageKeys.LOGGING_LEVEL_KEY, this.loggingPanel.getSelected());
+
+ propertyStore.put(TestManagerStorageKeys.KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY,
+ this.optionsPanel.isKeepOldCopiesEnabled());
+ propertyStore.put(TestManagerStorageKeys.BATCH_MODE_ENABLED_KEY, this.optionsPanel.isBatchModeEnabled());
+ }
+
+ @Override
+ public boolean areSettingsValid() {
+ return scriptDirectoryPanel.isValid();
+ }
+
+ @Override
+ public String getErrorMessage() {
+ StringBuilder builder = new StringBuilder();
+ if (scriptDirectoryPanel.isValid() != true) {
+ builder.append("Script Output Directory: ");
+ builder.append(scriptDirectoryPanel.getErrorMessage());
+ }
+ return builder.toString();
+ }
+
+ public int getPriority() {
+ return 0;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/TestManagerStorageKeys.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/TestManagerStorageKeys.java
new file mode 100644
index 0000000000..814e1fd3cc
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/contributions/TestManagerStorageKeys.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.ui.test.manager.pages.contributions;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestManagerStorageKeys {
+
+ public static final String BATCH_MODE_ENABLED_KEY = "is.batch.mode.enabled";
+ public static final String KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY = "is.keep.old.outfile.copies.enabled";
+ public static final String LOGGING_LEVEL_KEY = "logging.level";
+ public static final String SCRIPT_OUTPUT_DIRECTORY_KEY = "script.output.directory";
+
+ private TestManagerStorageKeys() {
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ITaskListViewer.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ITaskListViewer.java
new file mode 100644
index 0000000000..af78a6c582
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ITaskListViewer.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable;
+
+public interface ITaskListViewer {
+
+ /**
+ * Update the view to reflect the fact that a task was added to the task list
+ *
+ * @param task
+ */
+ public void addTask(ScriptTask task);
+
+ /**
+ * Update the view to reflect the fact that multiple tasks were added to the task list
+ *
+ * @param tasks
+ */
+ public void addTasks(ScriptTask[] tasks);
+
+ /**
+ * Update the view to reflect the fact that a task was removed from the task list
+ *
+ * @param task
+ */
+ public void removeTask(ScriptTask task);
+
+ /**
+ * Update the view to reflect the fact that one of the tasks was modified
+ *
+ * @param task
+ */
+ public void updateTask(ScriptTask task);
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTableViewer.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTableViewer.java
new file mode 100644
index 0000000000..182ad8f2ad
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTableViewer.java
@@ -0,0 +1,505 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.markers.MarkerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ConfigFactory;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ILoadConfig;
+import org.eclipse.osee.ote.ui.test.manager.configuration.ISaveConfig;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.models.OutputModelJob;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.xscript.XScriptTable;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.xscript.XScriptTableContentProvider;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.xscript.XScriptTableLabelProvider;
+import org.eclipse.osee.ote.ui.test.manager.util.Dialogs;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+public class ScriptTableViewer {
+
+ private final ScriptTaskList taskList = new ScriptTaskList();
+ private TestManagerEditor testManagerEditor = null;
+ final int POPUP_NAVIGATOR = 2;
+ final int POPUP_OUTPUT = 0;
+ final int POPUP_SCRIPT = 1;
+ final int POPUP_RESULTS = 3;
+ private XScriptTable scriptTable;
+
+ /**
+ * @param parent
+ */
+ public ScriptTableViewer(Composite parent, TestManagerEditor editor) {
+ this.testManagerEditor = editor;
+ createWidget(parent);
+ }
+
+ public ScriptTableViewer(Composite parent, TestManagerEditor editor, List<ScriptTask> scriptList) {
+ this(parent, editor);
+ taskList.addTasks(scriptList);
+ }
+
+ public void addFile(String fullPath) {
+ processDroppedFiles(new String[] {fullPath});
+ }
+
+ /*
+ * Close the window and dispose of resources
+ */
+ public void close() {
+ // Shell shell = table.getShell();
+ // if (shell != null && !shell.isDisposed()) shell.dispose();
+ }
+
+ /**
+ * Release resources
+ */
+ public void dispose() {
+ scriptTable.dispose();
+ // Tell the label provider to release its resources
+ // tableViewer.getLabelProvider().dispose();
+ }
+
+ /**
+ * Return the column names in a collection
+ *
+ * @return List containing column names
+ */
+ // public List<String> getColumnNames() {
+ // return Arrays.asList(columnNames);
+ // }
+ /**
+ * Return the parent composite
+ */
+ // public Control getControl() {
+ // return table.getParent();
+ // }
+ /**
+ * Get all tasks marked for run.
+ *
+ * @return Vector of ScriptTask to run
+ */
+ public List<ScriptTask> getRunTasks() {
+ return scriptTable.getVisibleSortedScriptTasksToRun();
+ }
+
+ /**
+ * @return currently selected item
+ */
+ public ISelection getSelection() {
+ return scriptTable.getSelection();
+ }
+
+ /**
+ * Get string of scripts and run selections for storage
+ *
+ * @return <script>-ISRUN-, <script>, <script>-ISRUN
+ */
+ public String getStorageString() {
+ File file = OseeData.getFile("tm.xml");
+ String configFile = testManagerEditor.loadValue(testManagerEditor.configFileName);
+ ISaveConfig saveConfig =
+ ConfigFactory.getInstance().getSaveConfigHandler(testManagerEditor.getPageManager().getScriptPage());
+ try {
+ saveConfig.saveConfig(file);
+ } catch (Exception ex) {
+ Dialogs.popupError("Error Loading File", String.format("Error loading file: [%s]\n%s", configFile,
+ TestManagerPlugin.getStackMessages(ex)));
+ }
+
+ return "file:";
+ }
+
+ /**
+ * Return the ExampleTaskList
+ */
+ public ScriptTaskList getTaskList() {
+ return taskList;
+ }
+
+ public Vector<ScriptTask> getTasks() {
+ return taskList.getTasks();
+ }
+
+ /**
+ * @return Returns the testManagerEditor.
+ */
+ public TestManagerEditor getTestManagerEditor() {
+ return testManagerEditor;
+ }
+
+ /**
+ * Set taskList from input list of scripts and run selections
+ *
+ * @param str <script>-ISRUN-, <script>, <script>-ISRUN
+ */
+ public void loadStorageString(String str) {
+ OseeLog.log(TestManagerPlugin.class, Level.INFO, String.format("Storage String [%s]", str));
+ if (str != null) {
+ if (str.equals("file:")) {
+ File configFile = OseeData.getFile("tm.xml");
+ ILoadConfig loadConfig =
+ ConfigFactory.getInstance().getLoadConfigHandler(
+ this.testManagerEditor.getPageManager().getScriptPage());
+ try {
+ loadConfig.loadConfiguration(configFile);
+ } catch (Exception ex) {
+ Dialogs.popupError("Error Saving File", String.format("Error saving file: [%s]\n%s", configFile,
+ TestManagerPlugin.getStackMessages(ex)));
+ }
+ } else {
+ String scripts[] = str.split(",");
+ for (int i = 0; i < scripts.length; i++) {
+ String script = scripts[i];
+ if (!script.equals("")) {
+ boolean run = false;
+ if (script.endsWith("-ISRUN-")) {
+ run = true;
+ script = script.replaceFirst("-ISRUN-", "");
+ }
+ try {
+ ScriptTask task = new ScriptTask(script, testManagerEditor.getAlternateOutputDir());
+ task.setRun(run);
+ taskList.addTask(task);
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, String.format(
+ "Unable to add file [%s] to script view.", script), ex);
+ }
+ }
+ }
+ }
+ }
+ refresh();
+ }
+
+ public void loadTasksFromList(Vector<ScriptTask> tasks) {
+ taskList.removeAllTasks();
+ taskList.addTasks(tasks);
+ refresh();
+ }
+
+ public void onConnectionChanged(boolean connected) {
+ taskList.onConnected(connected);
+ refresh();
+ }
+
+ public void refresh() {
+ scriptTable.refresh();
+ }
+
+ public void refresh(ScriptTask task) {
+ scriptTable.refresh(task);
+ }
+
+ public void removeSelectedTasks() {
+ IStructuredSelection sel = (IStructuredSelection) scriptTable.getSelection();
+ Iterator<?> iter = sel.iterator();
+ while (iter.hasNext()) {
+ ScriptTask task = (ScriptTask) iter.next();
+ if (task != null) {
+ taskList.removeTask(task);
+ }
+ }
+ refresh();
+ }
+
+ /**
+ * Calls setRun() on all of the tasks in the table with runState.
+ *
+ * @param runState - the state to set all of the tasks's run value to
+ */
+ public void setAllTasksRun(boolean runState) {
+ Iterator<ScriptTask> iter = taskList.getTasks().iterator();
+ while (iter.hasNext()) {
+ ScriptTask task = iter.next();
+ task.setRun(runState);
+ taskList.taskChanged(task);
+ }
+ refresh();
+ }
+
+ /**
+ * Create a new shell, add the widgets, open the shell
+ */
+ private void createWidget(Composite parent) {
+ scriptTable = new XScriptTable(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ scriptTable.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ scriptTable.setContentProvider(new XScriptTableContentProvider());
+ scriptTable.setLabelProvider(new XScriptTableLabelProvider(scriptTable));
+ scriptTable.setInput(taskList);
+ attachDragDropListener();
+ attachKeyListeners();
+ scriptTable.getMenuManager().addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ getPopupMenu();
+ }
+ });
+ }
+
+ private void attachDragDropListener() {
+ final FileTransfer fileTransfer = FileTransfer.getInstance();
+ final Transfer types[] = new Transfer[] {fileTransfer};
+ // Add Drag/Drop to Table
+ DropTargetListener scriptDropTargetListener = new DropTargetAdapter() {
+ @Override
+ public void drop(DropTargetEvent event) {
+ if (fileTransfer.isSupportedType(event.currentDataType)) {
+ processDroppedFiles((String[]) event.data);
+ }
+ }
+ };
+ // Setup drag/drop of files
+ int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;
+ DropTarget scriptsTarget = new DropTarget(scriptTable.getTree(), operations);
+ scriptsTarget.setTransfer(types);
+ scriptsTarget.addDropListener(scriptDropTargetListener);
+ }
+
+ private void getPopupMenu() {
+
+ MenuManager menuManager = scriptTable.getMenuManager();
+
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Open Script") {
+ @Override
+ public void run() {
+ handlePopupMenu(POPUP_SCRIPT);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Open Output File") {
+ @Override
+ public void run() {
+ handlePopupMenu(POPUP_OUTPUT);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Refresh Output Results") {
+ @Override
+ public void run() {
+ handlePopupMenu(POPUP_RESULTS);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Open in Package Explorer") {
+ @Override
+ public void run() {
+ handlePopupMenu(POPUP_NAVIGATOR);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Set Selected to Run",
+ ImageManager.getImageDescriptor(PluginUiImage.CHECKBOX_ENABLED)) {
+ @Override
+ public void run() {
+ IStructuredSelection sel = (IStructuredSelection) getSelection();
+ Iterator<?> iter = sel.iterator();
+ while (iter.hasNext()) {
+ ScriptTask task = (ScriptTask) iter.next();
+ task.setRun(true);
+ taskList.taskChanged(task);
+ }
+ refresh();
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Set Selected to Not Run",
+ ImageManager.getImageDescriptor(PluginUiImage.CHECKBOX_DISABLED)) {
+ @Override
+ public void run() {
+ IStructuredSelection sel = (IStructuredSelection) getSelection();
+ Iterator<?> iter = sel.iterator();
+ while (iter.hasNext()) {
+ ScriptTask task = (ScriptTask) iter.next();
+ task.setRun(false);
+ taskList.taskChanged(task);
+ }
+ refresh();
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Select All to Run",
+ ImageManager.getImageDescriptor(PluginUiImage.CHECKBOX_ENABLED)) {
+ @Override
+ public void run() {
+ setAllTasksRun(true);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Action("Deselect All to Run",
+ ImageManager.getImageDescriptor(PluginUiImage.CHECKBOX_DISABLED)) {
+ @Override
+ public void run() {
+ setAllTasksRun(false);
+ }
+ });
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
+
+ // item = new MenuItem(previewMenu, SWT.CASCADE);
+ // item.setText("Load Test Output Markers");
+ // item.addSelectionListener(new SelectionAdapter() {
+ //
+ // public void widgetSelected(SelectionEvent e) {
+ // TableItem items[] = table.getSelection();
+ // ScriptTask task = null;
+ // if (items.length > 0) {
+ // task = (ScriptTask) items[0].getData();
+ // testManagerEditor.processOutFile(task);
+ // }
+ // AWorkbench.popupView(IPageLayout.ID_PROBLEM_VIEW);
+ // }
+ // });
+ // item = new MenuItem(previewMenu, SWT.CASCADE);
+ // item.setText("Remove Test Output Markers");
+ // item.addSelectionListener(new SelectionAdapter() {
+ //
+ // public void widgetSelected(SelectionEvent e) {
+ // TableItem items[] = table.getSelection();
+ // ScriptTask task = null;
+ // if (items.length > 0) {
+ // task = (ScriptTask) items[0].getData();
+ // MarkerSupport.deleteMarkersFromInputFile(task.getScriptModel().getIFile());
+ // }
+ // }
+ // });
+ //
+ // item = new MenuItem(previewMenu, SWT.CASCADE);
+ // item.setText("Remove All Test Output Markers");
+ // item.addSelectionListener(new SelectionAdapter() {
+ //
+ // public void widgetSelected(SelectionEvent e) {
+ // MarkerSupport.deleteAllMarkers();
+ // }
+ // });
+
+ // item = new MenuItem(previewMenu, SWT.SEPARATOR);
+
+ // return previewMenu;
+ }
+
+ private void handlePopupMenu(int type) {
+ TreeSelection selection = (TreeSelection) scriptTable.getSelection();
+ Object objs = selection.getFirstElement();
+ if (objs instanceof ScriptTask) {
+ ScriptTask task = (ScriptTask) objs;
+ if (type == POPUP_SCRIPT) {
+ task.getScriptModel().openEditor();
+ } else if (type == POPUP_OUTPUT) {
+ task.getScriptModel().getOutputModel().openEditor();
+ refresh();
+ } else if (type == POPUP_NAVIGATOR) {
+ task.getScriptModel().openPackageExplorer();
+ } else if (type == POPUP_RESULTS) {
+ Iterator<?> it = selection.iterator();
+ while (it.hasNext()) {
+ ScriptTask currentTask = (ScriptTask) it.next();
+ OutputModelJob.getSingleton().addTask(currentTask);
+ }
+ }
+ }
+ }
+
+ private void processDroppedFiles(String files[]) {
+ for (int i = 0; i < files.length; i++) {
+ String toProcess = files[i];
+
+ if (toProcess.endsWith(".xml")) {
+ batchDropHandler(new File(toProcess));
+ } else {
+ if (toProcess.endsWith(".java") || toProcess.endsWith(".vxe") || !new File(toProcess).getName().matches(
+ ".*\\..*")) {
+ ScriptTask newTask = new ScriptTask(files[i], testManagerEditor.getAlternateOutputDir());
+ if (!taskList.contains(newTask)) {
+ // newTask.computeExists();
+ if (newTask.getScriptModel().getOutputModel() != null) {
+ if (newTask.getScriptModel().getOutputModel().getIFile() != null) {
+ MarkerPlugin.getDefault().addMarkers(newTask.getScriptModel().getOutputModel().getIFile());
+ }
+ }
+ taskList.addTask(newTask);
+ }
+ } else {
+ Dialogs.popupError("Invalid Drop", "Only Java scripts and cppUnit executables can be dropped here.");
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, "not .java or cppExe file");
+ return;
+ }
+ }
+ }
+ refresh();
+ this.testManagerEditor.storeValue(testManagerEditor.scriptsQualName, getStorageString());
+ }
+
+ private void batchDropHandler(File batchFile) {
+ try {
+ ILoadConfig loadConfig =
+ ConfigFactory.getInstance().getLoadConfigHandler(testManagerEditor.getPageManager().getScriptPage());
+ loadConfig.loadConfiguration(batchFile);
+ } catch (Exception ex) {
+ Dialogs.popupError("Invalid Drop", String.format("Unable to read batch file\nFile [%s]\n%s",
+ (batchFile != null ? batchFile.getAbsolutePath() : "NULL"), TestManagerPlugin.getStackMessages(ex)));
+ }
+ }
+
+ /**
+ * @return StructuredViewer
+ */
+ public StructuredViewer getXViewer() {
+ return scriptTable;
+ }
+
+ private void attachKeyListeners() {
+ scriptTable.getTree().addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ // If they press enter, do the same as a double click
+ if (e.character == SWT.DEL) {
+ removeSelectedTasks();
+ refresh();
+ }
+ if (e.character == 'r') {
+ refresh();
+ }
+ }
+ });
+ }
+
+ /**
+ * @param files
+ */
+ public void addFiles(String[] files) {
+ processDroppedFiles(files);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTask.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTask.java
new file mode 100644
index 0000000000..d3b06dbcc8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTask.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.ui.test.manager.pages.scriptTable;
+
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.ote.ui.test.manager.models.OutputModelJob;
+import org.eclipse.osee.ote.ui.test.manager.models.ScriptModel;
+import org.eclipse.osee.ote.ui.test.manager.models.ScriptModel.ScriptInteractionEnum;
+
+public class ScriptTask {
+
+ public enum ScriptStatusEnum {
+ CANCELLED, CANCELLING, COMPLETE, IN_QUEUE, INCOMPATIBLE, INVALID, NOT_CONNECTED, READY, RUNNING
+ }
+
+ private GUID guid = null;
+ private boolean run = true;
+ private ScriptModel scriptModel = null;
+
+ private ScriptStatusEnum status = ScriptStatusEnum.INCOMPATIBLE;
+
+ /**
+ * @param rawFilename
+ * @param outputDir alternate output directory for tmo output files null will default to script directory
+ */
+ public ScriptTask(String rawFilename, String outputDir) {
+ scriptModel = new ScriptModel(rawFilename, outputDir);
+ updateStatusOnConnected(false);
+ OutputModelJob.getSingleton().addTask(this);
+ }
+
+ /**
+ * @return Returns the guid.
+ */
+ public GUID getGuid() {
+ return guid;
+ }
+
+ /**
+ * @return Returns the interaction.
+ */
+ public ScriptInteractionEnum getInteraction() {
+ return scriptModel.getInteraction();
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ if (scriptModel == null) {
+ return "";
+ } else {
+ return scriptModel.getName();
+ }
+ }
+
+ /**
+ * @return Returns the passFail.
+ */
+ public String getPassFail() {
+
+ int passTP = scriptModel.getOutputModel().getPassedTestPoints();
+ int failTP = scriptModel.getOutputModel().getFailedTestPoints();
+ if (scriptModel.getOutputModel().isAborted()) {
+ return "ABORTED";
+ } else if (passTP > 0 || failTP > 0) {
+ if (failTP == 0) {
+ return "PASS (" + passTP + ")";
+ } else {
+ return "FAIL (" + failTP + "/" + (passTP + failTP) + ")";
+ }
+ } else if (status == ScriptStatusEnum.RUNNING) {
+ return "(0/0)";
+ }
+ return "";
+ }
+
+ /**
+ * @return Returns the path.
+ */
+ public String getPath() {
+ return scriptModel.getPath();
+ }
+
+ /**
+ * @return Returns the scriptModel.
+ */
+ public ScriptModel getScriptModel() {
+ return scriptModel;
+ }
+
+ /**
+ * @return Returns the status.
+ */
+ public ScriptStatusEnum getStatus() {
+ return status;
+ }
+
+ public Boolean getRunStatus() {
+ return run;
+ }
+
+ /**
+ * @return Returns the outputExists.
+ */
+ public boolean isOutputExists() {
+ return scriptModel.getOutputModel().exists();
+
+ }
+
+// public void computeExists() {
+// exists = scriptModel.getOutputModel().exists();
+// }
+
+ // public boolean isOutputReadonly() {
+ // return !scriptModel.getOutputModel().getFile().canWrite();
+ // }
+
+ /**
+ * @return Returns the run.
+ */
+ public boolean isRun() {
+ return run;
+ }
+
+ public boolean isRunnable() {
+ return (isRun());// && status != ScriptStatusEnum.INCOMPATIBLE
+ // && status != ScriptStatusEnum.INVALID);
+ }
+
+ /**
+ * @param guid The guid to set.
+ */
+ public void setGuid(GUID guid) {
+ this.guid = guid;
+ }
+
+ /**
+ * @param run The run to set.
+ */
+ public void setRun(boolean run) {
+ this.run = run;
+ }
+
+ /**
+ * @param status The status to set.
+ */
+ public void setStatus(ScriptStatusEnum status) {
+ this.status = status;
+ }
+
+ public void updateStatusOnConnected(boolean connected) {
+ /* Always leave the status of INVALID alone */
+ if (status != ScriptStatusEnum.INVALID) {
+ /* If we're not connected, we'll leave the display blank */
+ if (!connected) {
+ status = ScriptStatusEnum.NOT_CONNECTED;
+ } else {
+ status = ScriptStatusEnum.READY;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTaskList.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTaskList.java
new file mode 100644
index 0000000000..f8ebd8607a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/ScriptTaskList.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.ui.test.manager.pages.scriptTable;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+public class ScriptTaskList {
+
+ private Set<ITaskListViewer> changeListeners = new HashSet<ITaskListViewer>();
+ private Vector<ScriptTask> tasks = new Vector<ScriptTask>();
+ private boolean isConnected = false;
+
+ /**
+ * Constructor
+ */
+ public ScriptTaskList() {
+ super();
+ }
+
+ /**
+ * @param viewer
+ */
+ public void addChangeListener(ITaskListViewer viewer) {
+ changeListeners.add(viewer);
+ }
+
+ /**
+ * Add a new task to the collection of tasks
+ */
+ public void addTask(ScriptTask inTask) {
+ inTask.updateStatusOnConnected(this.isConnected);
+ tasks.add(tasks.size(), inTask);
+ Iterator<ITaskListViewer> iterator = changeListeners.iterator();
+ while (iterator.hasNext())
+ (iterator.next()).addTask(inTask);
+ }
+
+ public void addTasks(List<ScriptTask> inTasks) {
+ for (ScriptTask task : inTasks) {
+ task.updateStatusOnConnected(isConnected);
+ }
+ ScriptTask[] array = new ScriptTask[inTasks.size()];
+ this.tasks.addAll(inTasks);
+ Iterator<ITaskListViewer> iterator = changeListeners.iterator();
+ while (iterator.hasNext())
+ (iterator.next()).addTasks(this.tasks.toArray(array));
+ }
+
+ /**
+ * Return the collection of ScriptTask
+ */
+ public Vector<ScriptTask> getTasks() {
+ return tasks;
+ }
+
+ public void onConnected(boolean connected) {
+ synchronized (tasks) {
+ this.isConnected = connected;
+ Iterator<ScriptTask> iter = tasks.iterator();
+ while (iter.hasNext()) {
+ ScriptTask task = iter.next();
+ // task.computeExists();
+ task.updateStatusOnConnected(connected);
+ }
+ }
+ }
+
+ public void removeAllTasks() {
+ this.tasks.removeAllElements();
+ }
+
+ /**
+ * @param viewer
+ */
+ public void removeChangeListener(ITaskListViewer viewer) {
+ changeListeners.remove(viewer);
+ }
+
+ /**
+ * @param task
+ */
+ public void removeTask(ScriptTask task) {
+ tasks.remove(task);
+ Iterator<ITaskListViewer> iterator = changeListeners.iterator();
+ while (iterator.hasNext())
+ (iterator.next()).removeTask(task);
+ }
+
+ /**
+ * @param task
+ */
+ public void taskChanged(ScriptTask task) {
+ Iterator<ITaskListViewer> iterator = changeListeners.iterator();
+ while (iterator.hasNext())
+ (iterator.next()).updateTask(task);
+ }
+
+ public String toString() {
+ String str = "";
+ for (int i = 0; i < tasks.size(); i++) {
+ ScriptTask task = (ScriptTask) tasks.get(i);
+ str += "\nTask " + task.getName() + " Status: " + task.getStatus();
+ }
+ return str + "\n\n";
+ }
+
+ /**
+ * @param newTask
+ */
+ public boolean contains(ScriptTask newTask) {
+ for (ScriptTask task : tasks) {
+ if (task.getPath().equals(newTask.getPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTable.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTable.java
new file mode 100644
index 0000000000..1b0e7f5ce7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTable.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable.xscript;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XScriptTable extends XViewer {
+
+ /**
+ * @param parent
+ * @param style
+ * @param namespace
+ * @param viewerFactory
+ */
+ public XScriptTable(Composite parent, int style) {
+ super(parent, style, new XScriptTableFactory(), false, false);
+ }
+
+ @Override
+ public void handleDoubleClick(TreeColumn col, TreeItem item) {
+ XViewerColumn xcol = (XViewerColumn) col.getData();
+ ScriptTask task = (ScriptTask) item.getData();
+ if (XScriptTableFactory.RESULT.equals(xcol) || XScriptTableFactory.OUPUT_FILE.equals(xcol)) {
+ task.getScriptModel().getOutputModel().openEditor();
+ } else if (XScriptTableFactory.TEST_LOCATION.equals(xcol)) {
+ task.getScriptModel().openPackageExplorer();
+ } else if (XScriptTableFactory.TEST.equals(xcol)) {// != k) {
+ task.getScriptModel().openEditor();
+ }
+ }
+
+ @Override
+ public boolean handleLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ XViewerColumn aCol = (XViewerColumn) treeColumn.getData();
+ if (XScriptTableFactory.RUN.equals(aCol)) {
+ ScriptTask task = (ScriptTask) treeItem.getData();
+ task.setRun(!task.isRun());
+ refresh(task);
+ }
+ return super.handleLeftClick(treeColumn, treeItem);
+ }
+
+ @Override
+ public boolean handleLeftClickInIconArea(TreeColumn treeColumn, TreeItem treeItem) {
+ XViewerColumn aCol = (XViewerColumn) treeColumn.getData();
+ if (XScriptTableFactory.RUN.equals(aCol)) {
+ ScriptTask task = (ScriptTask) treeItem.getData();
+ task.setRun(!task.isRun());
+ refresh(task);
+ }
+ return super.handleLeftClickInIconArea(treeColumn, treeItem);
+ }
+
+ public List<ScriptTask> getVisibleSortedScriptTasksToRun() {
+ Object[] objs = getSortedChildren(getInput());
+ List<ScriptTask> runs = new ArrayList<ScriptTask>();
+ for (Object obj : objs) {
+ if (((ScriptTask) obj).isRun()) {
+ runs.add((ScriptTask) obj);
+ }
+ }
+ return runs;
+ }
+
+ public List<ScriptTask> getVisibibleSortedScriptTasks() {
+ Object[] objs = getSortedChildren(getInput());
+ List<ScriptTask> runs = new ArrayList<ScriptTask>();
+ for (Object obj : objs) {
+ runs.add((ScriptTask) obj);
+ }
+ return runs;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableContentProvider.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableContentProvider.java
new file mode 100644
index 0000000000..d6bce13dd2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableContentProvider.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable.xscript;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ITaskListViewer;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTaskList;
+
+/**
+ * @author Ken J. Aguilar
+ */
+public class XScriptTableContentProvider implements IStructuredContentProvider, ITaskListViewer, ITreeContentProvider {
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public void addTask(ScriptTask task) {
+ }
+
+ @Override
+ public void addTasks(ScriptTask[] tasks) {
+ }
+
+ @Override
+ public void removeTask(ScriptTask task) {
+ }
+
+ @Override
+ public void updateTask(ScriptTask task) {
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof ScriptTaskList){
+ return ((ScriptTaskList)parentElement).getTasks().toArray();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ Object[] children = getChildren(element);
+ if(children != null && children.length > 0) return true;
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableFactory.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableFactory.java
new file mode 100644
index 0000000000..5e00e05cb7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableFactory.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable.xscript;
+
+import java.io.File;
+import java.util.logging.Level;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
+import org.eclipse.nebula.widgets.xviewer.XViewerFactory;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.nebula.widgets.xviewer.customize.FileStoreCustomizations;
+import org.eclipse.nebula.widgets.xviewer.customize.IXViewerCustomizations;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XScriptTableFactory extends XViewerFactory {
+ private static String COLUMN_NAMESPACE = "xviewer.script.table";
+ public static XViewerColumn RUN =
+ new XViewerColumn(COLUMN_NAMESPACE + ".run", "Run", 42, SWT.LEFT, true, SortDataType.Boolean, false, null);
+ public static XViewerColumn TEST =
+ new XViewerColumn(COLUMN_NAMESPACE + ".test", "Test", 275, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn STATUS =
+ new XViewerColumn(COLUMN_NAMESPACE + ".status", "Status", 125, SWT.LEFT, true, SortDataType.String, false,
+ null);
+ public static XViewerColumn RESULT =
+ new XViewerColumn(COLUMN_NAMESPACE + ".result", "Result", 125, SWT.LEFT, true, SortDataType.String, false,
+ null);
+ public static XViewerColumn OUPUT_FILE =
+ new XViewerColumn(COLUMN_NAMESPACE + ".outfile", "Output File", 70, SWT.LEFT, true, SortDataType.String,
+ false, null);
+ public static XViewerColumn TEST_LOCATION =
+ new XViewerColumn(COLUMN_NAMESPACE + ".testlocation", "Test Location", 160, SWT.LEFT, true,
+ SortDataType.String, false, null);
+
+ private final FileStoreCustomizations propertyStoreCustomizations;
+
+ private static final String defaultCustomDataXml =
+ "<XTreeProperties name=\"default\" namespace=\"xviewer.script.table\" guid=\"710h7sah9dtt01464nvkkv\"><xSorter><id>xviewer.script.table.test</id></xSorter><xSorter><id>xviewer.script.table.test</id></xSorter><xFilter></xFilter><xCol><id>xviewer.script.table.run</id><name>Run</name><wdth>42</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>xviewer.script.table.test</id><name>Test</name><wdth>351</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>xviewer.script.table.result</id><name>Result</name><wdth>110</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>xviewer.script.table.status</id><name>Status</name><wdth>125</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>xviewer.script.table.outfile</id><name>Output File</name><wdth>75</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>xviewer.script.table.testlocation</id><name>Test Location</name><wdth>160</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol></XTreeProperties>";
+
+ public XScriptTableFactory() {
+ super(COLUMN_NAMESPACE);
+ File folder;
+ try {
+ folder = OseeData.getFolder("OteScriptTable").getLocation().toFile();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(XScriptTableFactory.class, Level.SEVERE, ex);
+ folder = new File(System.getProperty("java.io.tmpdir"));
+ }
+ propertyStoreCustomizations =
+ new FileStoreCustomizations(folder, "OteScript", ".xml", "DefaultOteScript.xml", defaultCustomDataXml);
+ registerColumns(RUN, TEST, RESULT, STATUS, OUPUT_FILE, TEST_LOCATION);
+ }
+
+ @Override
+ public IXViewerCustomizations getXViewerCustomizations() {
+ return propertyStoreCustomizations;
+ }
+
+ @Override
+ public boolean isAdmin() {
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableLabelProvider.java
new file mode 100644
index 0000000000..76b83c118e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/pages/scriptTable/xscript/XScriptTableLabelProvider.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * 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.ui.test.manager.pages.scriptTable.xscript;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
+import org.eclipse.nebula.widgets.xviewer.XViewerLabelProvider;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask;
+import org.eclipse.osee.ote.ui.test.manager.pages.scriptTable.ScriptTask.ScriptStatusEnum;
+import org.eclipse.swt.graphics.Image;
+
+public class XScriptTableLabelProvider extends XViewerLabelProvider {
+ public static final OseeUiActivator plugin = TestManagerPlugin.getInstance();
+ private static Image checkedImage = ImageManager.getImage(OteTestManagerImage.CHECKBOX_ENABLED);
+ private static Image outputImage = ImageManager.getImage(OteTestManagerImage.CHECK);
+ private static Map<ScriptStatusEnum, Image> statusImage = new HashMap<ScriptStatusEnum, Image>();
+ private static Image uncheckedImage = ImageManager.getImage(OteTestManagerImage.CHECKBOX_DISABLED);
+
+ public XScriptTableLabelProvider(XScriptTable viewer) {
+ super(viewer);
+ if (statusImage.size() == 0) {
+ statusImage.put(ScriptStatusEnum.NOT_CONNECTED, ImageManager.getImage(OteTestManagerImage.ALERT_OBJ));
+ statusImage.put(ScriptStatusEnum.READY, ImageManager.getImage(OteTestManagerImage.SCRIPT_READY_SM));
+ statusImage.put(ScriptStatusEnum.IN_QUEUE, ImageManager.getImage(OteTestManagerImage.SCRIPT_IN_QUEUE_SM));
+ statusImage.put(ScriptStatusEnum.RUNNING, ImageManager.getImage(OteTestManagerImage.SCRIPT_RUNNING));
+ statusImage.put(ScriptStatusEnum.COMPLETE, ImageManager.getImage(OteTestManagerImage.SCRIPT_COMPLETE_SM));
+ statusImage.put(ScriptStatusEnum.CANCELLED, ImageManager.getImage(OteTestManagerImage.SCRIPT_CANCELLED_SM));
+ statusImage.put(ScriptStatusEnum.CANCELLING, ImageManager.getImage(OteTestManagerImage.SCRIPT_CANCELLING_SM));
+ statusImage.put(ScriptStatusEnum.INVALID, ImageManager.getImage(OteTestManagerImage.ERROR_STACK));
+ statusImage.put(ScriptStatusEnum.INCOMPATIBLE, ImageManager.getImage(OteTestManagerImage.ERROR_STACK));
+ }
+ };
+
+ private Image getOutputImage(ScriptTask task) {
+ if (task.isOutputExists()) {
+ return outputImage;
+ }
+ return null;
+ }
+
+ private Image getPassFailImage(ScriptTask task) {
+ Matcher m = Pattern.compile("(FAIL|ABORTED)").matcher(task.getPassFail());
+ if (m.find()) {
+ return statusImage.get(ScriptStatusEnum.INVALID);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the image with the given key, or <code>null</code> if not found.
+ */
+ private Image getRunImage(boolean isSelected) {
+ return isSelected ? checkedImage : uncheckedImage;
+ }
+
+ private Image getStatusImage(ScriptStatusEnum status) {
+ return statusImage.get(status);
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) throws Exception {
+ if (XScriptTableFactory.OUPUT_FILE.equals(col)) {
+ return getOutputImage(((ScriptTask) element));
+ } else if (XScriptTableFactory.RUN.equals(col)) {
+ return getRunImage(((ScriptTask) element).isRun());
+ } else if (XScriptTableFactory.STATUS.equals(col)) {
+ return getStatusImage(((ScriptTask) element).getStatus());
+ } else if (XScriptTableFactory.RESULT.equals(col)) {
+ return getPassFailImage(((ScriptTask) element));
+ }
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws Exception {
+ ScriptTask task = (ScriptTask) element;
+ if (XScriptTableFactory.STATUS.equals(col)) {
+ return task.getStatus().toString();
+ } else if (XScriptTableFactory.RESULT.equals(col)) {
+ return task.getPassFail();
+ } else if (XScriptTableFactory.TEST.equals(col)) {
+ return task.getName();
+ } else if (XScriptTableFactory.TEST_LOCATION.equals(col)) {
+ return task.getPath();
+ } else if (XScriptTableFactory.RUN.equals(col)) {
+ return task.getRunStatus().toString();
+ }
+
+ return "";
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java
new file mode 100644
index 0000000000..0b9f8b664e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/FileOrDirectorySelectionPanel.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * 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.ui.test.manager.panels;
+
+import java.io.File;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.util.Dialogs;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class FileOrDirectorySelectionPanel extends Composite {
+
+ private static final Image FILE_SELECT_IMAGE = ImageManager.getImage(OteTestManagerImage.FILE);
+ private static final String DIRECTORY_ERROR_MESSAGE = "Directory should be blank or set an accessible directory.";
+ private static final String FILE_ERROR_MESSAGE = "Unable to access file.";
+ private static final String DEFAULT_FILE = "/dev/null";
+
+ private StyledText textField;
+ private Label labelField;
+ private final String labelText;
+ private final String toolTipText;
+ private final boolean isDirectory;
+
+ public FileOrDirectorySelectionPanel(Composite parent, int style, String labelText, String toolTipText, boolean isDirectory) {
+ super(parent, style);
+ this.labelText = labelText;
+ this.toolTipText = toolTipText;
+ this.isDirectory = isDirectory;
+ GridLayout gl = new GridLayout(3, false);
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ this.setLayout(gl);
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ createControl(this);
+ }
+
+ private void createControl(Composite parent) {
+ labelField = new Label(parent, SWT.NONE);
+ labelField.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, false, false));
+ labelField.setText(labelText);
+ labelField.setToolTipText(toolTipText);
+
+ textField = new StyledText(parent, SWT.BORDER);
+ textField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ if (isDirectory != true) {
+ textField.setText(DEFAULT_FILE);
+ }
+ Button fileDialog = new Button(parent, SWT.NONE);
+ fileDialog.setLayoutData(new GridData(SWT.FILL, SWT.END, false, false));
+ fileDialog.setImage(FILE_SELECT_IMAGE);
+ fileDialog.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ createDialog();
+ }
+ });
+
+ }
+
+ private void createDialog() {
+ Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ String selection = "";
+ if (isDirectory == true) {
+ DirectoryDialog directoryDialog = new DirectoryDialog(shell, SWT.OPEN);
+
+ String defaultDir = textField.getText();
+ File dir = new File(defaultDir);
+ if (dir.isFile() || dir.isDirectory()) {
+ directoryDialog.setFilterPath(defaultDir);
+ } else {
+ directoryDialog.setFilterPath("Y:\\");
+ }
+ selection = directoryDialog.open();
+ } else {
+ FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
+ selection = fileDialog.open();
+ }
+ setSelected(selection);
+ }
+
+ private void verifySelection() {
+ String text = getSelected();
+ if (isValid() != true) {
+ if (isDirectory == true) {
+ text = "";
+ } else {
+ text = DEFAULT_FILE;
+ }
+ Dialogs.popupError("Error", getErrorMessage());
+ }
+ if (textField.getText().equals(text) != true) {
+ textField.setText(text);
+ }
+ }
+
+ private boolean isValidFile(String text) {
+ File file = new File(text);
+ return file != null && file.exists() != false && file.canWrite() != false;
+ }
+
+ public boolean isValid() {
+ boolean toReturn = false;
+ String text = getSelected();
+ if (isDirectory == true) {
+ toReturn = Strings.isValid(text) == true ? isValidFile(text) : true;
+ } else {
+ // if (Strings.isValid(text) == true) {
+ // if (text.equals(DEFAULT_FILE) == true) {
+ toReturn = true;
+ // } else {
+ // toReturn = isValidFile(text);
+ // }
+ // }
+ }
+ return toReturn;
+ }
+
+ public String getErrorMessage() {
+ return isDirectory == true ? DIRECTORY_ERROR_MESSAGE : FILE_ERROR_MESSAGE;
+ }
+
+ public String getSelected() {
+ return textField != null && textField.isDisposed() != true ? textField.getText() : "";
+ }
+
+ public void setSelected(String value) {
+ if (textField != null && textField.isDisposed() != true) {
+ if (Strings.isValid(value)) {
+ textField.setText(value);
+ }
+ verifySelection();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/LoggingPanel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/LoggingPanel.java
new file mode 100644
index 0000000000..3a9641b72f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/LoggingPanel.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.ui.test.manager.panels;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class LoggingPanel extends Composite {
+
+ private enum LoggingLevel {
+ Minimal(Level.WARNING),
+ Detailed(Level.INFO),
+ All(Level.ALL);
+
+ private Level level;
+
+ LoggingLevel(Level level) {
+ this.level = level;
+ }
+
+ public Level getLevel() {
+ return level;
+ }
+
+ public static LoggingLevel fromLevel(Level value) {
+ LoggingLevel toReturn = LoggingLevel.Detailed;
+ if (value != null) {
+ for (LoggingLevel formatType : LoggingLevel.values()) {
+ if (formatType.getLevel().equals(value)) {
+ toReturn = formatType;
+ break;
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ }
+
+ private Map<LoggingLevel, Button> buttonMap;
+ private LoggingLevel lastSelected;
+
+ public LoggingPanel(Composite parent, int style) {
+ super(parent, style);
+ GridLayout gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ this.setLayout(gl);
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ createControl(this);
+ }
+
+ private void createControl(Composite parent) {
+ LoggingLevel[] levels = LoggingLevel.values();
+ this.buttonMap = new HashMap<LoggingLevel, Button>();
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ composite.setLayout(gl);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ for (int index = 0; index < levels.length; index++) {
+ LoggingLevel level = levels[index];
+
+ Button button = new Button(composite, SWT.RADIO);
+ button.setData(level);
+ button.setText(level.name());
+ button.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Object object = e.getSource();
+ if (object instanceof Button) {
+ setSelected((Button) object);
+ }
+ }
+
+ });
+ boolean isDefault = index == 1;
+ button.setSelection(isDefault);
+ if (isDefault != false) {
+ lastSelected = level;
+ }
+ buttonMap.put(level, button);
+ }
+ }
+
+ private void setSelected(Button button) {
+ if (button.getSelection() != false) {
+ lastSelected = (LoggingLevel) button.getData();
+ }
+ }
+
+ public String getSelected() {
+ return lastSelected.getLevel().toString();
+ }
+
+ public void setSelected(String value) {
+ Level level = LoggingLevel.Detailed.getLevel();
+ try {
+ level = Level.parse(value);
+ } catch (Exception ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.WARNING, String.format(
+ "Error parsing log level [%s] using default [%s]", value, level));
+ }
+
+ LoggingLevel loggingLevel = LoggingLevel.fromLevel(level);
+ this.lastSelected = loggingLevel;
+ for (LoggingLevel keys : buttonMap.keySet()) {
+ Button button = buttonMap.get(keys);
+ button.setSelection(keys.equals(loggingLevel));
+ }
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/ScriptExecutionOptionsPanel.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/ScriptExecutionOptionsPanel.java
new file mode 100644
index 0000000000..738d1d2744
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/panels/ScriptExecutionOptionsPanel.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.ui.test.manager.panels;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ScriptExecutionOptionsPanel extends Composite {
+ private Button saveOutputCheck;
+ private Button batchModeCheck;
+
+ public ScriptExecutionOptionsPanel(Composite parent, int style) {
+ super(parent, style);
+ GridLayout gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ this.setLayout(gl);
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ createControl(this);
+ }
+
+ private void createControl(Composite parent) {
+ saveOutputCheck = new Button(parent, SWT.CHECK);
+ saveOutputCheck.setText("Keep copies of old Output Files");
+ saveOutputCheck.setToolTipText("Select to save existing output filename\n" + "to file \"<output>.[num].tmo\" for each succssive run.\n" + "De-select overwrites output file.\n\n" + " eg. myScript.tmo = current output\n" + " myScript.1.tmo = oldest output file\n" + " myScript.2.tmo = output before current");
+
+ batchModeCheck = new Button(parent, SWT.CHECK);
+ batchModeCheck.setText("Run in batch mode");
+ batchModeCheck.setToolTipText("If any prompts exist, they are skipped if this option is selected.");
+ }
+
+ public boolean isKeepOldCopiesEnabled() {
+ return saveOutputCheck.getSelection();
+ }
+
+ public boolean isBatchModeEnabled() {
+ return batchModeCheck.getSelection();
+ }
+
+ public void setKeepOldCopiesEnabled(boolean isEnabled) {
+ saveOutputCheck.setSelection(isEnabled);
+ }
+
+ public void setBatchModeEnabled(boolean isEnabled) {
+ batchModeCheck.setSelection(isEnabled);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/TestManagerPreferencePage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/TestManagerPreferencePage.java
new file mode 100644
index 0000000000..c4e207f455
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/TestManagerPreferencePage.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.ui.test.manager.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.osee.ote.ui.test.manager.preferences.environment.EnvironmentPreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestManagerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ public static final String TEST_MANAGER_KEY = "org.eclipse.osee.ote.ui.test.manager.PreferencePage";
+ private EnvironmentPreferencePage environmentPreferencePage;
+
+ public void init(IWorkbench workbench) {
+ // Initialize the preference store we wish to use
+ setPreferenceStore(TestManagerPlugin.getInstance().getPreferenceStore());
+ }
+
+ public boolean performOk() {
+ environmentPreferencePage.storeVariables();
+
+ return super.performOk();
+ }
+
+ private Control createBlankArea(Composite parent, int height, boolean allVertical) {
+ Composite blank = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ GridData gd = new GridData();
+ gd.minimumHeight = height;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = allVertical;
+ blank.setLayout(gridLayout);
+ blank.setLayoutData(gd);
+ return parent;
+ }
+
+ private Control createDefaultEvironmentVariablesArea(Composite parent) {
+
+ SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+
+ GridData d = new GridData(GridData.FILL_BOTH);
+ d.grabExcessHorizontalSpace = true;
+ d.grabExcessVerticalSpace = true;
+ sashForm.setLayout(gridLayout);
+ sashForm.setLayoutData(d);
+
+ environmentPreferencePage = new EnvironmentPreferencePage(sashForm);
+
+ return parent;
+ }
+
+ private void createPageDescription(Composite parent) {
+ (new Label(parent, SWT.NONE)).setText("Test Manager Settings:");
+ }
+
+ protected Control createContents(Composite parent) {
+
+ createPageDescription(parent);
+ createBlankArea(parent, 0, false);
+ createDefaultEvironmentVariablesArea(parent);
+ // createBlankArea(parent, 300, true);
+
+ return parent;
+ }
+
+ protected void performApply() {
+ performOk();
+ }
+
+ protected void performDefaults() {
+
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageDataViewer.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageDataViewer.java
new file mode 100644
index 0000000000..c03d0777bb
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageDataViewer.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.ui.test.manager.preferences.environment;
+
+import java.util.ArrayList;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvironmentPageDataViewer {
+
+ private Group environmentVariable;
+ private EnvironmentPreferenceNode nodeToDisplay;
+ private ArrayList<StyleRange> styleArray;
+ private StyledText textArea;
+
+ public EnvironmentPageDataViewer(Composite parent) {
+ createArea(parent);
+ styleArray = new ArrayList<StyleRange>();
+ }
+
+ public void clearTextArea() {
+ textArea.setText("");
+ styleArray.clear();
+ textArea.redraw();
+ }
+
+ public void setNodeToDisplay(EnvironmentPreferenceNode nodeToDisplay) {
+ this.nodeToDisplay = nodeToDisplay;
+ update();
+ }
+
+ public void setTitleName(String name) {
+ environmentVariable.setText("Preview Environment Variable: " + name);
+ environmentVariable.redraw();
+ }
+
+ public void update() {
+ clearTextArea();
+ if (nodeToDisplay != null) {
+ setTitleName(nodeToDisplay.getEnvName());
+ addEntry(nodeToDisplay.getEnvName(), nodeToDisplay.getValue());
+ }
+ else {
+ setTitleName("NONE SELECTED");
+ }
+ }
+
+ private void addEntry(String name, String value) {
+ addEntryName(name);
+ addEntryValue(value);
+ }
+
+ private void addEntryName(String name) {
+ if (name != null) {
+ String temp = textArea.getText();
+ temp += "\n\t";
+ int startIndex = temp.length();
+ temp += name;
+ textArea.setText(temp);
+ StyleRange tempStyle = new StyleRange();
+ styleArray.add(tempStyle);
+ tempStyle.fontStyle = SWT.BOLD;
+ tempStyle.start = startIndex;
+ tempStyle.length = name.length();
+ tempStyle.underline = true;
+ tempStyle.foreground = Display.getDefault().getSystemColor(SWT.COLOR_DARK_BLUE);
+ textArea.setStyleRanges(styleArray.toArray(new StyleRange[styleArray.size()]));
+ textArea.redraw();
+ }
+ }
+
+ private void addEntryValue(String value) {
+ if (value != null) {
+ String temp = textArea.getText();
+ temp += " = ";
+ int startIndex = temp.length();
+ String toAdd = value.replaceAll(":", ":\n\t\t");
+ temp += toAdd;
+ textArea.setText(temp + "\n");
+ StyleRange tempStyle = new StyleRange();
+ styleArray.add(tempStyle);
+ tempStyle.fontStyle = SWT.ITALIC;
+ tempStyle.start = startIndex;
+ tempStyle.length = toAdd.length();
+ tempStyle.foreground = Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
+ textArea.setStyleRanges(styleArray.toArray(new StyleRange[styleArray.size()]));
+ textArea.redraw();
+ }
+ }
+
+ private Control createArea(Composite parent) {
+ GridData d = new GridData(GridData.FILL_BOTH);
+
+ environmentVariable = new Group(parent, SWT.NONE);
+ environmentVariable.setText("Preview Environment Variable:");
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ environmentVariable.setLayout(gridLayout);
+ environmentVariable.setLayoutData(d);
+
+ Composite topLevelComposite = new Composite(environmentVariable, SWT.NONE);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ topLevelComposite.setLayout(gridLayout);
+ topLevelComposite.setLayoutData(d);
+ topLevelComposite.setToolTipText("Select a Value From the Tree to Display");
+
+ textArea = new StyledText(topLevelComposite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ textArea.setEditable(false);
+ GridLayout gL = new GridLayout();
+ gL.numColumns = 1;
+ textArea.setLayout(gL);
+ textArea.setLayoutData(d);
+ textArea.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ textArea.setToolTipText("Select a Value From the Tree to Display");
+
+ return parent;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageEventHandler.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageEventHandler.java
new file mode 100644
index 0000000000..0f1b791ce5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPageEventHandler.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.ui.test.manager.preferences.environment;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.jdk.core.type.TreeObject;
+import org.eclipse.osee.framework.jdk.core.type.TreeParent;
+import org.eclipse.osee.ote.ui.test.manager.util.EnvVariableDetailsDialogHelper;
+import org.eclipse.osee.ote.ui.test.manager.util.EnvVariableDialogHelper;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvironmentPageEventHandler {
+
+ private EnvironmentPreferenceNode currentSelection;
+ private EnvironmentPageDataViewer environmentPageDataViewer;
+ private ArrayList<EnvironmentPreferenceNode> treeInputList;
+ private CheckboxTreeViewer treeViewer;
+
+ public EnvironmentPageEventHandler(Composite parent, CheckboxTreeViewer treeViewer,
+ ArrayList<EnvironmentPreferenceNode> treeInputList) {
+ this.treeViewer = treeViewer;
+ this.treeInputList = treeInputList;
+ this.environmentPageDataViewer = new EnvironmentPageDataViewer(parent);
+ }
+
+ public void editEnvVariable(EnvironmentPreferenceNode node) {
+ EnvVariableDetailsDialogHelper selection = new EnvVariableDetailsDialogHelper(node.getEnvName(), node.getValue());
+ Display.getDefault().syncExec(selection);
+ if (selection.getResult() != Window.CANCEL) {
+ node.setValue(selection.getSelection());
+ environmentPageDataViewer.update();
+ }
+ }
+
+ public void handleAddEnvironmentVariableEvent() {
+ EnvVariableDialogHelper selection = new EnvVariableDialogHelper();
+ Display.getDefault().syncExec(selection);
+ if (selection.getResult() != Window.CANCEL) {
+ this.addEnvironmentVariable(selection.getSelection());
+ treeViewer.refresh();
+ }
+ }
+
+ public void handleCheckStateChangeEvent(CheckStateChangedEvent event) {
+ Object obj = event.getElement();
+ if (obj != null) {
+ EnvironmentPreferenceNode tempSelection = null;
+
+ if (obj instanceof EnvironmentPreferenceNode) {
+ tempSelection = (EnvironmentPreferenceNode) obj;
+ tempSelection.setChecked(event.getChecked());
+ currentSelection = tempSelection;
+ environmentPageDataViewer.setNodeToDisplay(currentSelection);
+ }
+ }
+ }
+
+ public void handleEditVariableEvent() {
+ ISelection sel = this.treeViewer.getSelection();
+ if (!sel.isEmpty()) {
+ TreeObject selectedItem = (TreeObject) ((StructuredSelection) sel).getFirstElement();
+ if (selectedItem instanceof EnvironmentPreferenceNode) {
+ editEnvVariable((EnvironmentPreferenceNode) selectedItem);
+ }
+ }
+ }
+
+ public void handleRemoveSelectedViewEvent() {
+ StructuredSelection sel = (StructuredSelection) treeViewer.getSelection();
+ if (!sel.isEmpty()) {
+ Iterator<?> it = sel.iterator();
+ while (it.hasNext()) {
+ TreeObject leaf = (TreeObject) it.next();
+ if (leaf instanceof TreeParent) {
+ treeInputList.remove(leaf);
+ environmentPageDataViewer.setNodeToDisplay(null);
+ }
+ else {
+ leaf.getParent().removeChild(leaf);
+ environmentPageDataViewer.update();
+ }
+ }
+ treeViewer.refresh();
+ }
+ }
+
+ public void handleTreeSelectionEvent(SelectionChangedEvent event) {
+ ISelection sel = event.getSelection();
+ if (!sel.isEmpty()) {
+ TreeObject selectedItem = (TreeObject) ((StructuredSelection) sel).getFirstElement();
+
+ EnvironmentPreferenceNode tempSelection = null;
+
+ if (selectedItem instanceof EnvironmentPreferenceNode) {
+ tempSelection = (EnvironmentPreferenceNode) selectedItem;
+ currentSelection = tempSelection;
+ environmentPageDataViewer.setNodeToDisplay(currentSelection);
+ }
+ treeViewer.refresh();
+ }
+ }
+
+ private void addEnvironmentVariable(String name) {
+ EnvironmentPreferenceNode node = new EnvironmentPreferenceNode(name);
+ treeInputList.add(node);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferenceNode.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferenceNode.java
new file mode 100644
index 0000000000..d2f814cfcd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferenceNode.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.ui.test.manager.preferences.environment;
+
+import org.eclipse.osee.framework.jdk.core.type.TreeParent;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvironmentPreferenceNode extends TreeParent {
+
+ public boolean checked;
+ public String value;
+
+ public EnvironmentPreferenceNode(String name) {
+ super(name);
+ checked = false;
+ value = "";
+ }
+
+ public String getEnvName() {
+ return getName();
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean selected) {
+ this.checked = selected;
+ }
+
+ public void setEnvName(String name) {
+ setName(name);
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferencePage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferencePage.java
new file mode 100644
index 0000000000..9c439418c8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/preferences/environment/EnvironmentPreferencePage.java
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * 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.ui.test.manager.preferences.environment;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.jdk.core.type.TreeObject;
+import org.eclipse.osee.framework.jdk.core.type.TreeParent;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.ote.ui.test.manager.OteTestManagerImage;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvironmentPreferencePage {
+ public static final String CHECKED = "selected";
+ public static final String NAME = "name";
+ public static final String NUMBER_OF_VALUES = "numberOfValues";
+ public static final String PAGE_KEY = "org.eclipse.osee.ote.ui.test.manager.EnvironmentPreferencePage";
+ public static final String VALUE = "value";
+
+ public static Map<String, String> getSelectedItems() {
+ Map<String, String> environmentVariables = new HashMap<String, String>();
+
+ ArrayList<EnvironmentPreferenceNode> envList = loadVariables();
+
+ for (EnvironmentPreferenceNode node : envList) {
+ if (node.isChecked()) {
+ String name = node.getEnvName();
+ String value = node.getValue();
+ if (name != null && !name.equals("")) {
+ environmentVariables.put(name, value != null ? value : "");
+ }
+ }
+ }
+ return environmentVariables;
+ }
+
+ private static ArrayList<EnvironmentPreferenceNode> loadVariables() {
+ ArrayList<EnvironmentPreferenceNode> list = new ArrayList<EnvironmentPreferenceNode>();
+ IPreferenceStore prefStore = TestManagerPlugin.getInstance().getPreferenceStore();
+
+ int numberOfValues = prefStore.getInt(PAGE_KEY + "." + NUMBER_OF_VALUES);
+ for (int index = 0; index < numberOfValues; index++) {
+ String name = prefStore.getString(PAGE_KEY + "." + NAME + "_" + index);
+ String value = prefStore.getString(PAGE_KEY + "." + VALUE + "_" + index);
+ String selectedString = prefStore.getString(PAGE_KEY + "." + CHECKED + "_" + index);
+ boolean selected = Boolean.parseBoolean(selectedString);
+
+ if (name != null && name != "") {
+ EnvironmentPreferenceNode node = new EnvironmentPreferenceNode(name);
+ node.setValue((value != null ? value : ""));
+ node.setChecked(selected);
+ list.add(node);
+ }
+ }
+ return list;
+ }
+
+ private Button addButton;
+
+ private Composite buttonComposite;
+ private EnvironmentPageEventHandler environmentPageEventHandler;
+ private Button removeButton;
+
+ private final ArrayList<EnvironmentPreferenceNode> treeInputList;
+
+ private CheckboxTreeViewer treeViewer;
+
+ public EnvironmentPreferencePage(Composite parent) {
+ this.treeInputList = loadVariables();
+ this.createTreeArea(parent);
+ }
+
+ public ISelection getSelection() {
+ return treeViewer.getSelection();
+ }
+
+ public void refresh() {
+ treeViewer.refresh();
+ }
+
+ public void storeVariables() {
+ IPreferenceStore prefStore = TestManagerPlugin.getInstance().getPreferenceStore();
+ prefStore.setValue(PAGE_KEY + "." + NUMBER_OF_VALUES, treeInputList.size());
+ int index = 0;
+ for (EnvironmentPreferenceNode node : treeInputList) {
+ index = treeInputList.indexOf(node);
+ String name = node.getEnvName();
+ if (name != null && name != "") {
+ prefStore.putValue(PAGE_KEY + "." + NAME + "_" + index, name);
+ String value = node.getValue();
+ prefStore.putValue(PAGE_KEY + "." + VALUE + "_" + index, (value != null ? value : ""));
+ prefStore.putValue(PAGE_KEY + "." + CHECKED + "_" + index, Boolean.toString(node.isChecked()));
+ }
+ }
+ }
+
+ private void attachListeners() {
+ treeViewer.getTree().addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ if (e.character == SWT.DEL) {
+ environmentPageEventHandler.handleRemoveSelectedViewEvent();
+ }
+ }
+ });
+
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ environmentPageEventHandler.handleTreeSelectionEvent(event);
+ }
+ });
+
+ treeViewer.getTree().addMouseListener(new MouseListener() {
+ public void mouseDoubleClick(MouseEvent e) {
+ environmentPageEventHandler.handleEditVariableEvent();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ }
+
+ public void mouseUp(MouseEvent e) {
+ }
+ });
+
+ treeViewer.addCheckStateListener(new ICheckStateListener() {
+
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ environmentPageEventHandler.handleCheckStateChangeEvent(event);
+ }
+
+ });
+ }
+
+ private Control createButtonArea(Composite parent) {
+
+ buttonComposite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ GridData gd = new GridData(SWT.FILL);
+ buttonComposite.setLayout(gridLayout);
+ buttonComposite.setLayoutData(gd);
+
+ addButton = new Button(buttonComposite, SWT.PUSH);
+ addButton.setText("Add");
+ addButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ environmentPageEventHandler.handleAddEnvironmentVariableEvent();
+ }
+ });
+
+ removeButton = new Button(buttonComposite, SWT.PUSH);
+ removeButton.setText("Remove");
+ removeButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ environmentPageEventHandler.handleRemoveSelectedViewEvent();
+ }
+
+ });
+ return parent;
+ }
+
+ private Control createTreeArea(Composite parent) {
+
+ Group defaultEnvironmentVariablesGroup = new Group(parent, SWT.NONE);
+ defaultEnvironmentVariablesGroup.setText("Select Default Environment Variables to Use");
+ GridLayout gL = new GridLayout();
+ gL.numColumns = 2;
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ defaultEnvironmentVariablesGroup.setLayout(gL);
+ defaultEnvironmentVariablesGroup.setLayoutData(gd);
+
+ Composite areaComposite = new Composite(defaultEnvironmentVariablesGroup, SWT.NONE);
+ GridLayout treeLayout = new GridLayout();
+ treeLayout.numColumns = 1;
+ GridData gd1 = new GridData();
+ gd1.horizontalAlignment = GridData.FILL;
+ gd1.verticalAlignment = GridData.FILL;
+ gd1.grabExcessHorizontalSpace = true;
+ gd1.grabExcessVerticalSpace = true;
+ areaComposite.setLayout(treeLayout);
+ areaComposite.setLayoutData(gd1);
+
+ GridData treeGridData = new GridData();
+ treeGridData.grabExcessHorizontalSpace = true;
+ treeGridData.grabExcessVerticalSpace = true;
+ treeGridData.horizontalAlignment = GridData.FILL;
+ treeGridData.verticalAlignment = GridData.FILL;
+
+ treeViewer =
+ new CheckboxTreeViewer(areaComposite, SWT.MULTI | SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ treeViewer.getTree().setLayoutData(treeGridData);
+ treeViewer.setContentProvider(new ITreeContentProvider() {
+
+ public void dispose() {
+
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement != null && parentElement instanceof TreeParent) {
+ TreeParent parent = (TreeParent) parentElement;
+ if (parent.hasChildren()) {
+ return parent.getChildren();
+ }
+ }
+ return new Object[0];
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement != null && inputElement instanceof ArrayList<?>) {
+ ArrayList<?> elementArray = (ArrayList<?>) inputElement;
+ return elementArray.toArray();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ if (element != null && element instanceof TreeObject) {
+ TreeObject child = (TreeObject) element;
+ return child.getParent();
+ }
+ return new Object();
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof TreeParent) {
+ TreeParent parent = (TreeParent) element;
+ return parent.hasChildren();
+ }
+ return false;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+ });
+ treeViewer.setLabelProvider(new LabelProvider() {
+
+ @Override
+ public Image getImage(Object obj) {
+ return ImageManager.getImage(OteTestManagerImage.ENVIRONMENT);
+ }
+
+ @Override
+ public String getText(Object obj) {
+ return obj.toString();
+ }
+ });
+ treeViewer.setInput(treeInputList);
+ treeViewer.getTree().setToolTipText("Double click on an item to edit.\nClick once to preview content.");
+
+ environmentPageEventHandler = new EnvironmentPageEventHandler(parent, treeViewer, treeInputList);
+
+ createButtonArea(defaultEnvironmentVariablesGroup);
+
+ attachListeners();
+
+ for (EnvironmentPreferenceNode parentNode : treeInputList) {
+ treeViewer.setChecked(parentNode, parentNode.isChecked());
+ }
+
+ return parent;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/Dialogs.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/Dialogs.java
new file mode 100644
index 0000000000..810e024a7c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/Dialogs.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.ui.test.manager.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.PlatformUI;
+
+public class Dialogs {
+
+ public static void popupError(String title, String message) {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message);
+ }
+
+ public static void popupInformational(String title, String message) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialog.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialog.java
new file mode 100644
index 0000000000..0162b3c22d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialog.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * 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.ui.test.manager.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvVariableDetailsDialog extends MessageDialog {
+
+ private Button cancelButton;
+ private final String dialogMessage;
+
+ private Button okButton;
+
+ private Button importButton;
+
+ private String selection;
+ private boolean selectionOk;
+ private StyledText textArea;
+
+ public EnvVariableDetailsDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex, String oldValue) {
+ super(parentShell, dialogTitle, dialogTitleImage, null, dialogImageType, dialogButtonLabels, defaultIndex);
+
+ this.selectionOk = false;
+ this.selection = oldValue;
+ this.dialogMessage = dialogMessage;
+ }
+
+ public String getSelection() {
+ return selection;
+ }
+
+ public boolean isValid() {
+ return selectionOk;
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control c = super.createButtonBar(parent);
+ okButton = getButton(0);
+ cancelButton = getButton(1);
+
+ okButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = true;
+
+ }
+ });
+
+ cancelButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = false;
+ }
+ });
+ return c;
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+ // super.createCustomArea(parent);
+
+ GridData d = new GridData(GridData.FILL);
+
+ Group setValueGroup = new Group(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ setValueGroup.setLayout(gridLayout);
+ setValueGroup.setText(dialogMessage);
+
+ Composite topLevelComposite = new Composite(setValueGroup, SWT.NONE);
+ gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ topLevelComposite.setLayout(gridLayout);
+ topLevelComposite.setLayoutData(d);
+
+ importButton = new Button(setValueGroup, SWT.NONE);
+ importButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
+ importButton.setText("Import");
+ importButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(EnvVariableDetailsDialog.this.getShell(), SWT.OPEN);
+
+ String result = dialog.open();
+ if (result != null && !result.equals("")) {
+ String importedData;
+ try {
+ importedData = Lib.fileToString(new File(result));
+ textArea.setText(textArea.getText() + importedData);
+ selection = textArea.getText();
+ } catch (IOException ex) {
+ OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ });
+
+ textArea = new StyledText(setValueGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP);
+ GridData gd = new GridData();
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.horizontalSpan = 1;
+ gd.heightHint = 200;
+ gd.widthHint = 400;
+ textArea.setLayoutData(gd);
+
+ textArea.setText((selection != null ? selection : ""));
+
+ textArea.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ selection = textArea.getText();
+ }
+ });
+
+ return parent;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialogHelper.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialogHelper.java
new file mode 100644
index 0000000000..4b80b12564
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDetailsDialogHelper.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.ui.test.manager.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvVariableDetailsDialogHelper implements Runnable {
+
+ private String nameOfVariableToSet;
+ private int result;
+ private String selection;
+
+ public EnvVariableDetailsDialogHelper(String nameOfVariableToSet, String oldValue) {
+ this.nameOfVariableToSet = nameOfVariableToSet;
+ this.selection = oldValue;
+ }
+
+ public int getResult() {
+ return result;
+ }
+
+ public String getSelection() {
+ return selection;
+ }
+
+ public void run() {
+ EnvVariableDetailsDialog dlg = new EnvVariableDetailsDialog(null, "Edit " + nameOfVariableToSet, null,
+ nameOfVariableToSet + " Value:", MessageDialog.NONE, new String[] {"OK", "Cancel"}, 0, selection);
+
+ result = dlg.open();
+
+ if (result == Window.OK) {
+ if (dlg.isValid()) {
+ String info = dlg.getSelection();
+ if (info != null) {
+ selection = info;
+ }
+ else {
+ selection = "";
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialog.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialog.java
new file mode 100644
index 0000000000..e4411c80eb
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialog.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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.ui.test.manager.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvVariableDialog extends MessageDialog {
+
+ private Button cancelButton;
+ private String dialogMessage;
+
+ private Button okButton;
+
+ private String selection;
+ private boolean selectionOk;
+ private StyledText textArea;
+
+ public EnvVariableDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
+ int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
+ super(parentShell, dialogTitle, dialogTitleImage, null, dialogImageType, dialogButtonLabels, defaultIndex);
+ this.dialogMessage = dialogMessage;
+ this.selectionOk = false;
+ }
+
+ public String getSelection() {
+ return selection;
+ }
+
+ public boolean isValid() {
+ return selectionOk;
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control c = super.createButtonBar(parent);
+ okButton = getButton(0);
+ cancelButton = getButton(1);
+
+ okButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = true;
+
+ }
+ });
+
+ cancelButton.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = false;
+ }
+ });
+ return c;
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+ super.createCustomArea(parent);
+
+ GridData gd = new GridData(SWT.FILL);
+ // gd.minimumWidth = 200;
+ gd.grabExcessHorizontalSpace = true;
+
+ Composite addView = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ addView.setLayout(gridLayout);
+ addView.setLayoutData(gd);
+
+ (new Label(addView, SWT.NONE)).setText(dialogMessage);
+
+ GridData gd1 = new GridData(SWT.FILL);
+ gd1.minimumWidth = 200;
+ gd1.grabExcessHorizontalSpace = true;
+
+ textArea = new StyledText(addView, SWT.SINGLE | SWT.BORDER);
+ textArea.setLayoutData(gd1);
+ textArea.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ selection = textArea.getText();
+ }
+ });
+
+ return parent;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialogHelper.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialogHelper.java
new file mode 100644
index 0000000000..d213c98d40
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/EnvVariableDialogHelper.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.ui.test.manager.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EnvVariableDialogHelper implements Runnable {
+
+ private int result;
+ private String selection;
+
+ public EnvVariableDialogHelper() {
+
+ }
+
+ public int getResult() {
+ return result;
+ }
+
+ public String getSelection() {
+ return selection;
+ }
+
+ public void run() {
+ EnvVariableDialog dlg = new EnvVariableDialog(null, "Add Environment Variable", null, "Enter Name:",
+ MessageDialog.NONE, new String[] {"OK", "Cancel"}, 0);
+
+ result = dlg.open();
+
+ if (result == Window.OK) {
+ if (dlg.isValid()) {
+ String info = dlg.getSelection();
+ if (info != null) {
+ selection = info;
+ }
+ else {
+ selection = "";
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/PluginUtil.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/PluginUtil.java
new file mode 100644
index 0000000000..4de8202688
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/PluginUtil.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.ui.test.manager.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public class PluginUtil {
+
+ public static List<IViewReference> findAllViews(String viewID) {
+ ArrayList<IViewReference> list = new ArrayList<IViewReference>();
+ IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
+ for (IWorkbenchWindow window : windows) {
+ IWorkbenchPage pages[] = window.getPages();
+ for (IWorkbenchPage page : pages) {
+ IViewReference viewRefs[] = page.getViewReferences();
+ for (IViewReference viewRef : viewRefs) {
+ if (viewRef.getId().equals(viewID)) {
+ list.add(viewRef);
+ }
+ }
+
+ }
+ }
+ return list;
+ }
+
+ public static boolean areTestManagersAvailable() {
+ return getTestManagers().length > 0;
+ }
+
+ public static TestManagerEditor[] getTestManagers() {
+ List<TestManagerEditor> tmes = new ArrayList<TestManagerEditor>();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ IEditorReference editors[] = page.getEditorReferences();
+ if (editors != null) {
+ for (int j = 0; j < editors.length; j++) {
+ IEditorReference editor = editors[j];
+ IWorkbenchPart part = editor.getPart(true);
+ if (part instanceof TestManagerEditor) {
+ tmes.add((TestManagerEditor) part);
+ }
+ }
+ }
+ }
+ }
+ return tmes.toArray(new TestManagerEditor[tmes.size()]);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/TestManagerSelectDialog.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/TestManagerSelectDialog.java
new file mode 100644
index 0000000000..3f75b0fbb9
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/TestManagerSelectDialog.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.ui.test.manager.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.ListSelectionDialog;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TestManagerSelectDialog {
+ private final static String MESSAGE = "Select A Test Manager";
+ private ListSelectionDialog listSelectionDialog;
+ private LabelProvider labelProvider;
+
+ private TestManagerSelectDialog() {
+ this.labelProvider = new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TestManagerEditor) {
+ return ((TestManagerEditor) element).getPartName();
+ }
+ return "Unknown element type";
+ }
+ };
+ TestManagerEditor[] input = PluginUtil.getTestManagers();
+ this.listSelectionDialog =
+ new ListSelectionDialog(Display.getCurrent().getActiveShell(), input, new ArrayContentProvider(),
+ labelProvider, MESSAGE);
+ this.listSelectionDialog.setTitle(MESSAGE);
+ if (input.length > 0) {
+ this.listSelectionDialog.setInitialSelections(new Object[] {input[0]});
+ }
+ }
+
+ public int open() {
+ return listSelectionDialog.open();
+ }
+
+ public TestManagerEditor[] getResult() {
+ List<TestManagerEditor> tmes = new ArrayList<TestManagerEditor>();
+ for (Object object : listSelectionDialog.getResult()) {
+ tmes.add((TestManagerEditor) object);
+ }
+ return tmes.toArray(new TestManagerEditor[tmes.size()]);
+ }
+
+ public static TestManagerEditor[] getTestManagerFromUser() {
+ TestManagerEditor[] toReturn = null;
+ TestManagerSelectDialog dialog = new TestManagerSelectDialog();
+ int result = dialog.open();
+ if (result == Window.OK) {
+ toReturn = dialog.getResult();
+ }
+ return toReturn != null ? toReturn : new TestManagerEditor[0];
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/WidgetFactory.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/WidgetFactory.java
new file mode 100644
index 0000000000..a2ac2408f6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/util/WidgetFactory.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.ui.test.manager.util;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author David Diepenbrock
+ */
+public class WidgetFactory {
+
+ /**
+ * Creates a <code>Label</code> for use on a GridLayout.
+ *
+ * @param comp The composite this label will be on.
+ * @param horizontalSpan The number of columns this Label should span in the grid
+ * @return The created label - with no text
+ */
+ public static Label createLabelForGrid(Composite comp, int horizontalSpan) {
+ Label label = new Label(comp, SWT.NONE);
+ GridData gd = new GridData();
+ gd.horizontalSpan = horizontalSpan;
+ label.setLayoutData(gd);
+ return label;
+ }
+
+ /**
+ * Creates a <code>Label</code> for use on a GridLayout. The <code>Label</code> will only
+ * span 1 column in the grid.
+ *
+ * @param comp The composite this label will be on.
+ * @param str The text for the label
+ * @return The created label
+ */
+ public static Label createLabelForGrid(Composite comp, String str) {
+ return createLabelForGrid(comp, str, 1);
+ }
+
+ /**
+ * Creates a <code>Label</code> for use on a GridLayout.
+ *
+ * @param comp The composite this label will be on.
+ * @param labelText The text for the label
+ * @param horizontalSpan The number of columns this Label should span in the grid
+ * @return The created label
+ */
+ public static Label createLabelForGrid(Composite comp, String labelText, int horizontalSpan) {
+ Label label = createLabelForGrid(comp, horizontalSpan);
+ label.setText(labelText);
+ return label;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizard.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizard.java
new file mode 100644
index 0000000000..4b1c9bb00c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizard.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * 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.ui.test.manager.wizards;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * This is a sample new wizard. Its role is to create a new file resource in the provided container.
+ * If the container resource (a folder or a project) is selected in the workspace when the wizard is
+ * opened, it will accept it as the target container. The wizard creates one file with the extension
+ * "mpe". If a sample multi-page editor (also available as a template) is registered for the same
+ * extension, it will be able to open it.
+ */
+
+public class TestManagerNewWizard extends Wizard implements INewWizard {
+ private TestManagerNewWizardPage page;
+
+ private ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizard.
+ */
+ public TestManagerNewWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages() {
+ page = new TestManagerNewWizardPage(selection);
+ addPage(page);
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We will create an
+ * operation and run it using wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String containerName = page.getContainerName();
+ final String fileName = page.getFileName();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ doFinish(containerName, fileName, monitor);
+ }
+ catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ }
+ catch (InterruptedException e) {
+ return false;
+ }
+ catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the file if missing or just replace its
+ * contents, and open the editor on the newly created file.
+ */
+
+ private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException {
+ // create a sample file
+ monitor.beginTask("Creating " + fileName, 2);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(containerName));
+ if (!resource.exists() || !(resource instanceof IContainer)) {
+ throwCoreException("Container \"" + containerName + "\" does not exist.");
+ }
+ IContainer container = (IContainer) resource;
+ final IFile file = container.getFile(new Path(fileName + ".tmc"));
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ }
+ else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ }
+ catch (IOException e) {
+ }
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing...");
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IDE.openEditor(page, file, true);
+ }
+ catch (PartInitException e) {
+ }
+ }
+ });
+ monitor.worked(1);
+ }
+
+ /**
+ * We will initialize file contents with a sample text.
+ */
+
+ private InputStream openContentStream() {
+ String contents = "<testManager>\n"
+ + "<contact></contact>\n"
+ + "<description>Find those bugs</description>\n</testManager>\n";
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status = new Status(IStatus.ERROR, "org.eclipse.osee.ote.ui.test.manager", IStatus.OK, message, null);
+ throw new CoreException(status);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizardPage.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizardPage.java
new file mode 100644
index 0000000000..a71dea3a71
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/wizards/TestManagerNewWizardPage.java
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * 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.ui.test.manager.wizards;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+/**
+ * The "New" wizard page allows setting the container for the new file as well as the file name. The
+ * page will only accept file name without the extension OR with the extension that matches the
+ * expected one (mpe).
+ */
+
+public class TestManagerNewWizardPage extends WizardPage {
+ private Text containerText;
+
+ private Text fileText;
+
+ private ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizardPage.
+ *
+ * @param selection
+ */
+ public TestManagerNewWizardPage(ISelection selection) {
+ super("wizardPage");
+ setTitle("Test Manager Editor File");
+ setDescription("This wizard creates a new Test Manager file.");
+ this.selection = selection;
+ }
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+ Label label = new Label(container, SWT.NULL);
+ label.setText("&Container:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText("&File name:");
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+ initialize();
+ dialogChanged();
+ setControl(container);
+ }
+
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ public String getFileName() {
+ return fileText.getText();
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+
+ private void dialogChanged() {
+ String container = getContainerName();
+ String fileName = getFileName();
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(container));
+ IContainer rcontainer = (IContainer) resource;
+
+ if (container.length() == 0) {
+ updateStatus("File container must be specified");
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus("File name must be specified");
+ return;
+ }
+
+ // verify extension isn't there
+ if ((fileName.endsWith("tmc") == true) || (fileName.endsWith(".")) == true) {
+ updateStatus("Do not add .tmc extenstion.");
+ return;
+ }
+ // verify title is alpha-numeric with spaces and dashes
+ Matcher m = Pattern.compile("^[\\w]+([\\w_]*[\\w])?$").matcher(fileName);
+ boolean match = false;
+ while (m.find()) {
+ match = true;
+ }
+ if (!match) {
+ updateStatus("Filename must be alpha-numeric with \"_\" \n" + "And can not begin or end with a space.");
+ return;
+ }
+ // verify existing file doesn't exist
+ final IFile file = rcontainer.getFile(new Path(fileName + ".tmc"));
+ if (file.exists()) {
+ updateStatus("File with this name already exists.");
+ return;
+ }
+ int dotLoc = fileName.lastIndexOf('.');
+ if (dotLoc != -1) {
+ String ext = fileName.substring(dotLoc + 1);
+ if (ext.equalsIgnoreCase("tmc") == false) {
+ updateStatus("File extension must be \"tmc\"");
+ return;
+ }
+ }
+ updateStatus(null);
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for the container field.
+ */
+
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
+ ResourcesPlugin.getWorkspace().getRoot(), false, "Select new file container");
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ containerText.setText(((Path) result[0]).toOSString());
+ }
+ }
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+
+ private void initialize() {
+ if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() > 1)
+ return;
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof IResource) {
+ IContainer container;
+ if (obj instanceof IContainer)
+ container = (IContainer) obj;
+ else
+ container = ((IResource) obj).getParent();
+ containerText.setText(container.getFullPath().toString());
+ }
+ }
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/support/output.xsd b/plugins/org.eclipse.osee.ote.ui.test.manager/support/output.xsd
new file mode 100644
index 0000000000..e1d32dbe07
--- /dev/null
+++ b/plugins/org.eclipse.osee.ote.ui.test.manager/support/output.xsd
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <!-- ====================== -->
+ <!-- AUTHOR: Charles Shaw -->
+ <!-- ====================== -->
+
+ <!-- This is included only once as the first element in TestScript -->
+ <xs:element name="Config">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ScriptName" type="xs:string"/>
+ <xs:element name="Environment" type="xs:string"/>
+ <xs:element name="TestEnvironmentVersion" type="xs:string"/>
+ <xs:element name="UserName" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- This is included only once as the last element in TestScript -->
+ <xs:element name="ScriptResult">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ElapsedTime" type="xs:integer"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Location is used in multiple elements -->
+ <xs:element name="Location">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Source" type="xs:string"/>
+ <xs:element name="Line" type="xs:integer"/>
+ <xs:element name="Time" type="xs:integer"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Debug">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Location"/>
+ <xs:element name="Message" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Support">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Location"/>
+ <xs:element name="Message" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Severe">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Location"/>
+ <xs:element name="Message" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Warning">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Location"/>
+ <xs:element name="Message" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Attention">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Location"/>
+ <xs:element name="Message" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- CheckPoint and CheckGroup are both used by TestPoint -->
+ <xs:element name="CheckPoint">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="TestPointName" type="xs:string"/>
+ <xs:element name="Expected" type="xs:string"/>
+ <xs:element name="Actual" type="xs:string"/>
+ <xs:element name="Result" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Used to build permutations or the elements in the group -->
+ <xs:group name="Checks">
+ <xs:choice>
+ <xs:element ref="CheckPoint" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="CheckGroup" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:element name="CheckGroup">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="GroupName"/>
+ <xs:element name="Result"/>
+ <xs:group ref="Checks" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="Mode" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="TestPoint">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Number" type="xs:integer"/>
+ <xs:element name="Result" type="xs:string"/>
+ <xs:element ref="Location"/>
+ <xs:group ref="Checks" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Used to build permutations or the elements in the group -->
+ <xs:group name="Messages">
+ <xs:choice>
+ <xs:element ref="Trace" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="Debug" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="TestPoint" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="Support" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="Severe" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="Warning" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="Attention" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:choice>
+ </xs:group>
+
+ <!-- Both Trace and TestCase can hold any element, any number of times -->
+ <!-- With the exception that only TestScript can hold a TestCase -->
+ <xs:element name="Trace">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="ObjectName" type="xs:string"/>
+ <xs:element name="MethodName" type="xs:string"/>
+ <xs:element name="MethodArgument" type="xs:string"/>
+ <xs:element ref="Location"/>
+ <xs:group ref="Messages" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+
+ <xs:element name="Tracability">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="RequirementId" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="TestCase">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Number" type="xs:integer"/>
+ <xs:element ref="Tracability"/>
+ <xs:group ref="Messages" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="ScriptInit">
+ <xs:complexType>
+ <xs:group ref="Messages" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Base Element in the XML -->
+ <xs:element name="TestScript">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Config"/>
+ <xs:element ref="ScriptInit"/>
+ <xs:element ref="TestCase" maxOccurs="unbounded"/>
+ <xs:element ref="ScriptResult"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema> \ No newline at end of file

Back to the top