Skip to content

Commit 7cbdeaa

Browse files
committed
OAK-11561: Oak to Jcr name conversion is behaving inconsistently
Corrected test case.
1 parent 9eb1eb3 commit 7cbdeaa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import static org.junit.Assert.assertFalse;
2828
import static org.junit.Assert.assertNotNull;
2929
import static org.junit.Assert.assertThat;
30+
import static org.junit.Assert.assertThrows;
3031
import static org.junit.Assert.assertTrue;
3132
import static org.junit.Assert.fail;
3233
import static org.junit.Assume.assumeTrue;
@@ -2348,6 +2349,7 @@ protected void append(ILoggingEvent e) {
23482349
}
23492350

23502351
@Test
2352+
@Ignore("OAK-11561")
23512353
public void testConsistencyOfNameConversion() throws RepositoryException {
23522354
NamespaceRegistry namespaceRegistry = getAdminSession().getWorkspace().getNamespaceRegistry();
23532355
Root root = new RootProviderService().createReadOnlyRoot(EmptyNodeState.EMPTY_NODE);
@@ -2366,14 +2368,14 @@ public void testConsistencyOfNameConversion() throws RepositoryException {
23662368
namespaceRegistry.registerNamespace("sample", "http://www.example.com");
23672369
namespaceRegistry.registerNamespace("globalPrefix", "http://www.secondexample.com");
23682370

2369-
//should fail (but doesn't, see OAK-xyz), because the prefix foo is not registered
2370-
assertEquals("foo:bar", sessionContext.getJcrName("foo:bar"));
2371+
//should fail, because the prefix foo is not registered
2372+
assertThrows(IllegalStateException.class, () -> sessionContext.getJcrName("foo:bar"));
23712373

23722374
//create a local mapping for a completely unrelated namespace
23732375
sessionContext.getSession().setNamespacePrefix("localPrefix", "http://www.secondexample.com");
23742376

2375-
//Now (in the presence of a local re-mapping) it will fail
2376-
assertEquals("foo:bar", sessionContext.getJcrName("foo:bar"));
2377+
//verify that the behavior of getJcrName did not change
2378+
assertThrows(IllegalStateException.class, () -> sessionContext.getJcrName("foo:bar"));
23772379
}
23782380

23792381
private static ch.qos.logback.classic.Logger rootLogger() {

0 commit comments

Comments
 (0)