public void testNullPathValue() throws IOException, RepositoryException { try { factory.create((Path) null); fail(); } catch (RuntimeException e) { // ok } }
public void testInvalidPathValue() throws RepositoryException { try { factory.create("abc", PropertyType.PATH); fail("'abc' is not a valid Path -> creating QValue should fail."); } catch (ValueFormatException e) { // ok } }
public void testCreateInvalidDoubleValue() throws RepositoryException { try { factory.create("any", PropertyType.DOUBLE); fail("'any' cannot be converted to a valid double value."); } catch (ValueFormatException e) { // ok } }
public void testNullReferenceValue() throws IOException, RepositoryException { try { factory.create(null, PropertyType.REFERENCE); fail(); } catch (RuntimeException e) { // ok } }
public void testNullNameValue() throws IOException, RepositoryException { try { factory.create((Name) null); fail(); } catch (RuntimeException e) { // ok } }
public void testInvalidNameValue() throws RepositoryException { try { factory.create("abc", PropertyType.NAME); fail("'abc' is not a valid Name -> creating QValue should fail."); } catch (ValueFormatException e) { // ok } }
public void testIllegalType() throws RepositoryException { try { factory.create("any", 54); fail("54 is not a valid property type"); } catch (IllegalArgumentException e) { // ok } }
public void testCreateInvalidLongValue() throws RepositoryException { try { factory.create("any", PropertyType.LONG); fail("'any' cannot be converted to a valid long value."); } catch (ValueFormatException e) { // ok } }
public void testNullBinaryValue() throws IOException, RepositoryException { try { factory.create((byte[]) null); fail(); } catch (RuntimeException e) { // ok } try { factory.create((InputStream) null); fail(); } catch (RuntimeException e) { // ok } try { factory.create((File) null); fail(); } catch (RuntimeException e) { // ok } }
public void testAnyValueGetPath() throws RepositoryException { try { factory.create(12345).getPath(); fail("12345 is not a valid Path value -> QValue.getPath() should fail."); } catch (ValueFormatException e) { // ok } }
public void testGetLongOnBooleanValue() throws RepositoryException { try { QValue v = factory.create(true); v.getLong(); fail("'true' cannot be converted to a valid long value."); } catch (ValueFormatException e) { // ok } }
public void testGetDoubleOnBooleanValue() throws RepositoryException { try { QValue v = factory.create(true); v.getDouble(); fail("'true' cannot be converted to a valid double value."); } catch (ValueFormatException e) { // ok } }
public void testAnyValueGetName() throws RepositoryException { try { factory.create(12345).getName(); fail("12345 is not a valid Name value -> QValue.getName() should fail."); } catch (ValueFormatException e) { // ok } }