You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2017/07/19 07:04:10 UTC

svn commit: r1802359 - in /turbine/fulcrum/trunk/json: ./ api/ dist/ dist/src/assembly/ gson/ jackson/ jackson2/ jackson2/src/test/org/apache/fulcrum/json/jackson/

Author: gk
Date: Wed Jul 19 07:04:10 2017
New Revision: 1802359

URL: http://svn.apache.org/viewvc?rev=1802359&view=rev
Log:
- reverted release prepare 
- add statement json.org to NOTICE
- update test 
- add parent to dist assembly and rename


Added:
    turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml   (with props)
Removed:
    turbine/fulcrum/trunk/json/dist/src/assembly/dist.xml
Modified:
    turbine/fulcrum/trunk/json/NOTICE
    turbine/fulcrum/trunk/json/api/pom.xml
    turbine/fulcrum/trunk/json/dist/pom.xml
    turbine/fulcrum/trunk/json/dist/src/assembly/src.xml
    turbine/fulcrum/trunk/json/gson/   (props changed)
    turbine/fulcrum/trunk/json/gson/pom.xml
    turbine/fulcrum/trunk/json/jackson/pom.xml
    turbine/fulcrum/trunk/json/jackson2/pom.xml
    turbine/fulcrum/trunk/json/jackson2/src/test/org/apache/fulcrum/json/jackson/JacksonMapperEnabledDefaultTyping_OBJECT_AND_NON_CONCRETE_Test.java
    turbine/fulcrum/trunk/json/pom.xml

Modified: turbine/fulcrum/trunk/json/NOTICE
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/NOTICE?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/NOTICE (original)
+++ turbine/fulcrum/trunk/json/NOTICE Wed Jul 19 07:04:10 2017
@@ -3,3 +3,9 @@ Copyright 2005-2016 The Apache Software
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
+
+No JSON-licensed (org.json) license is included, not even optionally or transitively.
+
+Details: 
+The Fulcrum Json Jackson Module version 1.1.1 includes the optional dependency com.fasterxml.jackson.datatype:jackson-datatype-json-org:2.6.6. 
+This artifact supports since version 2.4.0 the Apache 2.0 licensed artifact org.apache.geronimo.bundles:json:20090211_1 (org.json wrapper). Unless you override the defaults or use a version before version 2.4.0 only this may become a transitive dependency (cft. https://github.com/FasterXML/jackson-datatype-json-org).
\ No newline at end of file

Modified: turbine/fulcrum/trunk/json/api/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/api/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/api/pom.xml (original)
+++ turbine/fulcrum/trunk/json/api/pom.xml Wed Jul 19 07:04:10 2017
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>fulcrum-json-parent</artifactId>
         <groupId>org.apache.fulcrum</groupId>
-        <version>1.1.2-SNAPSHOT</version>
+        <version>1.1.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

Modified: turbine/fulcrum/trunk/json/dist/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/dist/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/dist/pom.xml (original)
+++ turbine/fulcrum/trunk/json/dist/pom.xml Wed Jul 19 07:04:10 2017
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.fulcrum</groupId>
     <artifactId>fulcrum-json-parent</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.1-SNAPSHOT</version>
   </parent>
   <groupId>org.apache.fulcrum</groupId>
   <artifactId>fulcrum-json-dist</artifactId>
@@ -60,31 +60,34 @@
   <build>
     <plugins>
       <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>jar-dist-assembly</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <descriptors>
-                <!-- binaries -->
-                <descriptor>src/assembly/dist.xml</descriptor>
-                <!-- sources -->
-                <descriptor>src/assembly/src.xml</descriptor>
-              </descriptors>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <artifactId>maven-site-plugin</artifactId>
         <configuration> 
           <skip>true</skip>
         </configuration>
       </plugin>
+      <plugin>
+        <!-- build the source and binary distribution packages -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+            <execution>
+                <id>fulcrum-release-assembly</id>
+                <phase>package</phase>
+                <goals>
+                    <goal>single</goal>
+                </goals>
+                <configuration>
+                    <runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
+                    <descriptors>
+                      <descriptor>src/assembly/bin.xml</descriptor>
+                      <descriptor>src/assembly/src.xml</descriptor>
+                    </descriptors>
+                    <tarLongFileFormat>gnu</tarLongFileFormat>
+                </configuration>
+            </execution>
+        </executions>
+    </plugin>
     </plugins>
   </build>
+
 </project>
\ No newline at end of file

Added: turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml?rev=1802359&view=auto
==============================================================================
--- turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml (added)
+++ turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml Wed Jul 19 07:04:10 2017
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>bin</id>
+  <formats>
+    <format>tar.gz</format>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <dependencySets>
+    <dependencySet>
+      <includes>
+        <include>org.apache.fulcrum:fulcrum-json-*:jar:*</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+  <!--moduleSets>
+    <moduleSet>
+      <useAllReactorProjects>true</useAllReactorProjects>
+      <binaries>
+        <outputDirectory>/</outputDirectory>
+        <unpack>false</unpack>
+      </binaries>
+    </moduleSet>
+  </moduleSets-->
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
+      <outputDirectory>/</outputDirectory>
+      <includes>
+        <include>LICENSE*</include>
+        <include>NOTICE*</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
\ No newline at end of file

Propchange: turbine/fulcrum/trunk/json/dist/src/assembly/bin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: turbine/fulcrum/trunk/json/dist/src/assembly/src.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/dist/src/assembly/src.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/dist/src/assembly/src.xml (original)
+++ turbine/fulcrum/trunk/json/dist/src/assembly/src.xml Wed Jul 19 07:04:10 2017
@@ -17,10 +17,10 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" 
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-  <id>modules-src</id>
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+  <id>src</id>
   <formats>
     <format>tar.gz</format>
     <format>zip</format>
@@ -29,15 +29,19 @@
   <moduleSets>
     <moduleSet>
       <useAllReactorProjects>true</useAllReactorProjects>
-      <excludes>
+      <!--excludes>
          <exclude>org.apache.fulcrum:fulcrum-json-dist</exclude>
-     </excludes>
+     </excludes-->
       <sources>
+        <outputDirectoryMapping>${module.basedir.name}</outputDirectoryMapping>
         <fileSets>
           <fileSet>
             <excludes>
               <exclude>*.releaseBackup</exclude>
               <exclude>target/**</exclude>
+              <exclude>.classpath</exclude>
+              <exclude>.project</exclude>
+             <exclude>*.iml</exclude>
             </excludes>
           </fileSet>
         </fileSets>
@@ -53,11 +57,14 @@
         <include>NOTICE*</include>
       </includes>
     </fileSet>
-     <fileSet>
-      <directory>${basedir}</directory>
-      <outputDirectory>/</outputDirectory>
+    <fileSet>
+      <directory>${project.parent.basedir}</directory>
+      <outputDirectory></outputDirectory>
       <includes>
+        <include>README*</include>
         <include>pom.xml</include>
+        <include>src/**</include>
+        <include>xdocs/**</include>
       </includes>
     </fileSet>
   </fileSets>

Propchange: turbine/fulcrum/trunk/json/gson/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jul 19 07:04:10 2017
@@ -1,7 +1,5 @@
-target
-
+.classpath
+.idea
 .project
-
 .settings
-
-.classpath
+target

Modified: turbine/fulcrum/trunk/json/gson/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/gson/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/gson/pom.xml (original)
+++ turbine/fulcrum/trunk/json/gson/pom.xml Wed Jul 19 07:04:10 2017
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>fulcrum-json-parent</artifactId>
         <groupId>org.apache.fulcrum</groupId>
-        <version>1.1.2-SNAPSHOT</version>
+        <version>1.1.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

Modified: turbine/fulcrum/trunk/json/jackson/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/jackson/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/jackson/pom.xml (original)
+++ turbine/fulcrum/trunk/json/jackson/pom.xml Wed Jul 19 07:04:10 2017
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>fulcrum-json-parent</artifactId>
         <groupId>org.apache.fulcrum</groupId>
-        <version>1.1.2-SNAPSHOT</version>
+        <version>1.1.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

Modified: turbine/fulcrum/trunk/json/jackson2/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/jackson2/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/jackson2/pom.xml (original)
+++ turbine/fulcrum/trunk/json/jackson2/pom.xml Wed Jul 19 07:04:10 2017
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>fulcrum-json-parent</artifactId>
         <groupId>org.apache.fulcrum</groupId>
-        <version>1.1.2-SNAPSHOT</version>
+        <version>1.1.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

Modified: turbine/fulcrum/trunk/json/jackson2/src/test/org/apache/fulcrum/json/jackson/JacksonMapperEnabledDefaultTyping_OBJECT_AND_NON_CONCRETE_Test.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/jackson2/src/test/org/apache/fulcrum/json/jackson/JacksonMapperEnabledDefaultTyping_OBJECT_AND_NON_CONCRETE_Test.java?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/jackson2/src/test/org/apache/fulcrum/json/jackson/JacksonMapperEnabledDefaultTyping_OBJECT_AND_NON_CONCRETE_Test.java (original)
+++ turbine/fulcrum/trunk/json/jackson2/src/test/org/apache/fulcrum/json/jackson/JacksonMapperEnabledDefaultTyping_OBJECT_AND_NON_CONCRETE_Test.java Wed Jul 19 07:04:10 2017
@@ -22,6 +22,7 @@ package org.apache.fulcrum.json.jackson;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -89,27 +90,64 @@ public class JacksonMapperEnabledDefault
                 "Serialize with Adapater failed ",
                 serJson.matches(".*\"java.util.Date\",\"\\d\\d/\\d\\d/\\d{4}\".*"));
     }
+    //  no day time
     @Test
     public void testDeSerializeDate() throws Exception {
         Map<String, Date> map = new HashMap<String, Date>();
-        map.put("mydate",Calendar.getInstance().getTime());
-        Calendar mydate2 = Calendar.getInstance();
-        mydate2.set(1999, 3, 10);
-        mydate2.setTimeZone(TimeZone.getTimeZone("CEST"));
-        map.put("mydate2",mydate2.getTime());
+        Calendar sourceDate = Calendar.getInstance();
+        sourceDate.set(1999, 3, 10);
+        sourceDate.set(Calendar.HOUR, 0);
+        sourceDate.set(Calendar.MINUTE, 0);
+        sourceDate.set(Calendar.SECOND, 0);
+        sourceDate.set(Calendar.MILLISECOND, 0);
+        sourceDate.set(Calendar.HOUR_OF_DAY, 0);
+        logger.debug("sourceDate TZ:"+ sourceDate.getTimeZone().getID());
+//        logger.debug("sourceDate calendar:"+ sourceDate);
+        logger.debug("sourceDate date:"+ sourceDate.getTime());
+        logger.debug("sourceDate millisec:"+ sourceDate.getTime().getTime());
+        map.put("mydate",sourceDate.getTime());
+        // default dateformat dd/mm/yy -> day time will be cut off !(hh, mm,)
         String serJson0 =  sc.ser(map, false);
         String serJson =  sc.ser(map, Map.class, false);
+        
         logger.debug("serJson:"+ serJson0);
         assertEquals(serJson0, serJson);
-        //sc.addAdapter("Collection Adapter", Object.class, DateKeyMixin.class);
+        
         DateKeyMixin serObject =sc.deSer(serJson0, DateKeyMixin.class);
-//        System.out.println("serObject:"+ serObject);
-//        System.out.println("serObject:"+ serObject.mydate.getClass());
         assertTrue(serObject.mydate instanceof Date);
-        assertTrue(serObject.mydate2 instanceof Date);
-        assertTrue(serObject.mydate2.toString().equals("Sat Apr 10 00:00:00 CEST 1999"));
-//        System.out.println("serObject:"+ ((Date)serObject.mydate));
-//        System.out.println("serObject:"+ ((Date)serObject.mydate2));
+        
+        logger.debug("resultDate millisec: " + ((Date)serObject.mydate).getTime() +" source:"+ sourceDate.getTime().getTime() );        
+        assertTrue("resultDate not equal not sourceDate millisec: ",((Date)serObject.mydate).getTime() == sourceDate.getTime().getTime() );
+    }
+    // timezone
+    @Test
+    public void testDeSerializeTZDate() throws Exception {
+        Map<String, Date> map = new HashMap<String, Date>();
+        Calendar sourceDate = Calendar.getInstance(TimeZone.getTimeZone("America/Montreal"));// UTC -5
+        sourceDate.set(1999, 3, 10, 11, 10); // set in Montreal Time this date and time
+        sourceDate.set(Calendar.SECOND, 0);
+        sourceDate.set(Calendar.MILLISECOND, 0);
+        
+        // shows date and time in locale time
+        //logger.debug("sourceDate millisec:"+ sourceDate.getTime().getTime());
+        
+        // any "timezone" information is lost from the Calendar when converting it  into a java.util.Date by calling getTime()
+        map.put("mydate",sourceDate.getTime());
+        
+        sc.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm a z"));
+        
+        String serJson0 =  sc.ser(map, false);
+        String serJson =  sc.ser(map, Map.class, false);
+        
+        //this may be in "any" locale timezone, eg. 1999-04-10 17:10 PM MESZ
+        logger.debug("serJson:"+ serJson0);
+        assertEquals(serJson0, serJson);
+        
+        DateKeyMixin serObject =sc.deSer(serJson0, DateKeyMixin.class);
+        assertTrue(serObject.mydate instanceof Date);
+
+        logger.debug("resultDate millisec: " + ((Date)serObject.mydate).getTime() +" source:"+ sourceDate.getTime().getTime() );        
+        assertTrue("resultDate not equal not sourceDate millisec: ",((Date)serObject.mydate).getTime() == sourceDate.getTime().getTime() );
     }
     @Test
     public void testSerializeWithCustomFilter() throws Exception {

Modified: turbine/fulcrum/trunk/json/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/json/pom.xml?rev=1802359&r1=1802358&r2=1802359&view=diff
==============================================================================
--- turbine/fulcrum/trunk/json/pom.xml (original)
+++ turbine/fulcrum/trunk/json/pom.xml Wed Jul 19 07:04:10 2017
@@ -22,12 +22,12 @@
        <artifactId>turbine-parent</artifactId>
        <groupId>org.apache.turbine</groupId>
        <version>4</version>
-       <relativePath />
+       <relativePath></relativePath>
    </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.fulcrum</groupId>
     <artifactId>fulcrum-json-parent</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.1-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>Fulcrum JSON Master Build</name>
     <url>http://turbine.apache.org/fulcrum/fulcrum-json/</url>