Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.nakedobjects.plugins.xml.objectstore;
 
 
public class XmlObjectStoreTest extends ProxyJunit3TestCase {
    private XmlObjectStore objectStore;
    private MockDataManager dataManager;
    private TestSpecification spec;
    public static void main(final String[] args) {
        junit.textui.TestRunner.run(XmlObjectStoreTest.class);
    }
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        // system
         = new MockDataManager();
         = new XmlObjectStore(new DummyServiceManager());
        .setClock(new TestClock());
        // objects
         = new TestSpecification();
        . = new NakedObjectAssociation[0];
         = new TestProxyNakedObject();
        .setOptimisticLock(new SerialNumberVersion(23, nullnull));
    }
    public void testSaveObjectCreatesNewVersion() throws Exception {
        .setOptimisticLock(null);
        .execute(Collections.<PersistenceCommand>singletonList(command));
        assertEquals(new FileVersion(null, 1), .getVersion());
    }
    public void testDeleteObjectRemovesVersion() throws Exception {
        .execute(Collections.<PersistenceCommand>singletonList(command));
        assertEquals(null.getVersion());
    }
    public void testUpdateObjectCreatesNewVersion() throws Exception {
        .execute(Collections.<PersistenceCommand>singletonList(command));
        assertEquals(new FileVersion(null, 1), .getVersion());
    }
// Copyright (c) Naked Objects Group Ltd.
New to GrepCode? Check out our FAQ X