[exo-jcr-commits] exo-jcr SVN: r1521 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/lab/cluster/test and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jan 21 06:53:47 EST 2010
Author: pnedonosko
Date: 2010-01-21 06:53:46 -0500 (Thu, 21 Jan 2010)
New Revision: 1521
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
Log:
EXOJCR-404 test and TODO
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-01-21 09:34:18 UTC (rev 1520)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-01-21 11:53:46 UTC (rev 1521)
@@ -265,6 +265,7 @@
// write canonical file path
if (file != null)
{
+ // TODO for tests byte[] buf = file.getPath().getBytes("UTF-8");
byte[] buf = file.getCanonicalPath().getBytes("UTF-8");
out.writeInt(buf.length);
out.write(buf);
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java 2010-01-21 09:34:18 UTC (rev 1520)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java 2010-01-21 11:53:46 UTC (rev 1521)
@@ -7,28 +7,19 @@
import java.io.InputStream;
import java.util.Calendar;
-import javax.jcr.ItemExistsException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
-import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
-import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.version.VersionException;
public class TestBLOBValue extends JcrAPIBaseTest
{
private static final String TEST_ROOT_NAME = "TestBLOBValue";
- private static final int FILE_SIZE_KB = 10 * 1024;
+ private static final int FILE_SIZE_KB = 512;
- private static final int FILES_COUNT = 1024;
+ private static final int FILES_COUNT = 10;
- private static final String FILE_PATH = "F:/Books/jboss/Manning JBoss in Action Jan 2009.pdf";
-
private static File testFile;
private Node testRoot;
@@ -71,7 +62,6 @@
if (testFile == null)
{
testFile = createBLOBTempFile(FILE_SIZE_KB);
- //testFile = new File(FILE_PATH);
}
}
@@ -95,13 +85,13 @@
testRoot.save();
}
- //testRoot.remove();
- //root.save();
+ testRoot.remove();
+ root.save();
- //super.tearDown();
+ super.tearDown();
}
- public void _testAddProperty() throws Exception
+ public void testAddProperty() throws Exception
{
// write
Property text = testRoot.setProperty("text", "string property");
@@ -129,6 +119,7 @@
assertEquals(testFile.length(), size);
}
+ // for read on another node of a cluster
public void _testReadProperty() throws Exception
{
// read
@@ -154,7 +145,7 @@
for (int i = 0; i < FILES_COUNT; i++)
{
File blob = createBLOBTempFile(size);
- addNTFile("node" + i, blob);
+ addNTFile("file" + i, blob);
size += 1;
}
@@ -164,7 +155,8 @@
// it's ready for read
}
- public void testReadNTFiles() throws Exception
+ // for read on another node of a cluster
+ public void _testReadNTFiles() throws Exception
{
// read series of FILES_COUNT were added each with size + 1K bytes
int size = FILE_SIZE_KB;
@@ -189,10 +181,5 @@
size += 1;
}
}
-
- public void testUpdateProperty() throws Exception
- {
-
- }
-
}
+
More information about the exo-jcr-commits
mailing list