You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2015/04/13 21:21:05 UTC

[1/6] incubator-tamaya git commit: TAMAYA-72 Added new IT to use it in conjunction with Tamaya Core.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master a0777c11f -> 7bc788c73


TAMAYA-72 Added new IT to use it in conjunction with Tamaya Core.


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

Branch: refs/heads/master
Commit: bffd9ea553db0bbaa309c886540ba2fa5d5ba425
Parents: a0777c1
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Fri Apr 3 17:48:53 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Fri Apr 3 17:48:53 2015 +0200

----------------------------------------------------------------------
 .../org/apache/tamaya/jodatime/FullStackIT.java | 47 ++++++++++++++++++++
 .../META-INF/javaconfiguration.properties       | 19 ++++++++
 2 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bffd9ea5/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/FullStackIT.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/FullStackIT.java b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/FullStackIT.java
new file mode 100644
index 0000000..f94489f
--- /dev/null
+++ b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/FullStackIT.java
@@ -0,0 +1,47 @@
+/*
+ * 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.jodatime;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.ConfigurationProvider;
+import org.joda.time.DateTime;
+import org.joda.time.format.ISODateTimeFormat;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.joda.time.format.ISODateTimeFormat.basicDateTime;
+import static org.joda.time.format.ISODateTimeFormat.dateTime;
+
+public class FullStackIT {
+    @Test
+    public void retrieveJodaTimeValuesFromConfiguration() {
+
+        Configuration configuration = ConfigurationProvider.getConfiguration();
+
+        String dateTimeString = configuration.get("dateTimeValue");
+        DateTime dateTimeValue = configuration.get("dateTimeValue", DateTime.class);
+
+        assertThat(dateTimeString, notNullValue());
+        assertThat(dateTimeString, equalTo("2010-08-08T14:00:15.5+10:00"));
+        assertThat(dateTimeValue, notNullValue());
+        assertThat(dateTimeValue, equalTo(dateTime().parseDateTime("2010-08-08T14:00:15.5+10:00")));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bffd9ea5/sandbox/jodatime/src/test/resources/META-INF/javaconfiguration.properties
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/resources/META-INF/javaconfiguration.properties b/sandbox/jodatime/src/test/resources/META-INF/javaconfiguration.properties
new file mode 100644
index 0000000..2a6ebaa
--- /dev/null
+++ b/sandbox/jodatime/src/test/resources/META-INF/javaconfiguration.properties
@@ -0,0 +1,19 @@
+# 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.
+
+# The space before the actual date is intended!
+dateTimeValue= 2010-08-08T14:00:15.5+10:00
\ No newline at end of file


[2/6] incubator-tamaya git commit: TAMAYA-72 Added converter for DateTimeZone

Posted by pl...@apache.org.
TAMAYA-72 Added converter for DateTimeZone


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

Branch: refs/heads/master
Commit: d42c5e75d58cc0a3727f506f7cb4101bd279d689
Parents: bffd9ea
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Apr 6 08:40:52 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Apr 6 08:40:52 2015 +0200

----------------------------------------------------------------------
 sandbox/jodatime/pom.xml                        |  1 +
 .../tamaya/jodatime/DateTimeZoneConverter.java  | 57 ++++++++++++++++++++
 .../tamaya/jodatime/DateTimeConverterTest.java  |  6 +--
 .../jodatime/DateTimeZoneConverterTest.java     | 57 ++++++++++++++++++++
 4 files changed, 116 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d42c5e75/sandbox/jodatime/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/pom.xml b/sandbox/jodatime/pom.xml
index c6a729a..08448ab 100644
--- a/sandbox/jodatime/pom.xml
+++ b/sandbox/jodatime/pom.xml
@@ -30,6 +30,7 @@ under the License.
     </parent>
 
     <artifactId>tamaya-jodatime</artifactId>
+    <name>Apache Tamaya Joda-Time Support</name>
 
     <inceptionYear>2015</inceptionYear>
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d42c5e75/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
new file mode 100644
index 0000000..09daebb
--- /dev/null
+++ b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
@@ -0,0 +1,57 @@
+/*
+ * 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.jodatime;
+
+import org.apache.tamaya.PropertyConverter;
+import org.joda.time.DateTimeZone;
+
+import java.util.regex.Pattern;
+
+import static java.util.Objects.requireNonNull;
+
+public class DateTimeZoneConverter implements PropertyConverter<DateTimeZone> {
+    private static final Pattern IS_INTEGER_VALUE = Pattern.compile("(\\+|-)?\\d+");
+
+    @Override
+    public DateTimeZone convert(String value) {
+        String trimmed = requireNonNull(value).trim();
+
+        DateTimeZone result = null;
+
+        try {
+            if (isSingleIntegerValue(trimmed)) {
+                int offset = Integer.parseInt(trimmed);
+                result = DateTimeZone.forOffsetHours(offset);
+            } else { // Let us assume a string id
+                result = DateTimeZone.forID(trimmed);
+            }
+
+        } catch (Exception e) {
+            result = null; // Give the next converter a change. Read the JavaDoc of convert
+        }
+
+        return result;
+    }
+
+    private boolean isSingleIntegerValue(String value) {
+        boolean match = IS_INTEGER_VALUE.matcher(value).matches();
+
+        return match;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d42c5e75/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterTest.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterTest.java b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterTest.java
index 084a202..6a1803a 100644
--- a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterTest.java
+++ b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterTest.java
@@ -73,11 +73,7 @@ public class DateTimeConverterTest {
     @Test
     public void invalidInputValuesResultInReturningNull() {
         String[] inputValues = {
-             "2007-08-01T12:34:45.000+0:0",
-             "2007-08-01T12:34:45.000+00:0",
-             "2007-08-01T12:34:45.000+00:0",
-             "2007-08-01T+00:00",
-             "2007-08-01+00:00"
+             "00:00", "a", "-", "+ :00", "+00:"
         };
 
         for (String input : inputValues) {

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/d42c5e75/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterTest.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterTest.java b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterTest.java
index 8a083b8..0077c25 100644
--- a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterTest.java
+++ b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterTest.java
@@ -18,5 +18,62 @@
  */
 package org.apache.tamaya.jodatime;
 
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
 public class DateTimeZoneConverterTest {
+    private DateTimeZoneConverter converter = new DateTimeZoneConverter();
+
+    @Test
+    public void canConvertDateTimeZoneInformation() {
+        Object[][] inputResultPairs = {
+             // Valid input for DateTimeZone.forOffsetHours
+             {"1", DateTimeZone.forOffsetHours(1)},
+             {"12", DateTimeZone.forOffsetHours(12)},
+             {"13", DateTimeZone.forOffsetHours(13)},
+             {"0", DateTimeZone.forOffsetHours(0)},
+             {"-1 ", DateTimeZone.forOffsetHours(-1)},
+
+             // Valid input for DateTimeZone.forID()
+             {"Chile/EasterIsland", DateTimeZone.forID("Chile/EasterIsland")},
+             {"UTC", DateTimeZone.forID("UTC")},
+             {"+00", DateTimeZone.forID("+00:00")},
+             {"+00:00", DateTimeZone.forID("+00:00")},
+             {"+00:00 ", DateTimeZone.forID("+00:00")},
+             {" +00:00 ", DateTimeZone.forID("+00:00")},
+             {"+04:00", DateTimeZone.forID("+04:00")},
+        };
+
+        for (Object[] pair : inputResultPairs) {
+            DateTimeZone zone = converter.convert((String) pair[0]);
+
+            assertThat("Converter failed to convert input value " + pair[0], zone, notNullValue());
+            assertThat(zone, equalTo((DateTimeZone)pair[1]));
+        }
+    }
+
+    @Test
+    public void invalidInputValuesResultInReturningNull() {
+        String[] inputValues = {
+             "2007-08-01T12:34:45.000+0:0",
+             "2007-08-01T12:34:45.000+00:0",
+             "2007-08-01T12:34:45.000+00:0",
+             "2007-08-01T+00:00",
+             "2007-08-01+00:00"
+        };
+
+        for (String input : inputValues) {
+            DateTimeZone date = converter.convert(input);
+
+            assertThat(date, nullValue());
+        }
+    }
 }


[3/6] incubator-tamaya git commit: TAMAYA-72 Exception handling adjusted

Posted by pl...@apache.org.
TAMAYA-72 Exception handling adjusted


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

Branch: refs/heads/master
Commit: 54d216ee90c5bf434576b6227d85a189ad128887
Parents: d42c5e7
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Apr 6 18:13:54 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Apr 6 18:13:54 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/tamaya/jodatime/DateTimeConverter.java    | 2 +-
 .../java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54d216ee/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
index 0063aa5..03c28e5 100644
--- a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
+++ b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
@@ -61,7 +61,7 @@ public class DateTimeConverter implements PropertyConverter<DateTime> {
 
         try {
             result = formatter.parseDateTime(trimmed);
-        } catch (IllegalArgumentException e) {
+        } catch (RuntimeException e) {
             // Ok, go on and try the next parser
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54d216ee/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
index 09daebb..ccdf175 100644
--- a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
+++ b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeZoneConverter.java
@@ -42,7 +42,7 @@ public class DateTimeZoneConverter implements PropertyConverter<DateTimeZone> {
                 result = DateTimeZone.forID(trimmed);
             }
 
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             result = null; // Give the next converter a change. Read the JavaDoc of convert
         }
 


[4/6] incubator-tamaya git commit: TAMAYA-72 Added tests. DateTimeZoneConverter is now available via SPI

Posted by pl...@apache.org.
TAMAYA-72 Added tests. DateTimeZoneConverter is now available via SPI


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

Branch: refs/heads/master
Commit: e208507f9627cf701c8bfcf8da24d104498f2572
Parents: 54d216e
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Apr 6 18:14:39 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Apr 6 18:14:39 2015 +0200

----------------------------------------------------------------------
 .../org.apache.tamaya.PropertyConverter         |  3 +-
 .../tamaya/jodatime/DateTimeConverterIT.java    |  3 +-
 .../jodatime/DateTimeZoneConverterIT.java       | 46 ++++++++++++++++++++
 3 files changed, 49 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e208507f/sandbox/jodatime/src/main/resources/META-INF/services/org.apache.tamaya.PropertyConverter
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/main/resources/META-INF/services/org.apache.tamaya.PropertyConverter b/sandbox/jodatime/src/main/resources/META-INF/services/org.apache.tamaya.PropertyConverter
index ecf8bc7..e182a4c 100644
--- a/sandbox/jodatime/src/main/resources/META-INF/services/org.apache.tamaya.PropertyConverter
+++ b/sandbox/jodatime/src/main/resources/META-INF/services/org.apache.tamaya.PropertyConverter
@@ -16,4 +16,5 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-org.apache.tamaya.jodatime.DateTimeConverter
\ No newline at end of file
+org.apache.tamaya.jodatime.DateTimeConverter
+org.apache.tamaya.jodatime.DateTimeZoneConverter
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e208507f/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterIT.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterIT.java b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterIT.java
index d99a8d6..75d4ca5 100644
--- a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterIT.java
+++ b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeConverterIT.java
@@ -36,12 +36,11 @@ public class DateTimeConverterIT {
                                                         .getServices(PropertyConverter.class);
 
         PropertyConverter converter = formats.stream()
-                                             .filter(s -> s instanceof PropertyConverter)
+                                             .filter(s -> s instanceof DateTimeConverter)
                                              .findFirst().get();
 
         assertThat("Converter not found via service context.", converter, notNullValue());
         assertThat(converter, instanceOf(DateTimeConverter.class));
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e208507f/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterIT.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterIT.java b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterIT.java
new file mode 100644
index 0000000..72bc4e4
--- /dev/null
+++ b/sandbox/jodatime/src/test/java/org/apache/tamaya/jodatime/DateTimeZoneConverterIT.java
@@ -0,0 +1,46 @@
+/*
+ * 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.jodatime;
+
+
+import org.apache.tamaya.PropertyConverter;
+import org.apache.tamaya.spi.ServiceContext;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.notNullValue;
+
+public class DateTimeZoneConverterIT {
+    @Test
+    public void bla() {
+        List<PropertyConverter> formats = ServiceContext.getInstance()
+                                                        .getServices(PropertyConverter.class);
+
+        PropertyConverter converter = formats.stream()
+                                             .filter(s -> s instanceof DateTimeZoneConverter)
+                                             .findFirst().get();
+
+        assertThat("Converter not found via service context.", converter, notNullValue());
+        assertThat(converter, instanceOf(DateTimeZoneConverter.class));
+    }
+
+}


[6/6] incubator-tamaya git commit: TAMAYA-18 First integration of jQAssistant.

Posted by pl...@apache.org.
TAMAYA-18 First integration of jQAssistant.


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

Branch: refs/heads/master
Commit: 7bc788c7318c587b4a6f3a07106b2cbf940d12d8
Parents: 7b55b5c
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Apr 13 21:20:45 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Apr 13 21:20:45 2015 +0200

----------------------------------------------------------------------
 bin/jqa-server.sh       |  4 ++++
 jqassistant/default.xml | 41 +++++++++++++++++++++++++++++++++++++++++
 jqassistant/readme.md   |  8 ++++++++
 pom.xml                 | 31 +++++++++++++++++++++++++++++++
 4 files changed, 84 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/7bc788c7/bin/jqa-server.sh
----------------------------------------------------------------------
diff --git a/bin/jqa-server.sh b/bin/jqa-server.sh
new file mode 100755
index 0000000..78c4c9a
--- /dev/null
+++ b/bin/jqa-server.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+mvn -P sandbox \
+    com.buschmais.jqassistant.scm:jqassistant-maven-plugin:server

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/7bc788c7/jqassistant/default.xml
----------------------------------------------------------------------
diff --git a/jqassistant/default.xml b/jqassistant/default.xml
new file mode 100644
index 0000000..854f4ff
--- /dev/null
+++ b/jqassistant/default.xml
@@ -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.
+-->
+<jqa:jqassistant-rules xmlns:jqa="http://www.buschmais.com/jqassistant/core/analysis/rules/schema/v1.0">
+
+    <constraint id="naming:namingOfPropertyConverters">
+        <requiresConcept refId="java:AnonymousInnerType" />
+        <description>Class name of implementations of PropertyConverter must end with 'Converter'</description>
+        <cypher><![CDATA[
+        MATCH
+            (t:Type)-[:IMPLEMENTS*]->(i:Type)
+
+        WHERE
+            i.fqn='org.apache.tamaya.PropertyConverter'
+            AND NOT t:Anonymous:Inner
+            AND NOT t.name =~ '.*Converter'
+
+        RETURN
+            t.fqn
+        ]]></cypher>
+    </constraint>
+
+    <group id="default">
+        <includeConstraint refId="naming:namingOfPropertyConverters"/>
+    </group>
+</jqa:jqassistant-rules>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/7bc788c7/jqassistant/readme.md
----------------------------------------------------------------------
diff --git a/jqassistant/readme.md b/jqassistant/readme.md
new file mode 100644
index 0000000..5e67ec5
--- /dev/null
+++ b/jqassistant/readme.md
@@ -0,0 +1,8 @@
+# Rules for jQAssistant
+
+This directory contains the rules for 
+jQAssitant. A tool used by Tamaya to
+ensure some contraints on our project.
+
+You can learn more on jQAssitant at http://jqassistant.org/
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/7bc788c7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 38125df..8d97318 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,6 +57,7 @@ under the License.
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <jackson.version>2.5.1</jackson.version>
         <junit.version>4.12</junit.version>
+        <jqassistant.version>1.0.0-RC1</jqassistant.version>
 
         <!-- Dependency and plugin relate version properties go here -->
         <arquillian.version>1.1.7.Final</arquillian.version>
@@ -472,12 +473,41 @@ under the License.
                     <version>3.3</version>
                     <inherited>true</inherited>
                 </plugin>
+                <plugin>
+                    <groupId>com.buschmais.jqassistant.scm</groupId>
+                    <artifactId>jqassistant-maven-plugin</artifactId>
+                    <version>${jqassistant.version}</version>
+                    <executions>
+                        <execution>
+                            <id>scan</id>
+                            <goals>
+                                <goal>scan</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <id>analyze</id>
+                            <goals>
+                                <goal>analyze</goal>
+                            </goals>
+                            <configuration>
+                                <!-- @todo Enable after 1.0.0-RC2 -->
+                                <failOnViolations>true</failOnViolations>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+
             </plugins>
         </pluginManagement>
 
 
         <plugins>
             <plugin>
+                <groupId>com.buschmais.jqassistant.scm</groupId>
+                <artifactId>jqassistant-maven-plugin</artifactId>
+            </plugin>
+
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>findbugs-maven-plugin</artifactId>
             </plugin>
@@ -648,6 +678,7 @@ under the License.
                 <checkstyle.skip>true</checkstyle.skip>
                 <findbugs.skip>true</findbugs.skip>
                 <rat.skip>true</rat.skip>
+                <jqassistant.skip>true</jqassistant.skip>
             </properties>
         </profile>
 


[5/6] incubator-tamaya git commit: TAMAYA-72 Added JavaDoc

Posted by pl...@apache.org.
TAMAYA-72 Added JavaDoc


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

Branch: refs/heads/master
Commit: 7b55b5c54f9e793b2d865aa99925499de279815d
Parents: e208507
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Mon Apr 6 20:24:47 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Mon Apr 6 20:24:47 2015 +0200

----------------------------------------------------------------------
 .../apache/tamaya/jodatime/DateTimeConverter.java | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/7b55b5c5/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
----------------------------------------------------------------------
diff --git a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
index 03c28e5..6912108 100644
--- a/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
+++ b/sandbox/jodatime/src/main/java/org/apache/tamaya/jodatime/DateTimeConverter.java
@@ -27,6 +27,24 @@ import org.joda.time.format.DateTimeParser;
 
 import java.util.Objects;
 
+/**
+ * Converter, converting from {@code String} to Joda-Time's
+ * {@code DateTime}.
+ *
+ * The converter supports the following formats for the provided
+ * time information:
+ *
+ * <ul>
+ *     <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSZ}</li>
+ *     <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSz}</li>
+ *     <li>{@code yyyy-MM-dd'T'HH:mm:ssZ}</li>
+ *     <li>{@code yyyy-MM-dd'T'HH:mm:ssz}</li>
+ *     <li>{@code yyyy-MM-dd'T'HH:mmZ}</li>
+ *     <li>{@code yyyy-MM-dd'T'HH:mmz}</li>
+ *     <li>{@code yyyy-MM-dd'T'HHZ}</li>
+ *     <li>{@code yyyy-MM-dd'T'HHz}</li>
+ * </ul>
+ */
 public class DateTimeConverter implements PropertyConverter<DateTime> {
     // The DateTimeFormatter returned by ISODateTimeFormat are thread safe
     // according to the JavaDoc of JodaTime