From 1cfdbf7e3f86ab50d7c0104cf172bd74e59e3c22 Mon Sep 17 00:00:00 2001 From: soupwizard Date: Wed, 24 Apr 2013 18:22:27 -0700 Subject: [PATCH 1/3] Added a build target "unittest-no-junit-report" to run unit tests and not create a junit report, but instead to show test run results in the ant output stream. Modified .travis.yml to use unittest-no-junit-report instead of unittest, and to change directory to core before doing the build and unittest. --- .travis.yml | 5 +++-- core/build.xml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2c0dedd0a..bb0b5b3ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,6 @@ language: java jdk: - oraclejdk7 script: - - "ant -buildfile core/build.xml clean checkascii build jar" - - "ant -buildfile core/build.xml unittest" + - "cd core" + - "ant -buildfile build.xml clean checkascii build jar" + - "ant -buildfile build.xml unittest-no-junit-report" diff --git a/core/build.xml b/core/build.xml index 35e1f66ce..9b79cf566 100644 --- a/core/build.xml +++ b/core/build.xml @@ -299,5 +299,36 @@ ${nonascii} Unit tests passed successfully. + + + + Building unit tests + + + + Running unit tests + + + + + + + + + + + + + + + + + + + + Unit tests passed successfully. + + + From 1ce951e635b8062864c94af73759034597bf8807 Mon Sep 17 00:00:00 2001 From: soupwizard Date: Wed, 24 Apr 2013 22:32:55 -0700 Subject: [PATCH 2/3] Modified application startup to set the base translator the same way the guice startup does - if the locale is set to 'xx' then the base translator is the debug translator, otherwise the base translator is ResourceBundleTranslator. You can set the locale by passing '-Duser.language=xx' to the jvm when starting up. This fixes github issue #17. --- core/src/net/sf/openrocket/startup/Application.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/net/sf/openrocket/startup/Application.java b/core/src/net/sf/openrocket/startup/Application.java index 16bf4ed4a..af4608107 100644 --- a/core/src/net/sf/openrocket/startup/Application.java +++ b/core/src/net/sf/openrocket/startup/Application.java @@ -1,5 +1,7 @@ package net.sf.openrocket.startup; +import java.util.Locale; + import net.sf.openrocket.database.ComponentPresetDao; import net.sf.openrocket.database.motor.MotorDatabase; import net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase; @@ -7,6 +9,7 @@ import net.sf.openrocket.gui.watcher.WatchService; import net.sf.openrocket.l10n.ClassBasedTranslator; import net.sf.openrocket.l10n.DebugTranslator; import net.sf.openrocket.l10n.ExceptionSuppressingTranslator; +import net.sf.openrocket.l10n.ResourceBundleTranslator; import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.logging.LogHelper; import net.sf.openrocket.logging.LogLevel; @@ -25,7 +28,7 @@ public final class Application { private static LogHelper logger; private static LogLevelBufferLogger logBuffer; - private static Translator baseTranslator = new DebugTranslator(null); + private static Translator baseTranslator = new ResourceBundleTranslator("l10n.messages"); private static ComponentPresetDao componentPresetDao; @@ -40,6 +43,13 @@ public final class Application { setLogOutputLevel(LogLevel.DEBUG); } + public Application() { + + if (Locale.getDefault().getLanguage().equals("xx")) { + baseTranslator = new DebugTranslator(baseTranslator); + } + } + /** * Return whether to use additional safety code checks. */ From dfd73c9a54c853f7d872755a27722dd053761831 Mon Sep 17 00:00:00 2001 From: soupwizard Date: Thu, 25 Apr 2013 10:21:52 -0700 Subject: [PATCH 3/3] Revert "Modified application startup to set the base translator the same way the" This reverts commit 1ce951e635b8062864c94af73759034597bf8807. --- core/src/net/sf/openrocket/startup/Application.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/core/src/net/sf/openrocket/startup/Application.java b/core/src/net/sf/openrocket/startup/Application.java index af4608107..16bf4ed4a 100644 --- a/core/src/net/sf/openrocket/startup/Application.java +++ b/core/src/net/sf/openrocket/startup/Application.java @@ -1,7 +1,5 @@ package net.sf.openrocket.startup; -import java.util.Locale; - import net.sf.openrocket.database.ComponentPresetDao; import net.sf.openrocket.database.motor.MotorDatabase; import net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase; @@ -9,7 +7,6 @@ import net.sf.openrocket.gui.watcher.WatchService; import net.sf.openrocket.l10n.ClassBasedTranslator; import net.sf.openrocket.l10n.DebugTranslator; import net.sf.openrocket.l10n.ExceptionSuppressingTranslator; -import net.sf.openrocket.l10n.ResourceBundleTranslator; import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.logging.LogHelper; import net.sf.openrocket.logging.LogLevel; @@ -28,7 +25,7 @@ public final class Application { private static LogHelper logger; private static LogLevelBufferLogger logBuffer; - private static Translator baseTranslator = new ResourceBundleTranslator("l10n.messages"); + private static Translator baseTranslator = new DebugTranslator(null); private static ComponentPresetDao componentPresetDao; @@ -43,13 +40,6 @@ public final class Application { setLogOutputLevel(LogLevel.DEBUG); } - public Application() { - - if (Locale.getDefault().getLanguage().equals("xx")) { - baseTranslator = new DebugTranslator(baseTranslator); - } - } - /** * Return whether to use additional safety code checks. */