[exo-jcr-commits] exo-jcr SVN: r1934 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/i18n.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Feb 22 08:26:46 EST 2010
Author: tolusha
Date: 2010-02-22 08:26:46 -0500 (Mon, 22 Feb 2010)
New Revision: 1934
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/i18n/TestI18nValues.java
Log:
EXOJCR-530: add testLongItem
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/i18n/TestI18nValues.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/i18n/TestI18nValues.java 2010-02-22 10:12:55 UTC (rev 1933)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/i18n/TestI18nValues.java 2010-02-22 13:26:46 UTC (rev 1934)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
import javax.jcr.Node;
import javax.jcr.Property;
@@ -126,6 +127,36 @@
}
}
+ public void setLongItem(String item, String source) throws RepositoryException
+ {
+
+ if (log.isDebugEnabled())
+ log.debug("String as string value: '" + source + "'");
+
+ try
+ {
+ testNode.setProperty(item, source);
+ testNode.save();
+ }
+ catch (RepositoryException e)
+ {
+ fail("Error create proeprty '" + item + "': " + e);
+ }
+
+ Session session1 = repository.login(credentials, WORKSPACE);
+ Node test = session1.getRootNode().getNode(TEST_I18N);
+
+ try
+ {
+ Property prop = test.getProperty(item);
+ assertEquals("Content must be identical", prop.getString(), source);
+ }
+ catch (RepositoryException e)
+ {
+ fail("Error read property '" + item + "': " + e);
+ }
+ }
+
/**
* Tests property values with I18n content stored in BINARY values using
* Node.setProperty(String, String, int) method
@@ -451,4 +482,11 @@
s1.logout();
}
+ public void testLongItem() throws RepositoryException
+ {
+ char item[] = new char[500];
+ Arrays.fill(item, '0');
+
+ setLongItem(new String(item), TEST_I18N_CONTENT_CYR);
+ }
}
More information about the exo-jcr-commits
mailing list