cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r669224 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test: java/org/apache/cayenne/access/DataContextOuterJoinsTest.java resources/dml/access.DataContextOuterJoinsTest.xml
Date Wed, 18 Jun 2008 17:00:08 GMT
Author: aadamchik
Date: Wed Jun 18 10:00:08 2008
New Revision: 669224

URL: http://svn.apache.org/viewvc?rev=669224&view=rev
Log:
unit tests

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextOuterJoinsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/access.DataContextOuterJoinsTest.xml

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextOuterJoinsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextOuterJoinsTest.java?rev=669224&r1=669223&r2=669224&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextOuterJoinsTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextOuterJoinsTest.java
Wed Jun 18 10:00:08 2008
@@ -36,6 +36,20 @@
         super.setUp();
         deleteTestData();
     }
+    
+    public void testSelectWithOuterJoinFlattened() throws Exception {
+        createTestData("testSelectWithOuterJoinFlattened");
+
+        SelectQuery missingToManyQuery = new SelectQuery(Artist.class);
+        missingToManyQuery.andQualifier(ExpressionFactory.matchExp(
+                Artist.GROUP_ARRAY_PROPERTY + Entity.OUTER_JOIN_INDICATOR,
+                null));
+        missingToManyQuery.addOrdering(Artist.ARTIST_NAME_PROPERTY, Ordering.ASC);
+
+        List<Artist> artists = createDataContext().performQuery(missingToManyQuery);
+        assertEquals(1, artists.size());
+        assertEquals("BB1", artists.get(0).getArtistName());
+    }
 
     public void testSelectWithOuterJoin() throws Exception {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/access.DataContextOuterJoinsTest.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/access.DataContextOuterJoinsTest.xml?rev=669224&r1=669223&r2=669224&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/access.DataContextOuterJoinsTest.xml
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/access.DataContextOuterJoinsTest.xml
Wed Jun 18 10:00:08 2008
@@ -35,6 +35,34 @@
 		</value></constructor-arg>
 	</bean>
 	
+	<bean id="AG1" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.art.Artist</value></constructor-arg>
+		<constructor-arg><value>
+		insert into ARTGROUP (GROUP_ID, NAME) values (1, 'G1')
+		</value></constructor-arg>
+	</bean>
+	
+	<bean id="AG11" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.art.Artist</value></constructor-arg>
+		<constructor-arg><value>
+		insert into ARTIST_GROUP (GROUP_ID, ARTIST_ID) values (1, 33001)
+		</value></constructor-arg>
+	</bean>
+	
+	<bean id="AG12" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.art.Artist</value></constructor-arg>
+		<constructor-arg><value>
+		insert into ARTIST_GROUP (GROUP_ID, ARTIST_ID) values (1, 33002)
+		</value></constructor-arg>
+	</bean>
+	
+	<bean id="AG14" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.art.Artist</value></constructor-arg>
+		<constructor-arg><value>
+		insert into ARTIST_GROUP (GROUP_ID, ARTIST_ID) values (1, 33004)
+		</value></constructor-arg>
+	</bean>
+	
 	<bean id="P11" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
 		<constructor-arg type="java.lang.Class"><value>org.apache.art.Painting</value></constructor-arg>
 		<constructor-arg><value>
@@ -61,6 +89,21 @@
 	<!-- Data Sets -->
 	<!-- ======================================= -->	
 	
+	<bean id="testSelectWithOuterJoinFlattened" class="java.util.ArrayList">
+		<constructor-arg>
+			<list>
+				<ref bean="A1"/>
+				<ref bean="A2"/>
+				<ref bean="A3"/>
+				<ref bean="A4"/>
+				<ref bean="AG1"/>
+				<ref bean="AG11"/>
+				<ref bean="AG12"/>
+				<ref bean="AG14"/>
+			</list>
+		</constructor-arg>
+	</bean>
+	
 	<bean id="testSelectWithOuterJoin" class="java.util.ArrayList">
 		<constructor-arg>
 			<list>



Mime
View raw message