Author: reschke
Date: Wed Feb 14 15:50:41 2018
New Revision: 1824252
URL: http://svn.apache.org/viewvc?rev=1824252&view=rev
Log:
OAK-7269: DocumentStore: add test coverage for various types of IDs
more minor improvements
Modified:
jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
Modified:
jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java?rev=1824252&r1=1824251&r2=1824252&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
(original)
+++
jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
Wed Feb 14 15:50:41 2018
@@ -681,10 +681,10 @@ public class BasicDocumentStoreTest exte
@Test
@Ignore("OAK-7261")
public void testInterestingInvalidIds() {
- // OAK-7261
+ // see OAK-7261
assumeTrue("fails on MongoDocumentStore, see OAK-7271", !(dsf
instanceof DocumentStoreFixture.MongoFixture));
- String[] tests = new String[] {"nul:a\u0000b",
"brokensurrogate:\ud800" };
+ String[] tests = new String[] { "nul:a\u0000b",
"brokensurrogate:\ud800" };
for (String t : tests) {
int pos = t.indexOf(":");
@@ -693,8 +693,7 @@ public class BasicDocumentStoreTest exte
try {
super.ds.remove(Collection.NODES, id);
- }
- catch (DocumentStoreException acceptable) {
+ } catch (DocumentStoreException acceptable) {
// it would be acceptable to reject the delete request due to
// malformed string (for instance, PostgreSQL behaves like
that)
}
@@ -702,15 +701,16 @@ public class BasicDocumentStoreTest exte
UpdateOp up = new UpdateOp(id, true);
boolean success = super.ds.create(Collection.NODES,
Collections.singletonList(up));
- // failing to persist is ok - otherwise proceed with consistency
tests
+ // failing to persist is ok - otherwise proceed with consistency
+ // tests
if (success) {
// re-read from persistence
super.ds.invalidateCache();
NodeDocument nd = super.ds.find(Collection.NODES, id);
assertEquals("failure to round-trip " + t + " through " +
super.dsname, id, nd.getId());
- // if the character does not round-trip through UTF-8, try to
delete
- // the remapped one and do another lookup
+ // if the character does not round-trip through UTF-8, try to
+ // delete the remapped one and do another lookup
if (!roundtripsThroughJavaUTF8(id)) {
Charset utf8 = Charset.forName("UTF-8");
String mapped = new String(id.getBytes(utf8), utf8);