brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-server git commit: Move SanitizerTest to correct package
Date Mon, 07 Nov 2016 10:22:27 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 90d166e84 -> 4d1e3f32f


Move SanitizerTest to correct package


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

Branch: refs/heads/master
Commit: 290feb936e93f893df0d5a426ca92b64f9b1a2e3
Parents: 90d166e
Author: Aled Sage <aled.sage@gmail.com>
Authored: Fri Nov 4 13:49:27 2016 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Fri Nov 4 21:32:43 2016 +0000

----------------------------------------------------------------------
 .../brooklyn/core/config/SanitizerTest.java     | 67 ++++++++++++++++++++
 .../brooklyn/core/entity/SanitizerTest.java     | 67 --------------------
 2 files changed, 67 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/290feb93/core/src/test/java/org/apache/brooklyn/core/config/SanitizerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/config/SanitizerTest.java b/core/src/test/java/org/apache/brooklyn/core/config/SanitizerTest.java
new file mode 100644
index 0000000..085b43d
--- /dev/null
+++ b/core/src/test/java/org/apache/brooklyn/core/config/SanitizerTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.Map;
+
+import org.apache.brooklyn.core.config.Sanitizer;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Functions;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+
+public class SanitizerTest {
+
+    @Test
+    public void testSanitize() throws Exception {
+        Map<String, Object> map = ImmutableMap.<String, Object>builder()
+                .put("PREFIX_password_SUFFIX", "pa55w0rd")
+                .put("PREFIX_PASSWORD_SUFFIX", "pa55w0rd")
+                .put("PREFIX_passwd_SUFFIX", "pa55w0rd")
+                .put("PREFIX_credential_SUFFIX", "pa55w0rd")
+                .put("PREFIX_secret_SUFFIX", "pa55w0rd")
+                .put("PREFIX_private_SUFFIX", "pa55w0rd")
+                .put("PREFIX_access.cert_SUFFIX", "myval")
+                .put("PREFIX_access.key_SUFFIX", "myval")
+                .put("mykey", "myval")
+                .build();
+        Map<String, Object> expected = MutableMap.<String, Object>builder()
+                .putAll(Maps.transformValues(map, Functions.constant("xxxxxxxx")))
+                .put("mykey", "myval")
+                .build();
+        
+        Map<String, Object> sanitized = Sanitizer.sanitize(ConfigBag.newInstance(map));
+        assertEquals(sanitized, expected);
+        
+        Map<String, Object> sanitized2 = Sanitizer.sanitize(map);
+        assertEquals(sanitized2, expected);
+    }
+    
+    @Test
+    public void testSanitizeWithNullKey() throws Exception {
+        MutableMap<?, ?> map = MutableMap.of(null, null);
+        Map<?, ?> sanitized = Sanitizer.sanitize(map);
+        assertEquals(sanitized, map);
+    }
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/290feb93/core/src/test/java/org/apache/brooklyn/core/entity/SanitizerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/entity/SanitizerTest.java b/core/src/test/java/org/apache/brooklyn/core/entity/SanitizerTest.java
deleted file mode 100644
index f63b40d..0000000
--- a/core/src/test/java/org/apache/brooklyn/core/entity/SanitizerTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.core.entity;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Map;
-
-import org.apache.brooklyn.core.config.Sanitizer;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Functions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-
-public class SanitizerTest {
-
-    @Test
-    public void testSanitize() throws Exception {
-        Map<String, Object> map = ImmutableMap.<String, Object>builder()
-                .put("PREFIX_password_SUFFIX", "pa55w0rd")
-                .put("PREFIX_PASSWORD_SUFFIX", "pa55w0rd")
-                .put("PREFIX_passwd_SUFFIX", "pa55w0rd")
-                .put("PREFIX_credential_SUFFIX", "pa55w0rd")
-                .put("PREFIX_secret_SUFFIX", "pa55w0rd")
-                .put("PREFIX_private_SUFFIX", "pa55w0rd")
-                .put("PREFIX_access.cert_SUFFIX", "myval")
-                .put("PREFIX_access.key_SUFFIX", "myval")
-                .put("mykey", "myval")
-                .build();
-        Map<String, Object> expected = MutableMap.<String, Object>builder()
-                .putAll(Maps.transformValues(map, Functions.constant("xxxxxxxx")))
-                .put("mykey", "myval")
-                .build();
-        
-        Map<String, Object> sanitized = Sanitizer.sanitize(ConfigBag.newInstance(map));
-        assertEquals(sanitized, expected);
-        
-        Map<String, Object> sanitized2 = Sanitizer.sanitize(map);
-        assertEquals(sanitized2, expected);
-    }
-    
-    @Test
-    public void testSanitizeWithNullKey() throws Exception {
-        MutableMap<?, ?> map = MutableMap.of(null, null);
-        Map<?, ?> sanitized = Sanitizer.sanitize(map);
-        assertEquals(sanitized, map);
-    }
-}


Mime
View raw message