Package org.apache.oodt.cas.filemgr.ingest

Examples of org.apache.oodt.cas.filemgr.ingest.StdIngester


    }

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                    "./src/testdata/ingest/test.txt"), prodMet);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here


                "./src/testdata/ingest").getCanonicalPath());
        prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
       
        StdIngester ingester = new StdIngester(transferServiceFacClass);
        String productId = ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test.txt"), prodMet);    
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
        Metadata m = fmc.getMetadata(fmc.getProductById(productId));
        assertEquals(m.getMetadata("Filename"), "test.txt");
View Full Code Here

     * @since OODT-404
     *
     */
    public void testMetadataPersistence() throws Exception {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);
        prodMet = new SerializableMetadata(new FileInputStream(
            "./src/testdata/ingest/test-file-3.txt.met"));
        // now add the right file location
        prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
            "./src/testdata/ingest").getCanonicalPath());
        String productId = ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test-file-3.txt"), prodMet);
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
            
        Metadata m = fmc.getMetadata(fmc.getProductById(productId));
View Full Code Here

        assertEquals(m.getMetadata("TestElement"), "fe");
    }

   
    public void testComplexQuery() throws Exception {
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        //ingest first file
        Metadata prodMet = new Metadata();
        prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                "./src/testdata/ingest").getCanonicalPath());
        prodMet.addMetadata(CoreMetKeys.FILENAME, "test-file-1.txt");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile1");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
        ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test-file-1.txt"), prodMet);          
       
        //ingest second file
        prodMet.replaceMetadata(CoreMetKeys.FILENAME, "test-file-2.txt");
        prodMet.replaceMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile2");
        ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test-file-2.txt"), prodMet);  
       
        //perform complex query
        ComplexQuery complexQuery = new ComplexQuery();
        List<String> reducedMetadata = new Vector<String>();
View Full Code Here

    }

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
            prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
            prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                    "./src/testdata/ingest/test.txt"), prodMet);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.ingest.StdIngester

Copyright © 2018 www.massapicom. 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.