Tabnine Logo
Property.isSame
Code IndexAdd Tabnine to your IDE (free)

How to use
isSame
method
in
javax.jcr.Property

Best Java code snippets using javax.jcr.Property.isSame (Showing top 20 results out of 315)

origin: apache/jackrabbit

public void visit(Property property)
    throws RepositoryException {
  assertTrue("Visited Property is not the same as the one returned by visit(Property).",
      p.isSame(property));
}
origin: info.magnolia/magnolia-core

@Override
public boolean isSame(Item otherItem) throws RepositoryException {
  return getWrappedProperty().isSame(otherItem);
}
origin: apache/jackrabbit

public void testNewPropertyIsSame() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  Property p = n.setProperty(propertyName1, "anyValue");
  assertTrue(p.isSame(p));
}
origin: apache/jackrabbit

/**
 * Test if the ancestor at depth = n, where n is the depth of this
 * <code>Item</code>, returns this <code>Property</code> itself.
 *
 * @throws RepositoryException
 */
public void testGetAncestorOfItemDepth() throws RepositoryException {
  Property propertyAtDepth = (Property) property.getAncestor(property.getDepth());
  assertTrue("The ancestor of depth = n, where n is the depth of this " +
      "Property must be the item itself.", property.isSame(propertyAtDepth));
}
origin: apache/jackrabbit

/**
 * <code>Node.getProperty("./jcr:primaryType") </code> applied to any
 * test node must return the same Property as
 * {@link Node#getProperty(String) Node.getProperty("jcr:primaryType")}.
 *
 * @throws RepositoryException
 */
public void testGetPropertyDotSlashName() throws RepositoryException {
  Property pt = testRootNode.getProperty(jcrPrimaryType);
  String otherRelPath = DOT + "/" + jcrPrimaryType;
  assertTrue(pt.isSame(testRootNode.getProperty(otherRelPath)));
}
origin: apache/jackrabbit-oak

@Test
public void testGetProperty() throws Exception {
  assertTrue(p.isSame(testRootNode.getProperty(sameName)));
  assertFalse(p.isSame(n));
}
origin: apache/jackrabbit

public void testNewProperty() throws RepositoryException {
  Property p = testRootNode.setProperty(propertyName1, testValue);
  testRootNode.refresh(true);
  // p must still be accessible
  p.getString();
  assertTrue("Refresh 'true' must not affect a new Property.", testRootNode.hasProperty(propertyName1));
  Property pAgain = testRootNode.getProperty(propertyName1);
  assertTrue("Refresh 'true' must not affect a new Property.", p.isSame(pAgain));
}
origin: apache/jackrabbit

public void testShadowingItems2() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  Node n2 = testRootNode.addNode(nodeName2, testNodeType);
  Property p = n.setProperty(propertyName1, "anyValue");
  testRootNode.getSession().move(n.getPath(), n2.getPath() + "/destination");
  Node replaceNode = testRootNode.addNode(nodeName1, testNodeType);
  Property replaceProp = replaceNode.setProperty(propertyName1, "anyValue");
  assertFalse(replaceNode.isSame(n));
  assertFalse(replaceProp.isSame(p));
}
origin: apache/jackrabbit

public void testShadowingItems() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  Node n2 = testRootNode.addNode(nodeName2, testNodeType);
  Property p = n.setProperty(propertyName1, "anyValue");
  testRootNode.save();
  testRootNode.getSession().move(n.getPath(), n2.getPath() + "/destination");
  Node replaceNode = testRootNode.addNode(nodeName1, testNodeType);
  Property replaceProp = replaceNode.setProperty(propertyName1, "anyValue");
  assertFalse(replaceNode.isSame(n));
  assertFalse(replaceProp.isSame(p));
}
origin: apache/jackrabbit

public void testShadowingItems3() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  Property p = n.setProperty(propertyName1, "anyValue");
  testRootNode.save();
  p.remove();
  Property p2 = n.setProperty(propertyName1, "anyValue");
  try {
    assertFalse(p2.isSame(p));
  } catch (InvalidItemStateException e) {
    // ok as well.
  }
}
origin: apache/jackrabbit

public void testDifferentItemType() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  Property p = n.setProperty(propertyName1, "anyValue");
  assertFalse(p.isSame(n));
  assertFalse(n.isSame(p));
}
origin: apache/jackrabbit

public void testSameInstanceIsSame() throws RepositoryException {
  assertTrue(testRootNode.isSame(testRootNode));
  Property p = testRootNode.getProperty(jcrPrimaryType);
  assertTrue(p.isSame(p));
}
origin: apache/jackrabbit

public void testNewNode() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName2);
  Property p = n.setProperty(propertyName1, testValue);
  testRootNode.refresh(true);
  // n must still be new and accessible
  String msg = "Refresh 'true' must not affect the new Node/Property.";
  assertTrue(msg, testRootNode.hasNode(nodeName2));
  assertTrue(msg, n.isNew());
  assertTrue(msg, n.hasProperty(propertyName1));
  // p must still be accessible
  p.getString();
  assertTrue(msg, p.isSame(n.getProperty(propertyName1)));
}
origin: apache/jackrabbit

public void testPropertyAccessibleAfterSave() throws NotExecutableException, RepositoryException {
  Property p;
  try {
    p = testRootNode.setProperty(propname, "anyValue");
  } catch (RepositoryException e) {
    throw new NotExecutableException();
  }
  // check if p is valid and can be accessed from the parent node.
  String name = p.getName();
  assertEquals("Added property must have the original name", name, propname);
  assertTrue("Accessing the created property again must return the 'same' item.", p.isSame(testRootNode.getProperty(propname)));
}
origin: apache/jackrabbit-oak

@Test
public void testGetItem() throws Exception {
  Item item = superuser.getItem(n.getPath());
  if (item.isNode()) {
    assertTrue(n.isSame(item));
  } else {
    assertTrue(p.isSame(item));
  }
}
origin: apache/jackrabbit-oak

@Test
public void testIsSame() throws Exception {
  assertFalse(n.isSame(p));
  assertFalse(p.isSame(n));
}
origin: ModeShape/modeshape

@Test
public void shouldReturnFalseFromIsSameIfTheWorkspaceNameIsDifferent() throws Exception {
  // Use the same id and location; use 'Toyota Prius'
  String priusUuid2 = prius2.getIdentifier();
  String priusUuid = prius.getIdentifier();
  assertThat(priusUuid, is(priusUuid2));
  assertThat(prius2.isSame(prius), is(false));
  // Check the properties ...
  javax.jcr.Property model = prius.getProperty("car:model");
  javax.jcr.Property model2 = prius2.getProperty("car:model");
  assertThat(model.isSame(model2), is(false));
}
origin: apache/jackrabbit-oak

@Test
public void testSessionGetProperty() throws Exception {
  Property pp = superuser.getProperty(p.getPath());
  assertTrue(p.isSame(pp));
}
origin: apache/jackrabbit

public void testTreeEntries() throws RepositoryException {
  Item item = superuser.getItem(destinationPath + "/" + nodeName2);
  assertTrue("Moving a node must move all child items as well.", childNode.isSame(item));
  item = superuser.getItem(destinationPath + "/" + propertyName2);
  assertTrue("Moving a node must move all child items as well.", childProperty.isSame(item));
  item = superuser.getItem(destinationPath + "/" + nodeName2 + "/" + nodeName3);
  assertTrue("Moving a node must move all child items as well.", grandChildNode.isSame(item));
}
origin: apache/jackrabbit

public void testTreeEntries() throws RepositoryException {
  Item item = superuser.getItem(destinationPath + "/" + nodeName2);
  assertTrue("Moving a node must move all child items as well.", childNode.isSame(item));
  item = superuser.getItem(destinationPath + "/" + propertyName2);
  assertTrue("Moving a node must move all child items as well.", childProperty.isSame(item));
  item = superuser.getItem(destinationPath + "/" + nodeName2 + "/" + nodeName3);
  assertTrue("Moving a node must move all child items as well.", grandChildNode.isSame(item));
}
javax.jcrPropertyisSame

Popular methods of Property

  • getString
    Returns a String representation of the value of this property. A shortcut for Property.getValue().g
  • getValues
    Returns an array of all the values of this property. Used to access multi-value properties. The arra
  • getValue
    Returns the value of this property as a Value object. The object returned is a copy of the stored va
  • getName
  • getType
    Returns the type of this Property. One of: * PropertyType.STRING * PropertyType.BINARY * Property
  • getBinary
    Returns a Binary representation of the value of this property. A shortcut for Property.getValue().g
  • getBoolean
    Returns a boolean representation of the value of this property. A shortcut for Property.getValue().
  • remove
  • isMultiple
    Returns true if this property is multi-valued andfalse if this property is single-valued.
  • getDate
    Returns a Calendar representation of the value of this property. A shortcut for Property.getValue()
  • getLong
    Returns a long representation of the value of this property. A shortcut for Property.getValue().get
  • getDefinition
    Returns the property definition that applies to this property. In some cases there may appear to be
  • getLong,
  • getDefinition,
  • setValue,
  • getParent,
  • getPath,
  • getNode,
  • getLength,
  • getDouble,
  • getStream,
  • getSession

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now