Author: pnedonosko
Date: 2010-01-19 09:53:19 -0500 (Tue, 19 Jan 2010)
New Revision: 1482
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
Log:
EXOJCR-404 test in lab
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java 2010-01-19
14:53:19 UTC (rev 1482)
@@ -0,0 +1,66 @@
+package org.exoplatform.services.jcr.lab.cluster.test;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.Session;
+
+public class TestBLOBValue extends JcrAPIBaseTest
+{
+
+ private Node testRoot;
+
+ private static File testFile;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ testRoot = root.addNode("TestBLOBValue");
+ root.save();
+
+ if (testFile == null)
+ {
+ testFile = createBLOBTempFile(1020); // 1MB
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ testRoot.remove();
+ root.save();
+
+ super.tearDown();
+ }
+
+ public void testAddProperty() throws Exception
+ {
+ // write
+ Property text = testRoot.setProperty("text", "string
property");
+
+ FileInputStream fis = new FileInputStream(testFile);
+ Property blob = testRoot.setProperty("blob", fis);
+
+ testRoot.save();
+ fis.close();
+
+ // read
+ Session user1 = repository.login(credentials,
root.getSession().getWorkspace().getName());
+ Node troot = user1.getRootNode().getNode("TestBLOBValue");
+ Property tblob = troot.getProperty("blob");
+ InputStream blobStream = tblob.getStream();
+ }
+
+ public void testUpdateProperty() throws Exception
+ {
+
+ }
+
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Show replies by date