reschke commented on code in PR #1000:
URL: https://github.com/apache/jackrabbit-oak/pull/1000#discussion_r1237298294
##########
oak-it/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNamespaceRegistryTest.java:
##########
@@ -90,4 +86,37 @@ protected void refresh() {
// expected
}
}
+
+ @Test
+ public void testInvalidNamespace() throws Exception {
+ final ContentSession session = createContentSession();
+ final Root root = session.getLatestRoot();
+ NamespaceRegistry r = getNamespaceRegistry(session, root);
+
+ LogCustomizer customLogs =
LogCustomizer.forLogger("org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry").enable(Level.ERROR).create();
+ try {
+ customLogs.starting();
+ r.registerNamespace("foo", "example.com");
+ r.unregisterNamespace("foo");
+ List<String> myLogs = customLogs.getLogs();
+ assertEquals(1, myLogs.size());
+ assertTrue(myLogs.get(0).contains("Registering invalid namespace
name 'example.com' for prefix 'foo', please see"));
+ }
+ finally {
+ customLogs.finished();
+ }
+ }
+
+ private NamespaceRegistry getNamespaceRegistry(ContentSession session,
Root root) {
Review Comment:
yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]