Search in sources :

Example 6 with Handle

use of org.opencastproject.mediapackage.identifier.Handle in project opencast by opencast.

the class HandleBuilderTest method testCreateNew.

/**
 * Test method for {@link org.opencastproject.mediapackage.identifier.HandleBuilderImpl#createNew()} .
 */
@Test
public void testCreateNew() {
    Handle handle = null;
    try {
        handle = handleBuilder.createNew();
        newHandles.add(handle);
        assertNotNull(handle);
        assertNotNull(handle.getNamingAuthority());
        assertNotNull(handle.getLocalName());
        assertNotNull(handle.resolve());
    } catch (HandleException e) {
        fail("Error creating handle: " + e.getMessage());
    }
}
Also used : HandleException(org.opencastproject.mediapackage.identifier.HandleException) Handle(org.opencastproject.mediapackage.identifier.Handle) Test(org.junit.Test)

Example 7 with Handle

use of org.opencastproject.mediapackage.identifier.Handle in project opencast by opencast.

the class HandleTest method testCompact.

/**
 * Test method for {@link org.opencastproject.mediapackage.identifier.HandleImpl#compact()} .
 */
@Test
public void testCompact() {
    String hdlValue = "10.0001/abcde/test";
    Handle handle = handleBuilder.fromString(hdlValue);
    assertEquals("10.0001-abcde-test", handle.compact());
}
Also used : Handle(org.opencastproject.mediapackage.identifier.Handle) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 Handle (org.opencastproject.mediapackage.identifier.Handle)7 HandleException (org.opencastproject.mediapackage.identifier.HandleException)5 URL (java.net.URL)3 MalformedURLException (java.net.MalformedURLException)2