Author: aadamchik
Date: Mon Oct  9 22:11:57 2006
New Revision: 454618

URL: http://svn.apache.org/viewvc?view=rev&rev=454618
Log:
CAY-682 - setting up itests for Cayenne POJOs

Added:
    incubator/cayenne/main/trunk/integration-test/pojo/
    incubator/cayenne/main/trunk/integration-test/pojo/.classpath
    incubator/cayenne/main/trunk/integration-test/pojo/.project
    incubator/cayenne/main/trunk/integration-test/pojo/pom.xml
    incubator/cayenne/main/trunk/integration-test/pojo/src/
    incubator/cayenne/main/trunk/integration-test/pojo/src/main/
    incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/
    incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/
    incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/Entity1.java
    incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/cayenne.xml
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-map.map.xml
    
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-node.driver.xml
    incubator/cayenne/main/trunk/integration-test/pojo/src/test/
    incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/
    incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/
    incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/
    
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java

Added: incubator/cayenne/main/trunk/integration-test/pojo/.classpath
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/.classpath?view=auto&rev=454618
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/pojo/.classpath (added)
+++ incubator/cayenne/main/trunk/integration-test/pojo/.classpath Mon Oct  9 
22:11:57 2006
@@ -0,0 +1,10 @@
+<?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 excluding="**" output="src/test/resources" kind="src" 
path="src/test/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: incubator/cayenne/main/trunk/integration-test/pojo/.project
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/.project?view=auto&rev=454618
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/pojo/.project (added)
+++ incubator/cayenne/main/trunk/integration-test/pojo/.project Mon Oct  9 
22:11:57 2006
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>pojo</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: incubator/cayenne/main/trunk/integration-test/pojo/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/pom.xml?view=auto&rev=454618
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/pojo/pom.xml (added)
+++ incubator/cayenne/main/trunk/integration-test/pojo/pom.xml Mon Oct  9 
22:11:57 2006
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+
+    Licensed 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.itest</groupId>
+               <artifactId>cayenne-itest-parent</artifactId>
+               <version>3.0-incubating-SNAPSHOT</version>
+       </parent>
+
+       <description>Integration Tests - POJO</description>
+       <artifactId>pojo</artifactId>
+       <name>Integration Tests - POJO</name>
+       <packaging>jar</packaging>
+
+       <dependencies>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.apache.cayenne.itest</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>
+
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+
+                               <configuration>
+                                       <forkMode>once</forkMode>
+                                       <argLine>
+                                               
-javaagent:${settings.localRepository}/org/apache/cayenne/core/cayenne-jpa-agent/${version}/cayenne-jpa-agent-${version}.jar
+                                       </argLine>
+                               </configuration>
+                       </plugin>
+
+               </plugins>
+       </build>
+</project>

Added: 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/Entity1.java
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/Entity1.java?view=auto&rev=454618
==============================================================================
--- 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/Entity1.java
 (added)
+++ 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/java/org/apache/cayenne/itest/pojo/Entity1.java
 Mon Oct  9 22:11:57 2006
@@ -0,0 +1,14 @@
+package org.apache.cayenne.itest.pojo;
+
+public class Entity1 {
+
+       protected String name;
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+}

Added: 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/cayenne.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/cayenne.xml?view=auto&rev=454618
==============================================================================
--- 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/cayenne.xml
 (added)
+++ 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/cayenne.xml
 Mon Oct  9 22:11:57 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domains project-version="2.0">
+<domain name="pojo-domain">
+       <map name="pojo-map" location="pojo-map.map.xml"/>
+
+       <node name="pojo-node"
+                datasource="pojo-node.driver.xml"
+                factory="org.apache.cayenne.conf.DriverDataSourceFactory">
+                       <map-ref name="pojo-map"/>
+        </node>
+</domain>
+</domains>

Added: 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-map.map.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-map.map.xml?view=auto&rev=454618
==============================================================================
--- 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-map.map.xml
 (added)
+++ 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-map.map.xml
 Mon Oct  9 22:11:57 2006
@@ -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.pojo"/>
+       <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.pojo.Entity1" dbEntityName="entity1">
+               <obj-attribute name="name" type="java.lang.String" 
db-attribute-path="name"/>
+       </obj-entity>
+</data-map>

Added: 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-node.driver.xml
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-node.driver.xml?view=auto&rev=454618
==============================================================================
--- 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-node.driver.xml
 (added)
+++ 
incubator/cayenne/main/trunk/integration-test/pojo/src/main/resources/pojo-node.driver.xml
 Mon Oct  9 22:11:57 2006
@@ -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:pojo"/>
+       <connectionPool min="1" max="1" />
+       <login userName="sa"/>
+</driver>

Added: 
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java?view=auto&rev=454618
==============================================================================
--- 
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
 (added)
+++ 
incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
 Mon Oct  9 22:11:57 2006
@@ -0,0 +1,15 @@
+package org.apache.cayenne.itest.pojo;
+
+import org.apache.cayenne.itest.ObjectContextTestCase;
+
+public class SimpleObjectTest extends ObjectContextTestCase {
+
+       public void testInsert() throws Exception {
+               // TODO: andrus, 10/9/2006 - clean up DataContext DataObject 
dependency.
+               // Entity1 o = (Entity1) context.newObject(Entity1.class);
+               // o.setName("X");
+               // context.commitChanges();
+               //
+               // assertEquals("X", ItestDBUtils.getObject("entity1", "name"));
+       }
+}


Reply via email to