use of org.apache.jackrabbit.spi.QValueFactory in project jackrabbit by apache.
the class ServiceStubImpl method getRepositoryService.
@Override
public RepositoryService getRepositoryService() throws RepositoryException {
if (service == null) {
String uri = getProperty(PROP_REPOSITORY_URI);
IdFactory idFactory = IdFactoryImpl.getInstance();
NameFactory nFactory = NameFactoryImpl.getInstance();
PathFactory pFactory = PathFactoryImpl.getInstance();
QValueFactory vFactory = QValueFactoryImpl.getInstance();
service = new RepositoryServiceImpl(uri, idFactory, nFactory, pFactory, vFactory);
}
return service;
}
use of org.apache.jackrabbit.spi.QValueFactory in project jackrabbit by apache.
the class BatchTest method testSetStringValue.
public void testSetStringValue() throws RepositoryException {
NodeId nid = getNodeId(testPath);
Name propName = resolver.getQName("stringProp");
QValueFactory vf = rs.getQValueFactory();
List<String> l = new ArrayList<String>();
l.add("String value containing \"double quotes\" and \'single\' and \"undeterminated quote.");
l.add("String value \ncontaining \n\rline \r\nseparators and \t tab.");
l.add("String value containing \r\n\r\r\n\r\n multiple \r\n\r\n line separators in sequence.");
l.add("String value containing >diff -char +act ^ters.");
l.add("String value containing \n>line sep \r+and \r\n-diff\n\r^chars.");
l.add("String value containing سش unicode chars.");
for (String val : l) {
QValue v = vf.create(val, PropertyType.STRING);
Batch b = rs.createBatch(si, nid);
b.addProperty(nid, propName, v);
rs.submit(b);
PropertyInfo pi = getPropertyInfo(nid, propName);
assertEquals(v, pi.getValues()[0]);
assertEquals(v.getString(), pi.getValues()[0].getString());
assertEquals(PropertyType.STRING, pi.getType());
pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
assertEquals(v, pi.getValues()[0]);
assertEquals(v.getString(), pi.getValues()[0].getString());
assertEquals(PropertyType.STRING, pi.getType());
}
}
Aggregations