You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2016/02/11 20:24:32 UTC

incubator-tamaya git commit: Added tests for filter module. Checked in missing files.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master d778cb814 -> 39ce361b7


Added tests for filter module.
Checked in missing files.


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

Branch: refs/heads/master
Commit: 39ce361b7b38cb8628455bc0ae58df32241f0941
Parents: d778cb8
Author: anatole <an...@apache.org>
Authored: Thu Feb 11 20:20:13 2016 +0100
Committer: anatole <an...@apache.org>
Committed: Thu Feb 11 20:20:13 2016 +0100

----------------------------------------------------------------------
 .../tamaya/filter/DefaultMetadataFilter.java    | 42 ---------------
 .../filter/internal/DefaultMetadataFilter.java  | 43 +++++++++++++++
 .../tamaya/filter/ConfigurationFilterTest.java  | 41 ++++++++++++++
 .../tamaya/filter/ProgrammableFilterTest.java   | 56 ++++++++++++++++++++
 .../tamaya/filter/RegexPropertyFilterTest.java  | 19 +++++++
 5 files changed, 159 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39ce361b/modules/filter/src/main/java/org/apache/tamaya/filter/DefaultMetadataFilter.java
----------------------------------------------------------------------
diff --git a/modules/filter/src/main/java/org/apache/tamaya/filter/DefaultMetadataFilter.java b/modules/filter/src/main/java/org/apache/tamaya/filter/DefaultMetadataFilter.java
deleted file mode 100644
index 389d9fa..0000000
--- a/modules/filter/src/main/java/org/apache/tamaya/filter/DefaultMetadataFilter.java
+++ /dev/null
@@ -1,42 +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.tamaya.filter;
-
-import org.apache.tamaya.spi.FilterContext;
-import org.apache.tamaya.spi.PropertyFilter;
-
-/**
- * Default property filter that hides metadta entries starting with an '_', similar ti {@code etcd}.
- */
-public final class DefaultMetadataFilter implements PropertyFilter{
-    @Override
-    public String filterProperty(String valueToBeFiltered, FilterContext context) {
-        if(context.isSinglePropertyScoped()){
-            // When accessing keys explicitly, do not hide anything.
-            return valueToBeFiltered;
-        }
-        if(ConfigurationFilter.THREADED_METADATA_FILTERED.get()) {
-            if (context.getKey().startsWith("_")) {
-                // Hide metadata entries.
-                return null;
-            }
-        }
-        return valueToBeFiltered;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39ce361b/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java
----------------------------------------------------------------------
diff --git a/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java b/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java
new file mode 100644
index 0000000..1119cba
--- /dev/null
+++ b/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java
@@ -0,0 +1,43 @@
+/*
+ * 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.tamaya.filter.internal;
+
+import org.apache.tamaya.filter.ConfigurationFilter;
+import org.apache.tamaya.spi.FilterContext;
+import org.apache.tamaya.spi.PropertyFilter;
+
+/**
+ * Default property filter that hides metadta entries starting with an '_', similar ti {@code etcd}.
+ */
+public final class DefaultMetadataFilter implements PropertyFilter{
+    @Override
+    public String filterProperty(String valueToBeFiltered, FilterContext context) {
+        if(context.isSinglePropertyScoped()){
+            // When accessing keys explicitly, do not hide anything.
+            return valueToBeFiltered;
+        }
+        if(ConfigurationFilter.THREADED_METADATA_FILTERED.get()) {
+            if (context.getKey().startsWith("_")) {
+                // Hide metadata entries.
+                return null;
+            }
+        }
+        return valueToBeFiltered;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39ce361b/modules/filter/src/test/java/org/apache/tamaya/filter/ConfigurationFilterTest.java
----------------------------------------------------------------------
diff --git a/modules/filter/src/test/java/org/apache/tamaya/filter/ConfigurationFilterTest.java b/modules/filter/src/test/java/org/apache/tamaya/filter/ConfigurationFilterTest.java
new file mode 100644
index 0000000..b4f3fa3
--- /dev/null
+++ b/modules/filter/src/test/java/org/apache/tamaya/filter/ConfigurationFilterTest.java
@@ -0,0 +1,41 @@
+package org.apache.tamaya.filter;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by atsticks on 11.02.16.
+ */
+public class ConfigurationFilterTest {
+
+    @Test
+    public void testIsMetadataFiltered() throws Exception {
+
+    }
+
+    @Test
+    public void testSetMetadataFiltered() throws Exception {
+
+    }
+
+    @Test
+    public void testGetSingleFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testGetMapFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testClearFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testFilterProperty() throws Exception {
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39ce361b/modules/filter/src/test/java/org/apache/tamaya/filter/ProgrammableFilterTest.java
----------------------------------------------------------------------
diff --git a/modules/filter/src/test/java/org/apache/tamaya/filter/ProgrammableFilterTest.java b/modules/filter/src/test/java/org/apache/tamaya/filter/ProgrammableFilterTest.java
new file mode 100644
index 0000000..0a30dc4
--- /dev/null
+++ b/modules/filter/src/test/java/org/apache/tamaya/filter/ProgrammableFilterTest.java
@@ -0,0 +1,56 @@
+package org.apache.tamaya.filter;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by atsticks on 11.02.16.
+ */
+public class ProgrammableFilterTest {
+
+    @Test
+    public void testAddFilter() throws Exception {
+
+    }
+
+    @Test
+    public void testAddFilter1() throws Exception {
+
+    }
+
+    @Test
+    public void testRemoveFilter() throws Exception {
+
+    }
+
+    @Test
+    public void testClearFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testSetFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testSetFilters1() throws Exception {
+
+    }
+
+    @Test
+    public void testGetFilters() throws Exception {
+
+    }
+
+    @Test
+    public void testFilterProperty() throws Exception {
+
+    }
+
+    @Test
+    public void testToString() throws Exception {
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39ce361b/modules/filter/src/test/java/org/apache/tamaya/filter/RegexPropertyFilterTest.java
----------------------------------------------------------------------
diff --git a/modules/filter/src/test/java/org/apache/tamaya/filter/RegexPropertyFilterTest.java b/modules/filter/src/test/java/org/apache/tamaya/filter/RegexPropertyFilterTest.java
new file mode 100644
index 0000000..7583a86
--- /dev/null
+++ b/modules/filter/src/test/java/org/apache/tamaya/filter/RegexPropertyFilterTest.java
@@ -0,0 +1,19 @@
+package org.apache.tamaya.filter;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by atsticks on 11.02.16.
+ */
+public class RegexPropertyFilterTest {
+
+    @org.junit.Test
+    public void testFilterProperty() throws Exception {
+
+    }
+
+    @org.junit.Test
+    public void testToString() throws Exception {
+
+    }
+}
\ No newline at end of file