URITypeDescriptor extends AbstractTypeDescriptor<URI> { public URI fromString(final String string) { try { return UriBuilder.fromUri(string).build(); } catch (Exception e) { throw new HibernateException( "Unable to convert string [" + string + "] to URI : " + e); } } URITypeDescriptor(); String toString(final URI value); URI fromString(final String string); @SuppressWarnings({"unchecked"}) X unwrap(final URI value,
                        final Class<X> type,
                        final WrapperOptions options); URI wrap(final X value, final WrapperOptions options); static final URITypeDescriptor INSTANCE; }
@Test public void testFromString() { URI result = URITypeDescriptor.INSTANCE .fromString("http: assertEquals(testUri, result); }
@Test(expected = HibernateException.class) public void testFromStringNull() { URITypeDescriptor.INSTANCE.fromString(null); }