use of org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver in project jackrabbit by apache.
the class PropertyDefinitionTemplateImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
tmpl = new PropertyDefinitionTemplateImpl(resolver);
}
use of org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver in project jackrabbit by apache.
the class PathFactoryTest method setUp.
protected void setUp() throws Exception {
super.setUp();
factory = PathFactoryImpl.getInstance();
NamespaceResolver nsresolver = new NamespaceResolver() {
public String getURI(String prefix) throws NamespaceException {
throw new UnsupportedOperationException();
}
public String getPrefix(String uri) throws NamespaceException {
if (uri.equals(Name.NS_JCR_URI)) {
return Name.NS_JCR_PREFIX;
} else {
return uri;
}
}
};
resolver = new DefaultNamePathResolver(nsresolver);
}
use of org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver in project jackrabbit by apache.
the class ParserTest method setUp.
protected void setUp() throws Exception {
super.setUp();
NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
QueryObjectModelFactoryImpl factory = new QOMF(resolver);
ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
parser = new Parser(factory, vf);
}
use of org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver in project jackrabbit by apache.
the class ValueFormatTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
idResolver = new IdentifierResolver() {
public Path getPath(String identifier) throws MalformedPathException {
throw new UnsupportedOperationException();
}
public void checkFormat(String identifier) throws MalformedPathException {
// nop
}
};
NameResolver nResolver = new ParsingNameResolver(NameFactoryImpl.getInstance(), new DummyNamespaceResolver());
PathResolver pResolver = new ParsingPathResolver(PathFactoryImpl.getInstance(), nResolver, idResolver);
resolver = new DefaultNamePathResolver(nResolver, pResolver);
qvFactory = QValueFactoryImpl.getInstance();
vFactory = new ValueFactoryQImpl(qvFactory, resolver);
}
use of org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver in project jackrabbit by apache.
the class DavPropertyTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
repoURI = helper.getProperty(ServiceStubImpl.PROP_REPOSITORY_URI);
rs = (RepositoryServiceImpl) helper.getRepositoryService();
si = helper.getAdminSessionInfo();
NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
public String getURI(String prefix) {
return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
}
public String getPrefix(String uri) {
return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
}
};
resolver = new DefaultNamePathResolver(nsResolver);
try {
rs.getNodeInfo(si, getNodeId(testPath));
} catch (RepositoryException e) {
Batch b = rs.createBatch(si, getNodeId("/"));
b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null);
QValueFactory qvf = rs.getQValueFactory();
b.addProperty(getNodeId("/test"), resolver.getQName("prop"), qvf.create("value", PropertyType.STRING));
b.addProperty(getNodeId("/test"), resolver.getQName("propMV"), new QValue[] { qvf.create(1), qvf.create(2) });
rs.submit(b);
}
}
Aggregations