cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r560560 - in /cayenne/main/trunk/itests/cayenne-api: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cayenne/ src/main/java/org/apache/cayenne/itest/ src/main/java/org/apache/cayenne/it...
Date Sat, 28 Jul 2007 16:03:03 GMT
Author: aadamchik
Date: Sat Jul 28 09:03:01 2007
New Revision: 560560

URL: http://svn.apache.org/viewvc?view=rev&rev=560560
Log:
adding Cayenne Persistence API (aka CPA) integration tests module

Added:
    cayenne/main/trunk/itests/cayenne-api/   (with props)
    cayenne/main/trunk/itests/cayenne-api/.classpath
    cayenne/main/trunk/itests/cayenne-api/.project
    cayenne/main/trunk/itests/cayenne-api/pom.xml
    cayenne/main/trunk/itests/cayenne-api/src/
    cayenne/main/trunk/itests/cayenne-api/src/main/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/Entity1.java
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/
    cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/_Entity1.java
    cayenne/main/trunk/itests/cayenne-api/src/main/resources/
    cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-map.map.xml
    cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-node.driver.xml
    cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne.xml
    cayenne/main/trunk/itests/cayenne-api/src/test/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/
    cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/ObjectContextTest.java

Propchange: cayenne/main/trunk/itests/cayenne-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Jul 28 09:03:01 2007
@@ -0,0 +1,2 @@
+
+target

Added: cayenne/main/trunk/itests/cayenne-api/.classpath
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/.classpath?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/.classpath (added)
+++ cayenne/main/trunk/itests/cayenne-api/.classpath Sat Jul 28 09:03:01 2007
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry excluding="**" output="src/main/resources" kind="src" path="src/main/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: cayenne/main/trunk/itests/cayenne-api/.project
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/.project?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/.project (added)
+++ cayenne/main/trunk/itests/cayenne-api/.project Sat Jul 28 09:03:01 2007
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>cayenne-api</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Added: cayenne/main/trunk/itests/cayenne-api/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/pom.xml?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/pom.xml (added)
+++ cayenne/main/trunk/itests/cayenne-api/pom.xml Sat Jul 28 09:03:01 2007
@@ -0,0 +1,62 @@
+<?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.   
+-->
+<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/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.cayenne.itests</groupId>
+		<artifactId>cayenne-itests-parent</artifactId>
+		<version>3.0-SNAPSHOT</version>
+	</parent>
+
+	<description>Integration Tests - Cayenne Persistence API</description>
+	<artifactId>cayenne-api</artifactId>
+	<name>Integration Tests - POJO</name>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.cayenne.itests</groupId>
+			<artifactId>itest-common</artifactId>
+			<version>${version}</version>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

Added: cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/Entity1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/Entity1.java?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/Entity1.java
(added)
+++ cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/Entity1.java
Sat Jul 28 09:03:01 2007
@@ -0,0 +1,10 @@
+package org.apache.cayenne.itest.cpa;
+
+import org.apache.cayenne.itest.cpa.auto._Entity1;
+
+public class Entity1 extends _Entity1 {
+
+}
+
+
+

Added: cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/_Entity1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/_Entity1.java?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/_Entity1.java
(added)
+++ cayenne/main/trunk/itests/cayenne-api/src/main/java/org/apache/cayenne/itest/cpa/auto/_Entity1.java
Sat Jul 28 09:03:01 2007
@@ -0,0 +1,22 @@
+package org.apache.cayenne.itest.cpa.auto;
+
+/** Class _Entity1 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 _Entity1 extends org.apache.cayenne.CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+
+    public static final String ID_PK_COLUMN = "id";
+
+    public void setName(String name) {
+        writeProperty("name", name);
+    }
+    public String getName() {
+        return (String)readProperty("name");
+    }
+    
+    
+}

Added: cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-map.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-map.map.xml?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-map.map.xml (added)
+++ cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-map.map.xml Sat Jul
28 09:03:01 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map project-version="2.0">
+	<property name="defaultPackage" value="org.apache.cayenne.itest.cpa"/>
+	<db-entity name="entity1">
+		<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="name" type="VARCHAR" length="100"/>
+	</db-entity>
+	<obj-entity name="Entity1" className="org.apache.cayenne.itest.cpa.Entity1" dbEntityName="entity1">
+		<obj-attribute name="name" type="java.lang.String" db-attribute-path="name"/>
+	</obj-entity>
+</data-map>

Added: cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-node.driver.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-node.driver.xml?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-node.driver.xml (added)
+++ cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne-api-node.driver.xml Sat
Jul 28 09:03:01 2007
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<driver project-version="2.0" class="org.hsqldb.jdbcDriver">
+	<url value="jdbc:hsqldb:mem:cayenne_api"/>
+	<connectionPool min="1" max="1"/>
+	<login userName="sa" encoderClass="org.apache.cayenne.conf.PlainTextPasswordEncoder"
passwordLocation="model" passwordSource="Not Applicable"/>
+</driver>

Added: cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne.xml?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne.xml (added)
+++ cayenne/main/trunk/itests/cayenne-api/src/main/resources/cayenne.xml Sat Jul 28 09:03:01
2007
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domains project-version="2.0">
+<domain name="cayenne-api-domain">
+	<map name="cayenne-api-map" location="cayenne-api-map.map.xml"/>
+
+	<node name="cayenne-api-node"
+		 datasource="cayenne-api-node.driver.xml"
+		 factory="org.apache.cayenne.conf.DriverDataSourceFactory">
+			<map-ref name="cayenne-api-map"/>
+	 </node>
+</domain>
+</domains>

Added: cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/ObjectContextTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/ObjectContextTest.java?view=auto&rev=560560
==============================================================================
--- cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/ObjectContextTest.java
(added)
+++ cayenne/main/trunk/itests/cayenne-api/src/test/java/org/apache/cayenne/itest/cpa/ObjectContextTest.java
Sat Jul 28 09:03:01 2007
@@ -0,0 +1,22 @@
+package org.apache.cayenne.itest.cpa;
+
+import java.util.List;
+
+import org.apache.cayenne.query.SelectQuery;
+
+public class ObjectContextTest extends CPAContextCase {
+
+	public void testPerformQuery() throws Exception {
+
+		getDbHelper().deleteAll("entity1");
+		getDbHelper().insert("entity1", new String[] { "id", "name" },
+				new Object[] { 1, "X" });
+		getDbHelper().insert("entity1", new String[] { "id", "name" },
+				new Object[] { 2, "Y" });
+
+		SelectQuery query = new SelectQuery(Entity1.class);
+		List results = getContext().performQuery(query);
+		assertNotNull(results);
+		assertEquals(2, results.size());
+	}
+}



Mime
View raw message