/** * @see javax.jcr.observation.Event#getIdentifier() */ public String getIdentifier() throws RepositoryException { ItemId itemId = event.getItemId(); if (itemId == null) { return null; } else { NodeId nodeId = (itemId.denotesNode()) ? (NodeId) itemId : ((PropertyId) itemId).getParentId(); return idFactory.toJcrIdentifier(nodeId); } }
public QNodeDefinition getRootNodeDefinition() throws RepositoryException { if (rootNodeDefinition == null) { IdFactory idFactory = service.getIdFactory(); PathFactory pf = service.getPathFactory(); rootNodeDefinition = service.getNodeDefinition( sessionInfo, idFactory.createNodeId((String) null, pf.getRootPath())); } return rootNodeDefinition; }
protected void setUp() throws Exception { super.setUp(); RepositoryService service = helper.getRepositoryService(); factory = service.getQValueFactory(); rootPath = service.getPathFactory().getRootPath(); testName = service.getNameFactory().create(Name.NS_JCR_URI, "data"); reference = getProperty("reference"); }
protected void setUp() throws Exception { super.setUp(); RepositoryService service = helper.getRepositoryService(); factory = service.getQValueFactory(); rootPath = service.getPathFactory().getRootPath(); testName = service.getNameFactory().create(Name.NS_JCR_URI, "data"); reference = getProperty("reference"); }
public void testDateValueEquality2() throws RepositoryException { QValue v = factory.create(CALENDAR); QValue otherV = factory.create(v.getString(), PropertyType.DATE); assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV); }
public void testNullWorkspaceName() throws RepositoryException { SessionInfo sInfo = service.obtain(helper.getAdminCredentials(), null); try { assertNotNull(sInfo.getWorkspaceName()); } finally { service.dispose(sInfo); } }
public void testDateValueType() throws RepositoryException { QValue v = factory.create(calendar); assertTrue("Type of a date value must be PropertyType.DATE", v.getType() == PropertyType.DATE); } public void testDateValueEquality() throws RepositoryException {
public void testReadBooleanAsLong() throws RepositoryException { try { QValue v = factory.create(true); v.getLong(); } catch (ValueFormatException e) { return; // ok } assertTrue("Cannot convert value to long", false); }
public void testReadBooleanAsLong() throws RepositoryException { try { QValue v = factory.create(true); v.getLong(); } catch (ValueFormatException e) { return; // ok } assertTrue("Cannot convert value to long", false); }
protected void setUp() throws Exception { super.setUp(); workspaceName = getProperty(RepositoryServiceStub.PROP_WORKSPACE); sessionInfo = helper.getRepositoryService().obtain(helper.getAdminCredentials(), workspaceName); }
public SessionInfo getAdminSessionInfo() throws RepositoryException { // force assignment of repoStub getRepositoryService(); String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE; String wspName = repoServiceStub.getProperty(propName); return getRepositoryService().obtain(getAdminCredentials(), wspName); }
protected void tearDown() throws Exception { if (sessionInfo != null) { helper.getRepositoryService().dispose(sessionInfo); } super.tearDown(); }
public SessionInfo getReadOnlySessionInfo() throws RepositoryException { // force assignment of repoStub getRepositoryService(); String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE; String wspName = repoServiceStub.getProperty(propName); return getRepositoryService().obtain(getReadOnlyCredentials(), wspName); } }
/** * @see javax.jcr.observation.Event#getIdentifier() */ public String getIdentifier() throws RepositoryException { ItemId itemId = event.getItemId(); if (itemId == null) { return null; } else { NodeId nodeId = (itemId.denotesNode()) ? (NodeId) itemId : ((PropertyId) itemId).getParentId(); return idFactory.toJcrIdentifier(nodeId); } }