@@ -0,0 +1,2134 @@
+package org.corpus_tools.annis.gui.hibernate.type;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertThrows;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.io.IOException;%0Aimport java.io.StringReader;%0Aimport java.net.URI;%0Aimport java.sql.Clob;%0Aimport java.sql.SQLException;%0Aimport org.hibernate.HibernateException;%0Aimport org.hibernate.engine.jdbc.CharacterStream;%0Aimport org.junit.jupiter.api.Test;%0A%0Aclass URITypeDescriptorTest %7B%0A%0A  public final static String TEST_URI_STR = %22/abc%22;%0A  public final static URI TEST_URI = URI.create(%22/abc%22);%0A%0A  @Test%0A  void testFromString() %7B%0A    URITypeDescriptor descriptor = URITypeDescriptor.INSTANCE;%0A    %0A    assertEquals(TEST_URI, descriptor.fromString(TEST_URI_STR));%0A    assertThrows(HibernateException.class, () -%3E descriptor.fromString(%22http:%22));%0A  %7D%0A%0A  @Test%0A  void testUnwrap() %7B%0A    URITypeDescriptor descriptor = URITypeDescriptor.INSTANCE;%0A%0A    assertNull(descriptor.unwrap(null, CharacterStream.class, null));%0A%0A    Object cs = descriptor.unwrap(TEST_URI, CharacterStream.class, null);%0A    assertTrue(cs instanceof CharacterStream);%0A    assertEquals(TEST_URI_STR, ((CharacterStream) cs).asString());%0A%0A    assertThrows(HibernateException.class, () -%3E descriptor.unwrap(TEST_URI, String.class, null));%0A  %7D%0A%0A%0A%0A  @Test%0A  void testWrap() throws SQLException, IOException %7B%0A    URITypeDescriptor descriptor = URITypeDescriptor.INSTANCE;%0A%0A    assertNull(descriptor.wrap(null, null));%0A%0A    Clob clob = mock(Clob.class);%0A%0A    when(clob.getCharacterStream()).thenReturn(new StringReader(TEST_URI_STR));%0A    assertEquals(TEST_URI, descriptor.wrap(clob, null));%0A%0A    assertThrows(HibernateException.class, () -%3E descriptor.wrap(TEST_URI_STR, null));%0A%0A    Clob clob2 = mock(Clob.class);%0A    when(clob2.getCharacterStream()).thenThrow(SQLException.class);%0A    assertThrows(HibernateException.class, () -%3E descriptor.wrap(clob2, null));%0A    %0A    assertThrows(HibernateException.class, () -%3E descriptor.wrap(TEST_URI_STR, null));%0A  %7D%0A%7D%0A

Add more tests for the new URIType