You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2018/05/03 10:41:41 UTC

[sling-org-apache-sling-dynamic-include] branch master updated (c07d0dd -> cddb34b)

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git.


    from c07d0dd  Merge pull request #3 from mkrokosinski/master
     new 5b02279  SLING-7621 - minor tweaks and add missing license headers
     new d7e772f  SLING-7621 - set package versions explicitly
     new cddb34b  SLING-7621 - add missing tests

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  2 +-
 .../apache/sling/dynamicinclude/Configuration.java |  4 ++--
 .../{IncludeGenerator.java => package-info.java}   | 13 +++--------
 .../package-info.java}                             | 15 ++++--------
 .../IncludeGenerator.java => package-info.java}    | 15 ++++--------
 .../dynamicinclude/pathmatcher/PathMatcher.java    | 18 +++++++++++++++
 .../pathmatcher/PrefixPathMatcher.java             | 18 +++++++++++++++
 .../pathmatcher/RegexPathMatcher.java              | 18 +++++++++++++++
 .../package-info.java}                             | 15 ++++--------
 .../sling/dynamicinclude/ConfigurationTest.java    | 20 +++++++++++++++-
 .../ConfigurationWhiteboardTest.java               | 19 ++++++++++++++-
 .../pathmatcher/PrefixPathMatcherTest.java}        | 27 ++++++++++++++++------
 .../pathmatcher/RegexPathMatcherTest.java}         | 26 +++++++++++++++------
 13 files changed, 148 insertions(+), 62 deletions(-)
 copy src/main/java/org/apache/sling/dynamicinclude/generator/{IncludeGenerator.java => package-info.java} (85%)
 mode change 100755 => 100644
 copy src/main/java/org/apache/sling/dynamicinclude/generator/{IncludeGenerator.java => types/package-info.java} (80%)
 mode change 100755 => 100644
 copy src/main/java/org/apache/sling/dynamicinclude/{generator/IncludeGenerator.java => package-info.java} (80%)
 mode change 100755 => 100644
 copy src/main/java/org/apache/sling/dynamicinclude/{generator/IncludeGenerator.java => pathmatcher/package-info.java} (80%)
 mode change 100755 => 100644
 copy src/{main/java/org/apache/sling/dynamicinclude/generator/IncludeGenerator.java => test/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcherTest.java} (57%)
 mode change 100755 => 100644
 copy src/{main/java/org/apache/sling/dynamicinclude/generator/IncludeGenerator.java => test/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcherTest.java} (59%)
 mode change 100755 => 100644

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.

[sling-org-apache-sling-dynamic-include] 03/03: SLING-7621 - add missing tests

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit cddb34b03356a1e30625a364843d0b7c1be092f1
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu May 3 12:41:22 2018 +0200

    SLING-7621 - add missing tests
---
 .../pathmatcher/PrefixPathMatcherTest.java         | 42 ++++++++++++++++++++++
 .../pathmatcher/RegexPathMatcherTest.java          | 41 +++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcherTest.java b/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcherTest.java
new file mode 100644
index 0000000..df45d38
--- /dev/null
+++ b/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcherTest.java
@@ -0,0 +1,42 @@
+/*-
+ * 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.sling.dynamicinclude.pathmatcher;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+public class PrefixPathMatcherTest {
+    private final PrefixPathMatcher ppm = new PrefixPathMatcher("/foo");
+
+    @Test
+    public void testMatch() {
+        assertTrue(ppm.match("/foo"));
+        assertTrue(ppm.match("/foobar"));
+    }
+
+    @Test
+    public void testNoMatch() {
+        assertFalse(ppm.match("/barbar"));
+        assertFalse(ppm.match("/bar/foo"));
+        assertFalse(ppm.match(""));
+        assertFalse(ppm.match(null));
+    }
+}
diff --git a/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcherTest.java b/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcherTest.java
new file mode 100644
index 0000000..34484f0
--- /dev/null
+++ b/src/test/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcherTest.java
@@ -0,0 +1,41 @@
+/*-
+ * 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.sling.dynamicinclude.pathmatcher;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+public class RegexPathMatcherTest {
+    private final RegexPathMatcher rpm = new RegexPathMatcher("^/[fg]oo");
+
+    @Test
+    public void testMatch() {
+        assertTrue(rpm.match("/foo"));
+        assertTrue(rpm.match("/goo"));
+    }
+
+    @Test
+    public void testNoMatch() {
+        assertFalse(rpm.match("/foobar"));
+        assertFalse(rpm.match(""));
+        assertFalse(rpm.match(null));
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.

[sling-org-apache-sling-dynamic-include] 02/03: SLING-7621 - set package versions explicitly

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit d7e772f30163890e57451e7ecad9ebf3824a097d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu May 3 12:30:23 2018 +0200

    SLING-7621 - set package versions explicitly
---
 .../dynamicinclude/generator/package-info.java     | 22 ++++++++++++++++++++++
 .../generator/types/package-info.java              | 22 ++++++++++++++++++++++
 .../apache/sling/dynamicinclude/package-info.java  | 22 ++++++++++++++++++++++
 .../dynamicinclude/pathmatcher/package-info.java   | 22 ++++++++++++++++++++++
 4 files changed, 88 insertions(+)

diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
new file mode 100644
index 0000000..91d2fc9
--- /dev/null
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("3.0.0")
+package org.apache.sling.dynamicinclude.generator;
+import aQute.bnd.annotation.Version;
+
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
new file mode 100644
index 0000000..2ffbf94
--- /dev/null
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("3.0.0")
+package org.apache.sling.dynamicinclude.generator.types;
+import aQute.bnd.annotation.Version;
+
diff --git a/src/main/java/org/apache/sling/dynamicinclude/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
new file mode 100644
index 0000000..6eed06e
--- /dev/null
+++ b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("4.0.0")
+package org.apache.sling.dynamicinclude;
+import aQute.bnd.annotation.Version;
+
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
new file mode 100644
index 0000000..1eb7026
--- /dev/null
+++ b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+@Version("3.0.0")
+package org.apache.sling.dynamicinclude.pathmatcher;
+import aQute.bnd.annotation.Version;
+

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.

[sling-org-apache-sling-dynamic-include] 01/03: SLING-7621 - minor tweaks and add missing license headers

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit 5b022797a9cfcb3652ac690f21e3db3c75e1b21b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu May 3 12:23:07 2018 +0200

    SLING-7621 - minor tweaks and add missing license headers
---
 pom.xml                                              |  2 +-
 .../apache/sling/dynamicinclude/Configuration.java   |  4 ++--
 .../dynamicinclude/pathmatcher/PathMatcher.java      | 18 ++++++++++++++++++
 .../pathmatcher/PrefixPathMatcher.java               | 18 ++++++++++++++++++
 .../dynamicinclude/pathmatcher/RegexPathMatcher.java | 18 ++++++++++++++++++
 .../sling/dynamicinclude/ConfigurationTest.java      | 20 +++++++++++++++++++-
 .../dynamicinclude/ConfigurationWhiteboardTest.java  | 19 ++++++++++++++++++-
 7 files changed, 94 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6743856..bd61c0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
     </parent>    
     
     <artifactId>org.apache.sling.dynamic-include</artifactId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.0.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
     
     <name>Apache Sling Dynamic Include</name>
diff --git a/src/main/java/org/apache/sling/dynamicinclude/Configuration.java b/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
index 2aedebe..f3b80a9 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
@@ -146,10 +146,10 @@ public class Configuration {
   private PathMatcher choosePathMatcher(String pathPattern) {
     PathMatcher result;
     if (pathPattern.startsWith("^")) {
-      LOG.debug("Configured path value: {} is a regex experession. Picking RegexPathMatcher.", pathPattern);
+      LOG.debug("Configured path value: {} is a regexp - will use a RegexPathMatcher.", pathPattern);
       result = new RegexPathMatcher(pathPattern);
     } else {
-      LOG.debug("Configured path value: {} is not a regex experession. Picking PrefixPathMatcher.", pathPattern);
+      LOG.debug("Configured path value: {} is NOT a regexp - will use a PrefixPathMatcher.", pathPattern);
       result = new PrefixPathMatcher(pathPattern);
     }
     return result;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PathMatcher.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PathMatcher.java
index 9688e03..59a69cc 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PathMatcher.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PathMatcher.java
@@ -1,3 +1,21 @@
+/*-
+ * 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.sling.dynamicinclude.pathmatcher;
 
 public interface PathMatcher {
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcher.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcher.java
index 315d101..cdd1077 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcher.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/PrefixPathMatcher.java
@@ -1,3 +1,21 @@
+/*-
+ * 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.sling.dynamicinclude.pathmatcher;
 
 import org.apache.commons.lang.StringUtils;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcher.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcher.java
index f82a4b7..e52008b 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcher.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/RegexPathMatcher.java
@@ -1,3 +1,21 @@
+/*-
+ * 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.sling.dynamicinclude.pathmatcher;
 
 import java.util.regex.Pattern;
diff --git a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
index 9bdfda3..d430458 100644
--- a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
+++ b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
@@ -1,5 +1,23 @@
-package org.apache.sling.dynamicinclude;
+/*-
+ * 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.sling.dynamicinclude;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
diff --git a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
index 3208456..c32e4d9 100644
--- a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
+++ b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
@@ -1,3 +1,21 @@
+/*-
+ * 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.sling.dynamicinclude;
 
 import static org.apache.sling.dynamicinclude.Configuration.PROPERTY_FILTER_ENABLED;
@@ -10,7 +28,6 @@ import static org.mockito.Mockito.when;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.regex.PatternSyntaxException;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestPathInfo;
 import org.junit.Before;

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.