Search in sources :

Example 26 with PID

use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.

the class PIDsTest method getPidFromRepositoryPathWithWhitespace.

@Test
public void getPidFromRepositoryPathWithWhitespace() {
    String path = fakeRepositoryPath(CONTENT_BASE, null);
    String paddedPath = "  " + path + " ";
    PID pid = PIDs.get(path);
    assertNotNull(pid);
    assertEquals("Identifier did not match provided value", TEST_UUID, pid.getId());
    assertEquals("Repository path was incorrect", path, pid.getRepositoryUri().toString());
    assertEquals("Incorrect qualifier", CONTENT_BASE, pid.getQualifier());
    assertNull("Component path should not be set", pid.getComponentPath());
}
Also used : PID(edu.unc.lib.boxc.model.api.ids.PID) Test(org.junit.Test)

Example 27 with PID

use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.

the class PIDsTest method getContentBaseTest.

@Test
public void getContentBaseTest() {
    String path = FEDORA_BASE + CONTENT_BASE;
    PID pid = PIDs.get(path);
    assertEquals(path, pid.getRepositoryPath());
    assertEquals(CONTENT_BASE, pid.getId());
    assertEquals(REPOSITORY_ROOT_ID, pid.getQualifier());
}
Also used : PID(edu.unc.lib.boxc.model.api.ids.PID) Test(org.junit.Test)

Example 28 with PID

use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.

the class PIDsTest method getInvalidUUIDPathWithoutHashedContainersTest.

@Test
public void getInvalidUUIDPathWithoutHashedContainersTest() {
    String path = FEDORA_BASE + CONTENT_BASE + "/" + TEST_UUID;
    PID pid = PIDs.get(path);
    assertNull(pid);
}
Also used : PID(edu.unc.lib.boxc.model.api.ids.PID) Test(org.junit.Test)

Example 29 with PID

use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.

the class PIDsTest method getRootTest.

@Test
public void getRootTest() {
    String path = FEDORA_BASE;
    PID pid = PIDs.get(path);
    assertEquals(path, pid.getRepositoryPath());
    assertEquals(REPOSITORY_ROOT_ID, pid.getId());
    assertEquals(REPOSITORY_ROOT_ID, pid.getQualifier());
}
Also used : PID(edu.unc.lib.boxc.model.api.ids.PID) Test(org.junit.Test)

Example 30 with PID

use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.

the class PIDsTest method getReservedPidFromPathTest.

@Test
public void getReservedPidFromPathTest() {
    String qualified = CONTENT_BASE + "/" + CONTENT_ROOT_ID;
    String expectedPath = FEDORA_BASE + qualified;
    PID pid = PIDs.get(expectedPath);
    verifyReservedPid(pid, qualified, expectedPath, null);
}
Also used : PID(edu.unc.lib.boxc.model.api.ids.PID) Test(org.junit.Test)

Aggregations

PID (edu.unc.lib.boxc.model.api.ids.PID)735 Test (org.junit.Test)509 Model (org.apache.jena.rdf.model.Model)130 Resource (org.apache.jena.rdf.model.Resource)122 Bag (org.apache.jena.rdf.model.Bag)100 Matchers.anyString (org.mockito.Matchers.anyString)89 RoleAssignment (edu.unc.lib.boxc.auth.api.models.RoleAssignment)85 MvcResult (org.springframework.test.web.servlet.MvcResult)78 CollectionObject (edu.unc.lib.boxc.model.api.objects.CollectionObject)65 RepositoryObject (edu.unc.lib.boxc.model.api.objects.RepositoryObject)63 AdminUnit (edu.unc.lib.boxc.model.api.objects.AdminUnit)62 WorkObject (edu.unc.lib.boxc.model.api.objects.WorkObject)62 URI (java.net.URI)62 FileObject (edu.unc.lib.boxc.model.api.objects.FileObject)61 AbstractDepositJobTest (edu.unc.lib.boxc.deposit.fcrepo4.AbstractDepositJobTest)55 BinaryObject (edu.unc.lib.boxc.model.api.objects.BinaryObject)50 Document (org.jdom2.Document)50 FolderObject (edu.unc.lib.boxc.model.api.objects.FolderObject)48 File (java.io.File)48 Path (java.nio.file.Path)48