brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/6] git commit: Convert GeoscalingScriptGeneratorTest from groovy to java
Date Wed, 25 Jun 2014 15:05:50 GMT
Convert GeoscalingScriptGeneratorTest from groovy to java


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

Branch: refs/heads/master
Commit: c309976f82a4de27a1424d3dc0e52c5d14e90f51
Parents: ace1124
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Jun 17 23:02:05 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Wed Jun 18 10:25:46 2014 +0100

----------------------------------------------------------------------
 .../GeoscalingScriptGeneratorTest.groovy        | 38 -------------------
 .../GeoscalingScriptGeneratorTest.java          | 40 ++++++++++++++++++++
 2 files changed, 40 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c309976f/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.groovy
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.groovy
b/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.groovy
deleted file mode 100644
index d296ce8..0000000
--- a/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.groovy
+++ /dev/null
@@ -1,38 +0,0 @@
-package brooklyn.entity.dns.geoscaling
-
-import static org.testng.AssertJUnit.*
-
-import java.util.LinkedHashSet
-import java.util.Set
-
-import org.testng.annotations.Test
-
-import brooklyn.location.geo.HostGeoInfo
-import brooklyn.util.ResourceUtils
-
-
-/**
- * {@link GeoscalingScriptGenerator} unit tests.
- */
-class GeoscalingScriptGeneratorTest {
-    
-    private final static Set<HostGeoInfo> HOSTS = new LinkedHashSet<HostGeoInfo>();
-    static {
-        HOSTS.add(new HostGeoInfo("1.2.3.100", "Server 1", 40.0, -80.0));
-        HOSTS.add(new HostGeoInfo("1.2.3.101", "Server 2", 30.0, 20.0));
-    }
-    
-    
-    @Test
-    public void testScriptGeneration() {
-        Date generationTime = new Date(0);
-        String generatedScript = GeoscalingScriptGenerator.generateScriptString(generationTime,
HOSTS);
-        assertTrue(generatedScript.contains("1.2.3"));
-        String expectedScript = ResourceUtils.create(this).getResourceAsString("brooklyn/entity/dns/geoscaling/expectedScript.php");
-        assertEquals(expectedScript, generatedScript);
-        //also make sure leading slash is allowed
-        String expectedScript2 = ResourceUtils.create(this).getResourceAsString("/brooklyn/entity/dns/geoscaling/expectedScript.php");
-        assertEquals(expectedScript, generatedScript);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c309976f/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java
b/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java
new file mode 100644
index 0000000..1d45152
--- /dev/null
+++ b/software/webapp/src/test/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java
@@ -0,0 +1,40 @@
+package brooklyn.entity.dns.geoscaling;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import java.util.Date;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.testng.annotations.Test;
+
+import brooklyn.location.geo.HostGeoInfo;
+import brooklyn.util.ResourceUtils;
+
+
+/**
+ * {@link GeoscalingScriptGenerator} unit tests.
+ */
+public class GeoscalingScriptGeneratorTest {
+    
+    private final static Set<HostGeoInfo> HOSTS = new LinkedHashSet<HostGeoInfo>();
+    static {
+        HOSTS.add(new HostGeoInfo("1.2.3.100", "Server 1", 40.0, -80.0));
+        HOSTS.add(new HostGeoInfo("1.2.3.101", "Server 2", 30.0, 20.0));
+    }
+    
+    
+    @Test
+    public void testScriptGeneration() {
+        Date generationTime = new Date(0);
+        String generatedScript = GeoscalingScriptGenerator.generateScriptString(generationTime,
HOSTS);
+        assertTrue(generatedScript.contains("1.2.3"));
+        String expectedScript = ResourceUtils.create(this).getResourceAsString("brooklyn/entity/dns/geoscaling/expectedScript.php");
+        assertEquals(generatedScript, expectedScript);
+        //also make sure leading slash is allowed
+        String expectedScript2 = ResourceUtils.create(this).getResourceAsString("/brooklyn/entity/dns/geoscaling/expectedScript.php");
+        assertEquals(generatedScript, expectedScript);
+    }
+    
+}


Mime
View raw message