Package org.neo4j.shell.tools.imp.util

Examples of org.neo4j.shell.tools.imp.util.ProgressReporter


    private GraphDatabaseService db;

    @Test
    public void testExportGraphML() throws Exception {
        createData(1000);
        ProgressReporter reporter = new ProgressReporter(null, null);
        doExport(reporter, false);
        assertEquals(new ElementCounter().update(1000, 1000, 2000), reporter.getTotal());
    }
View Full Code Here


    }

    @Test
    public void testExportTinyGraph() throws Exception {
        createData(1);
        ProgressReporter reporter = new ProgressReporter(null, null);
        String xml = doExport(reporter, false);
        assertEquals(new ElementCounter().update(1, 1, 2), reporter.getTotal());
        assertEquals(TEST_XML_HEADER+TEST_XML_DATA+TEST_XML_FOOTER,xml);
    }
View Full Code Here

    }

    @Test
    public void testExportTinyGraphWithKeys() throws Exception {
        createData(1);
        ProgressReporter reporter = new ProgressReporter(null, null);
        String xml = doExport(reporter,true);
        assertEquals(new ElementCounter().update(1, 1, 2), reporter.getTotal());
        assertEquals(TEST_XML_HEADER+TEST_XML_KEYS+TEST_XML_DATA+TEST_XML_FOOTER,xml);
    }
View Full Code Here

    public Continuation execute(AppCommandParser parser, Session session, Output out) throws Exception {
        String fileName = parser.option("i", null);
        Config config = Config.fromOptions(parser);
        CountingReader reader = FileUtils.readerFor(fileName);
        if (reader!=null) {
            int count = execute(reader, new ProgressReporter(reader, out), config);
            out.println("Geoff import of "+fileName+" created "+count+" entities.");
        }
        if (reader!=null) reader.close();
        return Continuation.INPUT_COMPLETE;
    }
View Full Code Here

        String fileName = parser.option("o", null);
        boolean relsBetween = parser.options().containsKey("r");
        BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));

        ProgressReporter reporter = new ProgressReporter(null, out);

        GraphDatabaseService db = getServer().getDb();

        Format exportFormat = new XmlGraphMLFormat(db);
        String query = Config.extractQuery(parser);
        SubGraph graph = query.isEmpty() ? new DatabaseSubGraph(db) : cypherResultSubGraph(query,relsBetween);
        exportFormat.dump(graph, writer, reporter, config);
        writer.close();
        reporter.progress("Wrote to GraphML-file " + fileName);
        return Continuation.INPUT_COMPLETE;
    }
View Full Code Here

TOP

Related Classes of org.neo4j.shell.tools.imp.util.ProgressReporter

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.