Package com.mozilla.grouperfish.model

Examples of com.mozilla.grouperfish.model.Document


        baseUrl = RestAssured.baseURI + ':' + RestAssured.port;
        loader = new DocumentLoader(baseUrl, NS);
    }

    public void testLoadSingleDoc() {
        loader.load(new Document(put(template, "id", "A_")));
    }
View Full Code Here


    public void testLoadSingleDoc() {
        loader.load(new Document(put(template, "id", "A_")));
    }

    public void testLoadSingleDocPlusVerify() {
        loader.load(new Document(put(template, "id", "AP_")));
        expect().
            statusCode(200).
            when().get(format("/documents/%s/%s", NS, "AP_"));
    }
View Full Code Here

            statusCode(200).
            when().get(format("/documents/%s/%s", NS, "AP_"));
    }

    public void testLoadDuplicateDoc() {
        loader.load(new Document(put(template, "id", "B_")));
        loader.load(new Document(put(template, "id", "B_")));
    }
View Full Code Here

        loader.load(new Document(put(template, "id", "B_")));
    }

    public void testLoadSingleDocBatch() {
        final List<Document> batch = new ArrayList<Document>();
        batch.add(new Document(put(template, "id", "C_")));
        assertEquals(1, loader.load(batch));
    }
View Full Code Here

    public void testLoadSomeDocsBatch() {
        final List<Document> batch = new ArrayList<Document>();
        final int n = 10;
        for (int i = 0; i < n; ++i) {
            batch.add(new Document(put(template, "id", "D_" + i)));
        }
        assertEquals(n, loader.load(batch));
    }
View Full Code Here

    public void testLoadManyDocsBatch() {
        final List<Document> batch = new ArrayList<Document>();
        final int n = 1000;
        for (int i = 0; i < n; ++i) {
            batch.add(new Document(put(template, "id", "E_" + i)));
        }
        assertEquals(n, loader.load(batch));
    }
View Full Code Here

    public void testPlusVerify() {
        final List<Document> batch = new ArrayList<Document>();
        final int n = 20;
        for (int i = 0; i < n; ++i) {
            Document doc = new Document(put(template, "id", "F_" + i));
            batch.add(doc);
        }

        assertEquals(n, loader.load(batch));
View Full Code Here

            }
            final SearchHit next = batch.getAt(positionInBatch);
            ++positionInBatch;
            ++position;
            return new Document(next.getId(), next.getSource());
        }
View Full Code Here

            reader_ = reader;
        }

        @Override
        public Document next() {
            @SuppressWarnings("serial")
            Document doc = new Document(
                    row_[Field.ID.i],
                    new HashMap<String, Object>() {{
                        for (Field f : Field.values())
                            put(f.name().toLowerCase(), row_[f.i]);
                    }});
View Full Code Here

TOP

Related Classes of com.mozilla.grouperfish.model.Document

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.