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

How to use
getAncestor
method
in
javax.jcr.Property

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

origin: info.magnolia/magnolia-core

@Override
public Item getAncestor(int depth) throws ItemNotFoundException, AccessDeniedException, RepositoryException {
  return getWrappedProperty().getAncestor(depth);
}
origin: apache/jackrabbit

/**
 * Test if getting the ancestor of negative depth throws an
 * <code>ItemNotFoundException</code>.
 *
 * @throws RepositoryException
 */
public void testGetAncestorOfNegativeDepth() throws RepositoryException {
  try {
    property.getAncestor(-1);
    fail("Getting ancestor of depth < 0 must throw an ItemNotFoundException.");
  } catch (ItemNotFoundException e) {
    // success
  }
}
origin: apache/jackrabbit

/**
 * Test if getting the ancestor of depth = n, where n is greater than depth
 * of this <code>Property</code>, throws an <code>ItemNotFoundException</code>.
 *
 * @throws RepositoryException
 */
public void testGetAncestorOfGreaterDepth() throws RepositoryException {
  try {
    int greaterDepth = property.getDepth() + 1;
    property.getAncestor(greaterDepth);
    fail("Getting ancestor of depth n, where n is greater than depth of" +
        "this Property must throw an ItemNotFoundException");
  } catch (ItemNotFoundException e) {
    // success
  }
}
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: ModeShape/modeshape

@Test
public void secondAncestorOfPropertyShouldBeParentOfParentNode() throws Exception {
  assertThat(newPropertyOnModifiedNode.getAncestor(2), is((Item)newPropertyOnModifiedNode));
  assertThat(modifiedPropertyOnModifiedNode.getAncestor(2), is((Item)modifiedPropertyOnModifiedNode));
  assertThat(unmodifiedPropertyOnModifiedNode.getAncestor(2), is((Item)unmodifiedPropertyOnModifiedNode));
}
origin: ModeShape/modeshape

@Test
public void zerothAncestorOfPropertyShouldBeRootNode() throws Exception {
  assertThat(newPropertyOnModifiedNode.getAncestor(0), is((Item)rootNode));
  assertThat(modifiedPropertyOnModifiedNode.getAncestor(0), is((Item)rootNode));
  assertThat(unmodifiedPropertyOnModifiedNode.getAncestor(0), is((Item)rootNode));
}
origin: ModeShape/modeshape

@Test
public void firstAncestorOfPropertyShouldBeParentNode() throws Exception {
  assertThat(newPropertyOnModifiedNode.getAncestor(1), is((Item)nodeWithModifiedProperty));
  assertThat(modifiedPropertyOnModifiedNode.getAncestor(1), is((Item)nodeWithModifiedProperty));
  assertThat(unmodifiedPropertyOnModifiedNode.getAncestor(1), is((Item)nodeWithModifiedProperty));
}
origin: apache/jackrabbit

public void testRevertInvalidatedMovedTree() throws RepositoryException {
  superuser.refresh(false);
  try {
    childNode.getAncestor(0);
    fail("Reverting move of a new node must remove the tree completely");
  } catch (RepositoryException e) {
    // OK
  }
  try {
    childProperty.getAncestor(0);
    fail("Reverting move of a new node must remove the tree completely");
  } catch (RepositoryException e) {
    // OK
  }
  try {
    grandChildNode.getAncestor(0);
    fail("Reverting move of a new node must remove the tree completely");
  } catch (RepositoryException e) {
    // OK
  }
}
origin: apache/jackrabbit

public void testTreeAncestors() throws RepositoryException {
  int degree = destParentNode.getDepth();
  Item ancestor = childNode.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
  ancestor = childProperty.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
  ancestor = grandChildNode.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
}
origin: apache/jackrabbit

public void testTreeAncestors() throws RepositoryException {
  int degree = destParentNode.getDepth();
  Item ancestor = childNode.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
  ancestor = childProperty.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
  ancestor = grandChildNode.getAncestor(degree);
  assertTrue("Moving a node must move all child items as well.", ancestor.isSame(destParentNode));
}
javax.jcrPropertygetAncestor

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
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Kernel (java.awt.image)
  • Permission (java.security)
    Legacy security code; do not use.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
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