@Override
public Void call() throws Exception {
Session session = repository.login();
final NamespaceRegistry namespaceRegistry = (NamespaceRegistry)session.getWorkspace().getNamespaceRegistry();
namespaceRegistry.registerNamespace("info:a#");
namespaceRegistry.registerNamespace("info:b#");
namespaceRegistry.registerNamespace("info:c#");
assertEquals("ns001", namespaceRegistry.getPrefix("info:a#"));
assertEquals("ns002", namespaceRegistry.getPrefix("info:b#"));
assertEquals("ns003", namespaceRegistry.getPrefix("info:c#"));
final Node node = session.getRootNode().addNode("ns001:xyz", NodeType.NT_UNSTRUCTURED);
node.setProperty("ns002:abc", "abc");
node.setProperty("ns003:def", "def");
session.save();
session.logout();
return null;
}
}, repositoryConfigFile);
startRunStop(new RepositoryOperation() {
@Override
public Void call() throws Exception {
Session session = repository.login();
final NamespaceRegistry namespaceRegistry = (NamespaceRegistry)session.getWorkspace().getNamespaceRegistry();
assertEquals("ns001", namespaceRegistry.getPrefix("info:a#"));
assertEquals("ns002", namespaceRegistry.getPrefix("info:b#"));
assertEquals("ns003", namespaceRegistry.getPrefix("info:c#"));
session.save();
session.logout();
return null;
}
}, repositoryConfigFile);