roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1070297 - in /roller/trunk/weblogger-business/src: main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml test/java/org/apache/roller/weblogger/business/MediaFileTest.java
Date Sun, 13 Feb 2011 20:51:51 GMT
Author: snoopdave
Date: Sun Feb 13 20:51:51 2011
New Revision: 1070297

URL: http://svn.apache.org/viewvc?rev=1070297&view=rev
Log:
Couple more fixes to MediaFile - MediaFileTag relationship in tests

Modified:
    roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml
    roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java

Modified: roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml?rev=1070297&r1=1070296&r2=1070297&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml
(original)
+++ roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/pojos/MediaFile.orm.xml
Sun Feb 13 20:51:51 2011
@@ -63,7 +63,8 @@
             </many-to-one>
             <one-to-many name="tags" mapped-by="mediaFile" target-entity="org.apache.roller.weblogger.pojos.MediaFileTag">
                 <cascade>
-                    <cascade-all />
+                    <cascade-persist /> <!-- Added so entry added by addTag() gets
persisted -->
+                    <cascade-remove />
                 </cascade>
             </one-to-many>
             <transient name="thumbnailURL"/>

Modified: roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java?rev=1070297&r1=1070296&r2=1070297&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
(original)
+++ roller/trunk/weblogger-business/src/test/java/org/apache/roller/weblogger/business/MediaFileTest.java
Sun Feb 13 20:51:51 2011
@@ -448,7 +448,7 @@ public class MediaFileTest extends TestC
 	            rootDirectory.getMediaFiles().add(mf);
 	
 	            MediaFileTag tag = new MediaFileTag("work", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
+	            Set<MediaFileTag> tags = mf.getTags();
 	            tags.add(tag);
 	            mf.setTags(tags);
 	
@@ -478,7 +478,7 @@ public class MediaFileTest extends TestC
 	            rootDirectory.getMediaFiles().add(mf);
 	
 	            MediaFileTag tag = new MediaFileTag("home", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
+	            Set<MediaFileTag> tags = mf.getTags();
 	            tags.add(tag);
 	            mf.setTags(tags);
 	
@@ -508,7 +508,7 @@ public class MediaFileTest extends TestC
 	            rootDirectory.getMediaFiles().add(mf);
 	
 	            MediaFileTag tag = new MediaFileTag("home", mf);
-	            Set<MediaFileTag> tags = new HashSet<MediaFileTag>();
+	            Set<MediaFileTag> tags = mf.getTags();
 	            tags.add(tag);
 	            mf.setTags(tags);
 	



Mime
View raw message