svn commit: r1132709 - /ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1132709 - /ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java

sascharodekamp
Author: sascharodekamp
Date: Mon Jun  6 17:35:46 2011
New Revision: 1132709

URL: http://svn.apache.org/viewvc?rev=1132709&view=rev
Log:
Update - Update the JCR Tests to check the verisoning and language methods

Modified:
    ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java

Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java?rev=1132709&r1=1132708&r2=1132709&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/test/JcrTests.java Mon Jun  6 17:35:46 2011
@@ -23,7 +23,11 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.List;
 
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.content.jcr.JackrabbitWorker;
 import org.ofbiz.content.jcr.helper.JcrFileHelperJackrabbit;
@@ -73,6 +77,19 @@ public class JcrTests extends OFBizTestC
         assertEquals("Hello World!", jh.getTextData());
     }
 
+    public void testGetSelectedLanguage() throws PathNotFoundException, RepositoryException {
+        assertEquals(UtilProperties.getPropertyValue("general", "locale.properties.fallback"), jh.getSelctedLanguage());
+        assertEquals("Hello World!", jh.getTextData(UtilProperties.getPropertyValue("general", "locale.properties.fallback")));
+    }
+
+    public void testCheckVersioning() {
+        // should 1.1 because it was created (1.0) and a text content was
+        // appened (1.1)
+        assertEquals("1.1", jh.getCurrentBaseVersion());
+        // should be 1.0 because the text node is only created and not updated
+        assertEquals("1.0", jh.getCurrentLanguageVersion());
+    }
+
     public void testCreateNewChildNodes() throws Exception {
         JcrTextHelper subnode = jh.addNewNode("subNode");
         assertNotNull(subnode);