cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject [4/4] cayenne git commit: cleanup
Date Thu, 07 May 2015 11:21:31 GMT
cleanup


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/6716f6b8
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/6716f6b8
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/6716f6b8

Branch: refs/heads/master
Commit: 6716f6b88dfbf1081702a6f803ed93cbd1f0d069
Parents: ba8167e
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Thu May 7 14:20:21 2015 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Thu May 7 14:20:21 2015 +0300

----------------------------------------------------------------------
 cayenne-java8/pom.xml                           |  7 +-
 .../org/apache/cayenne/java8/Java8TimeIT.java   | 95 ++++++++++++++++++++
 .../org/apache/cayenne/java8/Java8TimesIT.java  | 92 -------------------
 .../org/apache/cayenne/java8/RuntimeBase.java   |  4 +-
 .../org/apache/cayenne/java8/db/Java8Times.java | 18 ----
 .../cayenne/java8/db/auto/_Java8Times.java      | 12 ---
 .../src/test/resources/cayenne-java8-times.xml  | 17 ----
 .../src/test/resources/cayenne-java8.xml        | 17 ++++
 .../src/test/resources/java8-times.map.xml      | 28 ------
 cayenne-java8/src/test/resources/java8.map.xml  | 28 ++++++
 pom.xml                                         |  1 -
 11 files changed, 145 insertions(+), 174 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-java8/pom.xml b/cayenne-java8/pom.xml
index 1f473dd..5555dc9 100644
--- a/cayenne-java8/pom.xml
+++ b/cayenne-java8/pom.xml
@@ -12,15 +12,16 @@ language governing permissions and limitations under the License. -->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>cayenne-parent</artifactId>
         <groupId>org.apache.cayenne</groupId>
-        <version>4.0.M2-SNAPSHOT</version>
+        <version>4.0.M3-SNAPSHOT</version>
     </parent>
-    <modelVersion>4.0.0</modelVersion>
     <artifactId>cayenne-java8</artifactId>
     <name>Cayenne Java8 Extensions</name>
     <packaging>jar</packaging>
+
     <dependencies>
 
         <!-- Compile dependencies -->
@@ -65,7 +66,7 @@ language governing permissions and limitations under the License. -->
                 <artifactId>maven-cayenne-plugin</artifactId>
                 <version>${project.version}</version>
                 <configuration>
-                    <map>${project.basedir}/src/test/resources/java8-times.map.xml</map>
+                    <map>${project.basedir}/src/test/resources/java8.map.xml</map>
                     <destDir>${project.basedir}/src/test/java</destDir>
                     <defaultPackage>org.apache.cayenne.java8.db</defaultPackage>
                     <superPkg>org.apache.cayenne.java8.db.auto</superPkg>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
new file mode 100644
index 0000000..56f94c8
--- /dev/null
+++ b/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimeIT.java
@@ -0,0 +1,95 @@
+/*****************************************************************
+ *   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.cayenne.java8;
+
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.java8.db.LocalDateTestEntity;
+import org.apache.cayenne.java8.db.LocalDateTimeTestEntity;
+import org.apache.cayenne.java8.db.LocalTimeTestEntity;
+import org.apache.cayenne.query.SelectQuery;
+import org.junit.Test;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class Java8TimeIT extends RuntimeBase {
+
+    @Test
+    public void testJava8LocalDate() {
+        ObjectContext context = runtime.newContext();
+
+        LocalDateTestEntity localDateTestEntity = context.newObject(LocalDateTestEntity.class);
+        LocalDate localDate = LocalDate.now();
+        localDateTestEntity.setDate(localDate);
+
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(LocalDateTestEntity.class);
+        LocalDateTestEntity testRead = (LocalDateTestEntity) context.performQuery(q).get(0);
+
+        assertNotNull(testRead.getDate());
+        assertEquals(LocalDate.class, testRead.getDate().getClass());
+        assertEquals(localDate, testRead.getDate());
+
+    }
+
+    @Test
+    public void testJava8LocalTime() {
+        ObjectContext context = runtime.newContext();
+
+        LocalTimeTestEntity localTimeTestEntity = context.newObject(LocalTimeTestEntity.class);
+        LocalTime localTime = LocalTime.now();
+        localTimeTestEntity.setTime(localTime);
+
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(LocalTimeTestEntity.class);
+        LocalTimeTestEntity testRead = (LocalTimeTestEntity) context.performQuery(q).get(0);
+
+        assertNotNull(testRead.getTime());
+        assertEquals(LocalTime.class, testRead.getTime().getClass());
+        assertEquals(localTime.toSecondOfDay(), testRead.getTime().toSecondOfDay());
+
+    }
+
+    @Test
+    public void testJava8LocalDateTime() {
+        ObjectContext context = runtime.newContext();
+
+        LocalDateTimeTestEntity localDateTimeTestEntity = context.newObject(LocalDateTimeTestEntity.class);
+        LocalDateTime localDateTime = LocalDateTime.now();
+        localDateTimeTestEntity.setTimestamp(localDateTime);
+
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(LocalDateTimeTestEntity.class);
+        LocalDateTimeTestEntity testRead = (LocalDateTimeTestEntity) context.performQuery(q).get(0);
+
+        assertNotNull(testRead.getTimestamp());
+        assertEquals(LocalDateTime.class, testRead.getTimestamp().getClass());
+        assertEquals(localDateTime, testRead.getTimestamp());
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimesIT.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimesIT.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimesIT.java
deleted file mode 100644
index 7db3243..0000000
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/Java8TimesIT.java
+++ /dev/null
@@ -1,92 +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.cayenne.java8;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.java8.db.LocalDateTestEntity;
-import org.apache.cayenne.java8.db.LocalDateTimeTestEntity;
-import org.apache.cayenne.java8.db.LocalTimeTestEntity;
-import org.apache.cayenne.query.SelectQuery;
-import org.junit.Test;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class Java8TimesIT extends RuntimeBase {
-
-    @Test
-    public void testJava8LocalDate() {
-        ObjectContext context = runtime.newContext();
-
-        LocalDateTestEntity localDateTestEntity = context.newObject(LocalDateTestEntity.class);
-        LocalDate localDate = LocalDate.now();
-        localDateTestEntity.setDate(localDate);
-
-        context.commitChanges();
-
-        SelectQuery q = new SelectQuery(LocalDateTestEntity.class);
-        LocalDateTestEntity testRead = (LocalDateTestEntity) context.performQuery(q).get(0);
-        assertNotNull(testRead.getDate());
-        assertEquals(localDate, testRead.getDate());
-        assertEquals(LocalDate.class, testRead.getDate().getClass());
-
-    }
-
-    @Test
-    public void testJava8LocalTime() {
-        ObjectContext context = runtime.newContext();
-
-        LocalTimeTestEntity localTimeTestEntity = context.newObject(LocalTimeTestEntity.class);
-        LocalTime localTime = LocalTime.now();
-        localTimeTestEntity.setTime(localTime);
-
-        context.commitChanges();
-
-        SelectQuery q = new SelectQuery(LocalTimeTestEntity.class);
-        LocalTimeTestEntity testRead = (LocalTimeTestEntity) context.performQuery(q).get(0);
-        assertNotNull(testRead.getTime());
-        assertEquals(localTime.toSecondOfDay(), testRead.getTime().toSecondOfDay());
-        assertEquals(LocalTime.class, testRead.getTime().getClass());
-
-    }
-
-    @Test
-    public void testJava8LocalDateTime() {
-        ObjectContext context = runtime.newContext();
-
-        LocalDateTimeTestEntity localDateTimeTestEntity = context.newObject(LocalDateTimeTestEntity.class);
-        LocalDateTime localDateTime = LocalDateTime.now();
-        localDateTimeTestEntity.setTimestamp(localDateTime);
-
-        context.commitChanges();
-
-        SelectQuery q = new SelectQuery(LocalDateTimeTestEntity.class);
-        LocalDateTimeTestEntity testRead = (LocalDateTimeTestEntity) context.performQuery(q).get(0);
-        assertNotNull(testRead.getTimestamp());
-        assertEquals(localDateTime, testRead.getTimestamp());
-        assertEquals(LocalDateTime.class, testRead.getTimestamp().getClass());
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
index 5379b37..f150818 100644
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
+++ b/cayenne-java8/src/test/java/org/apache/cayenne/java8/RuntimeBase.java
@@ -29,10 +29,8 @@ public class RuntimeBase {
 
     @Before
     public void setUpRuntime() throws Exception {
-
         Module java8Module = new CayenneJava8Module();
-
-        this.runtime = new ServerRuntime("cayenne-java8-times.xml", java8Module);
+        this.runtime = new ServerRuntime("cayenne-java8.xml", java8Module);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/Java8Times.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/Java8Times.java b/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/Java8Times.java
deleted file mode 100644
index c01f4cc..0000000
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/Java8Times.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.cayenne.java8.db;
-
-import org.apache.cayenne.java8.db.auto._Java8Times;
-
-public class Java8Times extends _Java8Times {
-
-    private static Java8Times instance;
-
-    private Java8Times() {}
-
-    public static Java8Times getInstance() {
-        if(instance == null) {
-            instance = new Java8Times();
-        }
-
-        return instance;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/auto/_Java8Times.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/auto/_Java8Times.java
b/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/auto/_Java8Times.java
deleted file mode 100644
index 1d44ef6..0000000
--- a/cayenne-java8/src/test/java/org/apache/cayenne/java8/db/auto/_Java8Times.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.cayenne.java8.db.auto;
-
-
-
-/**
- * This class was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public class _Java8Times {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/resources/cayenne-java8-times.xml
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/resources/cayenne-java8-times.xml b/cayenne-java8/src/test/resources/cayenne-java8-times.xml
deleted file mode 100644
index bb7a77d..0000000
--- a/cayenne-java8/src/test/resources/cayenne-java8-times.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<domain project-version="7">
-	<map name="java8-times"/>
-
-	<node name="datanode"
-		 factory="org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory"
-		 schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy"
-		>
-		<map-ref name="java8-times"/>
-		<data-source>
-			<driver value="org.hsqldb.jdbcDriver"/>
-			<url value="jdbc:hsqldb:mem:java8"/>
-			<connectionPool min="1" max="1"/>
-			<login userName="sa"/>
-		</data-source>
-	</node>
-</domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/resources/cayenne-java8.xml
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/resources/cayenne-java8.xml b/cayenne-java8/src/test/resources/cayenne-java8.xml
new file mode 100644
index 0000000..8e07370
--- /dev/null
+++ b/cayenne-java8/src/test/resources/cayenne-java8.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domain project-version="7">
+	<map name="java8"/>
+
+	<node name="datanode"
+		 factory="org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory"
+		 schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy"
+		>
+		<map-ref name="java8"/>
+		<data-source>
+			<driver value="org.hsqldb.jdbcDriver"/>
+			<url value="jdbc:hsqldb:mem:java8"/>
+			<connectionPool min="1" max="1"/>
+			<login userName="sa"/>
+		</data-source>
+	</node>
+</domain>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/resources/java8-times.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/resources/java8-times.map.xml b/cayenne-java8/src/test/resources/java8-times.map.xml
deleted file mode 100644
index ac170f9..0000000
--- a/cayenne-java8/src/test/resources/java8-times.map.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/7/modelMap"
-	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://cayenne.apache.org/schema/7/modelMap http://cayenne.apache.org/schema/7/modelMap.xsd"
-	 project-version="7">
-	<property name="defaultPackage" value="org.apache.cayenne.java8.db"/>
-	<db-entity name="LOCAL_DATE_TEST">
-		<db-attribute name="Date" type="DATE"/>
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
-	</db-entity>
-	<db-entity name="LOCAL_DATETIME_TEST">
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
-		<db-attribute name="Timestamp" type="TIMESTAMP"/>
-	</db-entity>
-	<db-entity name="LOCAL_TIME_TEST">
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
-		<db-attribute name="Time" type="TIME"/>
-	</db-entity>
-	<obj-entity name="LocalDateTest" className="org.apache.cayenne.java8.db.LocalDateTestEntity"
dbEntityName="LOCAL_DATE_TEST">
-		<obj-attribute name="date" type="java.time.LocalDate" db-attribute-path="Date"/>
-	</obj-entity>
-	<obj-entity name="LocalDateTimeTest" className="org.apache.cayenne.java8.db.LocalDateTimeTestEntity"
dbEntityName="LOCAL_DATETIME_TEST">
-		<obj-attribute name="timestamp" type="java.time.LocalDateTime" db-attribute-path="Timestamp"/>
-	</obj-entity>
-	<obj-entity name="LocalTimeTest" className="org.apache.cayenne.java8.db.LocalTimeTestEntity"
dbEntityName="LOCAL_TIME_TEST">
-		<obj-attribute name="time" type="java.time.LocalTime" db-attribute-path="Time"/>
-	</obj-entity>
-</data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/cayenne-java8/src/test/resources/java8.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/test/resources/java8.map.xml b/cayenne-java8/src/test/resources/java8.map.xml
new file mode 100644
index 0000000..ac170f9
--- /dev/null
+++ b/cayenne-java8/src/test/resources/java8.map.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map xmlns="http://cayenne.apache.org/schema/7/modelMap"
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	 xsi:schemaLocation="http://cayenne.apache.org/schema/7/modelMap http://cayenne.apache.org/schema/7/modelMap.xsd"
+	 project-version="7">
+	<property name="defaultPackage" value="org.apache.cayenne.java8.db"/>
+	<db-entity name="LOCAL_DATE_TEST">
+		<db-attribute name="Date" type="DATE"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
+	<db-entity name="LOCAL_DATETIME_TEST">
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="Timestamp" type="TIMESTAMP"/>
+	</db-entity>
+	<db-entity name="LOCAL_TIME_TEST">
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="Time" type="TIME"/>
+	</db-entity>
+	<obj-entity name="LocalDateTest" className="org.apache.cayenne.java8.db.LocalDateTestEntity"
dbEntityName="LOCAL_DATE_TEST">
+		<obj-attribute name="date" type="java.time.LocalDate" db-attribute-path="Date"/>
+	</obj-entity>
+	<obj-entity name="LocalDateTimeTest" className="org.apache.cayenne.java8.db.LocalDateTimeTestEntity"
dbEntityName="LOCAL_DATETIME_TEST">
+		<obj-attribute name="timestamp" type="java.time.LocalDateTime" db-attribute-path="Timestamp"/>
+	</obj-entity>
+	<obj-entity name="LocalTimeTest" className="org.apache.cayenne.java8.db.LocalTimeTestEntity"
dbEntityName="LOCAL_TIME_TEST">
+		<obj-attribute name="time" type="java.time.LocalTime" db-attribute-path="Time"/>
+	</obj-entity>
+</data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6716f6b8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f8ebab9..b676493 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,7 +64,6 @@
 		<module>docs</module>
 		<module>assembly</module>
         <module>cayenne-joda</module>
-		<module>cayenne-java8</module>
 	</modules>
 	<issueManagement>
 		<system>jira</system>


Mime
View raw message