Examples of FedoraAPIMMTOM


Examples of org.fcrepo.server.management.FedoraAPIMMTOM

        client.shutdown();
    }

    public static void ingestDemoObjects(FedoraClient client, String... paths) throws Exception {
        FedoraAPIAMTOM apia = client.getAPIAMTOM();
        FedoraAPIMMTOM apim = client.getAPIMMTOM();
        ingestDemoObjects(apia, apim, paths);
    }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

        purgeDemoObjects(client);
        client.shutdown();
    }
   
    public static void purgeDemoObjects(FedoraClient client) throws Exception {
        FedoraAPIMMTOM apim = client.getAPIMMTOM();
        for (String pid : getDemoObjects(client)) {
            AutoPurger.purge(apim, pid, null);
        }
    }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
        FedoraAPIMMTOM apim = s_client.getAPIMMTOM();
        AutoPurger.purge(apim, SDEP_1_PID, null);
        AutoPurger.purge(apim, SDEP_2_PID, null);
    }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

    }

    /* Assure that listMethods works without sDeps */
    @Test
    public void testListMethodsWithoutSDeps() throws Exception {
        FedoraAPIMMTOM apim = s_client.getAPIMMTOM();
        AutoPurger.purge(apim, "demo:simple-deployment.sdep.1", null);
        AutoPurger.purge(apim, "demo:simple-deployment.sdep.2", null);
        try {
            testListMethods();
        } finally {
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

                               result);
    }

    @Test
    public void testListRecords() throws Exception {
        FedoraAPIMMTOM apim = client.getAPIMMTOM();
        FileInputStream in =
                new FileInputStream(FEDORA_HOME
                                    + "/client/demo/foxml/local-server-demos/simple-document-demo/obj_demo_31.xml");

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        StreamUtility.pipeStream(in, out, 4096);

        apim.ingest(TypeUtility.convertBytesToDataHandler(out.toByteArray()), FOXML1_1.uri, "for testing");

        String request = "/oai?verb=ListRecords&metadataPrefix=oai_dc";
        Document result = getXMLQueryResult(client, request);
        assertXpathExists("/oai:OAI-PMH/oai:ListRecords/oai:record", result);

        request = "/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2000-01-01";
        result = getXMLQueryResult(client, request);
        assertXpathExists("/oai:OAI-PMH/oai:ListRecords/oai:record", result);

        apim.purgeObject("demo:31", "for testing", false);
    }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

            removeTestObject(hasRestrictedAndUnrestricted);
        }
    }

    private boolean canWrite(FedoraClient client, String pid, String logMessage) throws Exception {
        FedoraAPIMMTOM apim = client.getAPIMMTOM();
        try {
            apim.modifyObject(pid, null, null, null, logMessage);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

        // APIA access by user without access- should fail
        try {
            System.out.println("Testing " + functionToTest
                    + " from invalid user: " + username);

            FedoraAPIMMTOM apim1 = user.getAPIMMTOM();
            Method func = apim1.getClass().getMethod(functionToTest, args);
            func.invoke(apim1, parms);
            fail("Illegal access allowed");
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getCause();
            if (cause instanceof SOAPFaultException) {
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

        // APIA access by user with access- should succeed
        try {
            // testuser1 does have permission to access demo:5 datastreams, so this should succeed
            System.out.println("Testing " + functionToTest
                    + " from valid user: " + username);
            FedoraAPIMMTOM apim1 = user.getAPIMMTOM();
            Method func = apim1.getClass().getMethod(functionToTest, args);
            Object result = func.invoke(apim1, parms);
            assertTrue(result != null);
            return result;
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getCause();
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

    private static void purgeFast(String pid) throws Exception {
        getAPIM().purgeObject(pid, "because", false);
    }

    private static void purgeFast(String[] pids) throws Exception {
        FedoraAPIMMTOM apim = getAPIM();
        for (String element : pids) {
            apim.purgeObject(element, "because", false);
        }
    }
View Full Code Here

Examples of org.fcrepo.server.management.FedoraAPIMMTOM

            apim.purgeObject(element, "because", false);
        }
    }

    private static FedoraAPIMMTOM getAPIM() throws Exception {
        FedoraAPIMMTOM result = s_client.getAPIMMTOM();
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.