diff options
author | Christine Pleasent | 2015-01-31 00:54:09 +0000 |
---|---|---|
committer | Christine Pleasent | 2015-01-31 01:07:18 +0000 |
commit | 789697c37537421c60cf158949301a63f19cb811 (patch) | |
tree | d9ea640a7087dd1e33025dd2654093a691438a3c /plugins | |
parent | 4c2faa816a1ef34a8917d0da9ddebff9be885e3d (diff) | |
download | org.eclipse.osee-789697c37537421c60cf158949301a63f19cb811.tar.gz org.eclipse.osee-789697c37537421c60cf158949301a63f19cb811.tar.xz org.eclipse.osee-789697c37537421c60cf158949301a63f19cb811.zip |
feature[ats_GYBVF]: Add option to log info about failing test points
Signed-off-by: Christine Pleasent <christine.pleasent@boeing.com>
Diffstat (limited to 'plugins')
8 files changed, 47 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteProperties.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteProperties.java index d6c8a2dda57..5ba9981b5db 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteProperties.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/OteProperties.java @@ -23,6 +23,7 @@ public class OteProperties extends OseeProperties { private static final String OSEE_OTE_BATCH = "osee.ote.batch"; private static final String OSEE_OTE_LOG_FILE_PATH = "osee.ote.logfilepath"; private static final String OSEE_PAUSE_ON_FAIL = "ote.pause.on.fail"; + private static final String OSEE_PRINT_FAIL_TO_CONSOLE = "ote.print.fail.to.console"; private OteProperties() { super(); @@ -51,6 +52,10 @@ public class OteProperties extends OseeProperties { public static boolean isPauseOnFailEnabled(){ return System.getProperty(OSEE_PAUSE_ON_FAIL) != null ? true : false; } + + public static boolean isPrintFailToConsoleEnabled(){ + return System.getProperty(OSEE_PRINT_FAIL_TO_CONSOLE) != null ? true : false; + } /** * A string representation of all the property setting specified by this class * diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/TestScript.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/TestScript.java index 771381c148e..22a98f36899 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/TestScript.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/TestScript.java @@ -178,6 +178,7 @@ public abstract class TestScript implements ITimeout { private final TestPromptImpl promptImpl; private ITestRunListenerProvider listenerProvider; private boolean shouldPauseOnFail; + private boolean printFailToConsole; public TestScript(TestEnvironment environment, IUserSession callback, ScriptTypeEnum scriptType, boolean isBatchable) { constructed.incrementAndGet(); @@ -198,6 +199,7 @@ public abstract class TestScript implements ITimeout { } this.testPointTally = new TestPointTally(this.getClass().getName()); shouldPauseOnFail = OteProperties.isPauseOnFailEnabled(); + printFailToConsole = OteProperties.isPrintFailToConsoleEnabled(); } public void abort() { @@ -309,13 +311,24 @@ public abstract class TestScript implements ITimeout { public void pauseScriptOnFail(int testPoint) throws InterruptedException{ if (shouldPauseOnFail){ - promptPause("Test point " + testPoint + " failed.\n"); + promptPause("Test point " + testPoint + " failed.\n"); } } public void pauseScriptOnFail(int testPoint, String name, String expected, String actual, String stackTrace) throws InterruptedException{ if (shouldPauseOnFail){ - promptPause("TP " + testPoint + ": " + name + "\nExpected: " + expected + "\nActual: " + actual + "\n\n" + stackTrace ); + promptPause("TP " + testPoint + ": " + name + "\nExpected: " + expected + "\nActual: " + actual + "\n\n" + stackTrace ); + } + } + + public void printFailure(int testPoint) throws InterruptedException{ + if (printFailToConsole){ + prompt("Test point " + testPoint + " failed.\n"); + } + } + public void printFailure(int testPoint, String name, String expected, String actual, String stackTrace) throws InterruptedException{ + if (printFailToConsole){ + prompt("TP " + testPoint + ": " + name + "\nExpected: " + expected + "\nActual: " + actual + "\n\n" + stackTrace ); } } diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java index 0e81b806451..a2812bbf769 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTests.java @@ -104,6 +104,15 @@ public class RunTests implements ITestServerCommand, Serializable { System.clearProperty("ote.pause.on.fail"); } + //Override the command line option only if batch pause has been selected in TestManager + boolean printOnFailMode = global.getBoolean(RunTestsKeys.printFailToConsoleMode.name()); + if(printOnFailMode){ + System.setProperty("ote.print.fail.to.console", "true"); + } + else { + System.clearProperty("ote.print.fail.to.console"); + } + for (IPropertyStore store : scripts) { if (cancelAll) { statusBoard.onTestComplete(store.get(RunTestsKeys.testClass.name()), diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java index ca9429f816c..a92904874d7 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/framework/command/RunTestsKeys.java @@ -23,6 +23,7 @@ public enum RunTestsKeys { spare1, batchFailAbortMode, batchmode, - batchFailPauseMode; + batchFailPauseMode, + printFailToConsoleMode; } diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/log/record/TestPointRecord.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/log/record/TestPointRecord.java index 79093bc1e84..c9d659d9048 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/log/record/TestPointRecord.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/log/record/TestPointRecord.java @@ -107,9 +107,11 @@ public class TestPointRecord extends TestRecord { } } script.pauseScriptOnFail(point, name, exp, act, stack.toString()); + script.printFailure(point, name, exp, act, stack.toString()); } else { script.pauseScriptOnFail(point); + script.printFailure(point); } } catch (InterruptedException e) { e.printStackTrace(); 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 index f032985b7cf..b2b352fcccc 100644 --- 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 @@ -78,6 +78,7 @@ public class ScriptExecutionContribution implements IPropertyStoreBasedControl { this.optionsPanel.setBatchModeEnabled(propertyStore.getBoolean(TestManagerStorageKeys.BATCH_MODE_ENABLED_KEY)); this.optionsPanel.setAbortOnFail(propertyStore.getBoolean(TestManagerStorageKeys.ABORT_ON_FAIL_KEY)); this.optionsPanel.setPauseOnFail(propertyStore.getBoolean(TestManagerStorageKeys.PAUSE_ON_FAIL_KEY)); + this.optionsPanel.setPrintFailToConsole(propertyStore.getBoolean(TestManagerStorageKeys.PRINT_FAIL_TO_CONSOLE)); this.loggingPanel.setSelected(propertyStore.get(TestManagerStorageKeys.LOGGING_LEVEL_KEY)); } @@ -93,6 +94,7 @@ public class ScriptExecutionContribution implements IPropertyStoreBasedControl { propertyStore.put(TestManagerStorageKeys.BATCH_MODE_ENABLED_KEY, this.optionsPanel.isBatchModeEnabled()); propertyStore.put(TestManagerStorageKeys.ABORT_ON_FAIL_KEY, this.optionsPanel.isAbortOnFail()); propertyStore.put(TestManagerStorageKeys.PAUSE_ON_FAIL_KEY, this.optionsPanel.isPauseOnFail()); + propertyStore.put(TestManagerStorageKeys.PRINT_FAIL_TO_CONSOLE, this.optionsPanel.isPrintFailToConsole()); } @Override 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 index d1a7f7cee0b..628b913aa64 100644 --- 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 @@ -20,6 +20,7 @@ public class TestManagerStorageKeys { public static final String KEEP_OLD_OUTFILE_COPIES_ENABLED_KEY = "is.keep.old.outfile.copies.enabled"; public static final String ABORT_ON_FAIL_KEY = "is.abort.mode.enabled"; public static final String PAUSE_ON_FAIL_KEY = "is.pause.mode.enabled"; + public static final String PRINT_FAIL_TO_CONSOLE = "is.print.fail.enabled"; public static final String LOGGING_LEVEL_KEY = "logging.level"; public static final String SCRIPT_OUTPUT_DIRECTORY_KEY = "script.output.directory"; 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 index 338637f87ba..6b41c5e52b9 100644 --- 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 @@ -24,6 +24,7 @@ public class ScriptExecutionOptionsPanel extends Composite { private Button batchModeCheck; private Button abortScriptOnFirstFail; private Button pauseScriptOnFail; + private Button printFailToConsole; public ScriptExecutionOptionsPanel(Composite parent, int style) { super(parent, style); @@ -52,6 +53,9 @@ public class ScriptExecutionOptionsPanel extends Composite { pauseScriptOnFail.setText("Pause script on fail"); pauseScriptOnFail.setToolTipText("Each script failure will cause a promptPause to occur."); + printFailToConsole = new Button(parent, SWT.CHECK); + printFailToConsole.setText("Print failures to console"); + printFailToConsole.setToolTipText("Prints each failure to the console as the script runs."); } public boolean isKeepOldCopiesEnabled() { @@ -86,4 +90,11 @@ public class ScriptExecutionOptionsPanel extends Composite { pauseScriptOnFail.setSelection(isEnabled); } + public boolean isPrintFailToConsole(){ + return printFailToConsole.getSelection(); + } + + public void setPrintFailToConsole(boolean isEnabled){ + printFailToConsole.setSelection(isEnabled); + } } |