Package v7db.files.spi

Examples of v7db.files.spi.ReferenceTracking


  public void testInsert() throws MongoException, IOException {

    Mongo mongo = getMongo();

    ReferenceTracking refs = new MongoReferenceTracking(mongo.getDB("test")
        .getCollection("v7files.refs"));

    Object owner = new DBRef(null, "test", "test");

    refs.updateReferences(owner, new StoredContent(new byte[20], 1000));

    assertMockMongoFieldContains(new byte[20], "test.v7files.refs", owner,
        "refs");
    assertMockMongoFieldContains(new byte[20], "test.v7files.refs", owner,
        "refHistory");
View Full Code Here


        .append("refs", new Object[] { oldRef }).append("refHistory",
            new Object[] { oldRef }));

    Mongo mongo = getMongo();

    ReferenceTracking refs = new MongoReferenceTracking(mongo.getDB("test")
        .getCollection("v7files.refs"));

    refs.updateReferences("x", new StoredContent(new byte[20], 1000));

    assertMockMongoFieldContains(new byte[20], "test.v7files.refs", "x",
        "refs");
    assertMockMongoFieldContains(new byte[20], "test.v7files.refs", "x",
        "refHistory");
View Full Code Here

    ContentPointer pointer = storage.storeContent(new ByteArrayInputStream(
        data));

    DBCollection references = mongo.getDB("test").getCollection(
        "v7files.refs");
    ReferenceTracking refs = new MongoReferenceTracking(references);

    Object owner = new DBRef(null, "test", "test");

    refs.updateReferences(owner, pointer);

    refs.purge(owner);

    SimpleGarbageCollector.purge(contents, references);

    assertMockMongoDoesNotContainDocument("test.v7files.refs", owner);
    assertMockMongoDoesNotContainDocument("test.v7files.content",
View Full Code Here

TOP

Related Classes of v7db.files.spi.ReferenceTracking

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.