@Override public Object unwrap(Value value) throws RepositoryException { return value.getBoolean(); } @Override
@Override public Object unwrap(Value value) throws RepositoryException { return value.getBoolean(); } @Override
@Override public boolean matches( Value value, JcrSession session ) { try { return constraint == null || (value.getBoolean() && constraint); } catch (RepositoryException e) { return false; } }
@Override public boolean apply(Value value) { try { return value != null && requiredValue != null && value.getBoolean() == requiredValue; } catch (RepositoryException e) { log.warn("Error checking boolean constraint " + this, e); return false; } }
@Override public boolean apply(Value value) { try { return value != null && requiredValue != null && value.getBoolean() == requiredValue; } catch (RepositoryException e) { log.warn("Error checking boolean constraint " + this, e); return false; } }
/** * Returns the boolean value of this property. Implemented as * getValue().getBoolean(). * * {@inheritDoc} */ public boolean getBoolean() throws RepositoryException { return getValue().getBoolean(); }
public boolean getBoolean() throws ValueFormatException, RepositoryException { if (values.length > 1) { throw new ValueFormatException(); } return values[0].getBoolean(); }
/** * @see Property#getBoolean() */ public boolean getBoolean() throws ValueFormatException, RepositoryException { return getValue().getBoolean(); }
/** * @see Property#getBoolean() */ public boolean getBoolean() throws ValueFormatException, RepositoryException { return getValue().getBoolean(); }
/** * Test the persistence of a property modified with an boolean parameter and * saved from the parent Node */ public void testBooleanParent() throws RepositoryException { property1.setValue(value.getBoolean()); node.save(); assertEquals("Boolean property not saved", value.getBoolean(), property1.getValue().getBoolean()); }
/** * Tests conversion from Binary type to Boolean type. This is done via * String conversion. */ public void testGetBoolean() throws RepositoryException { Value val = PropertyUtil.getValue(prop); String str = val.getString(); boolean bool = val.getBoolean(); assertEquals("Wrong conversion from Binary to Boolean.", new Boolean(bool), Boolean.valueOf(str)); }
/** * Tests conversion from String type to Boolean type. */ public void testGetBoolean() throws RepositoryException { Value val = PropertyUtil.getValue(prop); String str = val.getString(); boolean bool = val.getBoolean(); assertEquals("Wrong conversion from String to Boolean.", new Boolean(bool), Boolean.valueOf(str)); }
/** * Test the persistence of a property modified with an BooleanValue * parameter and saved from the Session */ public void testBooleanSession() throws RepositoryException { property1.setValue(value); superuser.save(); assertEquals("Boolean property not saved", value.getBoolean(), property1.getValue().getBoolean()); }
/** * Tests the conversion from a Boolean to a String Value. */ public void testGetString() throws RepositoryException { Value val = PropertyUtil.getValue(prop); String str = val.getString(); String otherStr = new Boolean(val.getBoolean()).toString(); assertEquals("Conversion from a Boolean value to a String value failed.", str, otherStr); }
public boolean apply(User user) { try { Value[] canFly = user.getProperty("canFly"); return canFly != null && canFly.length == 1 && canFly[0].getBoolean(); } catch (RepositoryException e) { fail(e.getMessage()); } return false; } });
public boolean evaluate(User user) { try { Value[] canFly = user.getProperty("canFly"); return canFly != null && canFly.length == 1 && canFly[0].getBoolean(); } catch (RepositoryException e) { fail(e.getMessage()); } return false; } });
@Override protected void setUp() throws Exception { super.setUp(); if (!getHelper().getRepository().getDescriptorValue(Repository.OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED).getBoolean()) { throw new NotExecutableException("node and property with same name is not supported"); } n = testRootNode.addNode(sameName); p = testRootNode.setProperty(sameName, "value"); superuser.save(); }
public boolean apply(User user) { try { Value[] cute = user.getProperty("profile/cute"); Value[] weight = user.getProperty("profile/weight"); return cute != null && cute.length == 1 && cute[0].getBoolean() && weight != null && weight.length == 1 && weight[0].getDouble() > 1000.0; } catch (RepositoryException e) { fail(e.getMessage()); } return false; } });
@Test public void testSetPropertyWithStringAndBoolean() throws Exception { root.setProperty("boolean", false); assertEquals(false, root.getProperty("boolean").getValue().getBoolean()); }
@Test public void testUserManagementDescriptor() throws RepositoryException { Oak oak = new Oak() .with(new InitialContent()) .with(getSecurityProvider()); ContentRepository contentRepository = oak.createContentRepository(); assertFalse(contentRepository.getDescriptors().getValue(JackrabbitRepository.OPTION_USER_MANAGEMENT_SUPPORTED).getBoolean()); }