brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] git commit: Fix the locale so tests are deterministic.
Date Wed, 15 Oct 2014 10:45:10 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master a422b9aa3 -> 1923d510d


Fix the locale so tests are deterministic.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/58002efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/58002efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/58002efc

Branch: refs/heads/master
Commit: 58002efc2b214c90b74460f867fe66da1d216f6a
Parents: ab04511
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Fri Oct 10 13:31:27 2014 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Mon Oct 13 10:26:15 2014 +0300

----------------------------------------------------------------------
 core/pom.xml                                        |  7 +++++++
 .../transformer/impl/XsltTransformerTest.java       |  5 ++---
 .../brooklyn/util/text/TemplateProcessorTest.java   | 16 ++++++++++++++++
 3 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/58002efc/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index f3136f1..49469ce 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -219,6 +219,13 @@
             <classifier>tests</classifier>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>io.brooklyn</groupId>
+            <artifactId>brooklyn-utils-common</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
   <!-- add maxmind geo-ip library; exact copy of source included as required by LGPL2
-->

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/58002efc/core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java
b/core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java
index 32baff6..cc801b2 100644
--- a/core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java
@@ -22,16 +22,15 @@ import static org.testng.Assert.assertEquals;
 
 import org.testng.annotations.Test;
 
-import brooklyn.entity.rebind.transformer.impl.XsltTransformer;
-import brooklyn.entity.rebind.transformer.impl.XsltTransformerTest;
 import brooklyn.util.ResourceUtils;
+import brooklyn.util.os.Os;
 import brooklyn.util.text.TemplateProcessor;
 
 import com.google.common.collect.ImmutableMap;
 
 public class XsltTransformerTest {
 
-    private static String NEWLINE = System.getProperty("line.separator");
+    private static String NEWLINE = Os.LINE_SEPARATOR;
     
     @Test
     public void testRenameType() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/58002efc/core/src/test/java/brooklyn/util/text/TemplateProcessorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/util/text/TemplateProcessorTest.java b/core/src/test/java/brooklyn/util/text/TemplateProcessorTest.java
index b9c23e7..ef9c41a 100644
--- a/core/src/test/java/brooklyn/util/text/TemplateProcessorTest.java
+++ b/core/src/test/java/brooklyn/util/text/TemplateProcessorTest.java
@@ -21,17 +21,33 @@ package brooklyn.util.text;
 import static org.testng.Assert.assertEquals;
 
 import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.BrooklynAppUnitTestSupport;
 import brooklyn.entity.proxying.EntitySpec;
 import brooklyn.event.basic.DependentConfiguration;
+import brooklyn.test.FixedLocaleTest;
 import brooklyn.test.entity.TestApplication;
 import brooklyn.test.entity.TestEntity;
 
 import com.google.common.collect.ImmutableMap;
 
 public class TemplateProcessorTest extends BrooklynAppUnitTestSupport {
+    private FixedLocaleTest localeFix = new FixedLocaleTest();
+
+    @BeforeMethod(alwaysRun=true)
+    public void setUp() throws Exception {
+        super.setUp();
+        localeFix.setUp();
+    }
+
+    @AfterMethod(alwaysRun=true)
+    public void tearDown() throws Exception {
+        super.tearDown();
+        localeFix.tearDown();
+    }
 
     @Test
     public void testAdditionalArgs() {


Mime
View raw message