jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1387653 - in /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query: ChildAxisQueryTest.java lucene/TextExtractionQueryTest.java
Date Wed, 19 Sep 2012 15:53:20 GMT
Author: alexparvulescu
Date: Wed Sep 19 15:53:19 2012
New Revision: 1387653

URL: http://svn.apache.org/viewvc?rev=1387653&view=rev
Log:
JCR-3429 Make query tests (more) independent

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TextExtractionQueryTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java?rev=1387653&r1=1387652&r2=1387653&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ChildAxisQueryTest.java
Wed Sep 19 15:53:19 2012
@@ -16,12 +16,6 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.Calendar;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
@@ -184,23 +178,6 @@ public class ChildAxisQueryTest extends 
                 new Node[]{testRootNode});
     }
 
-    public void testNtFile() throws RepositoryException, IOException {
-        Node file = testRootNode.addNode(nodeName1, "nt:file");
-        Node resource = file.addNode("jcr:content", "nt:resource");
-        resource.setProperty("jcr:encoding", "UTF-8");
-        resource.setProperty("jcr:mimeType", "text/plain");
-        ByteArrayOutputStream data = new ByteArrayOutputStream();
-        OutputStreamWriter writer = new OutputStreamWriter(data, "UTF-8");
-        writer.write("The quick brown fox jumps over the lazy dog.");
-        writer.close();
-        resource.setProperty("jcr:data", new ByteArrayInputStream(data.toByteArray()));
-        resource.setProperty("jcr:lastModified", Calendar.getInstance());
-
-        testRootNode.save();
-        String xpath = testPath + "/*[jcr:contains(jcr:content, 'lazy')]";
-        executeXPathQuery(xpath, new Node[]{file});
-    }
-
     public void testStarNameTest() throws RepositoryException {
         Node level1 = testRootNode.addNode(nodeName1);
         level1.setProperty(propertyName1, "The quick brown fox jumps over the lazy dog.");

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TextExtractionQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TextExtractionQueryTest.java?rev=1387653&r1=1387652&r2=1387653&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TextExtractionQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TextExtractionQueryTest.java
Wed Sep 19 15:53:19 2012
@@ -16,7 +16,12 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.util.Calendar;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
@@ -35,6 +40,23 @@ public class TextExtractionQueryTest ext
         assertFileContains("test.rtf", "text/rtf", "quick brown fox");
     }
 
+    public void testNtFile() throws RepositoryException, IOException {
+        Node file = testRootNode.addNode(nodeName1, "nt:file");
+        Node resource = file.addNode("jcr:content", "nt:resource");
+        resource.setProperty("jcr:encoding", "UTF-8");
+        resource.setProperty("jcr:mimeType", "text/plain");
+        ByteArrayOutputStream data = new ByteArrayOutputStream();
+        OutputStreamWriter writer = new OutputStreamWriter(data, "UTF-8");
+        writer.write("The quick brown fox jumps over the lazy dog.");
+        writer.close();
+        resource.setProperty("jcr:data", new ByteArrayInputStream(data.toByteArray()));
+        resource.setProperty("jcr:lastModified", Calendar.getInstance());
+
+        testRootNode.save();
+        String xpath = testPath + "/*[jcr:contains(jcr:content, 'lazy')]";
+        executeXPathQuery(xpath, new Node[]{file});
+    }
+
     private void assertFileContains(String name, String type,
             String... statements) throws Exception {
         while (testRootNode.hasNode(nodeName1)) {



Mime
View raw message