package picea.nano.memor4j;

import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;

public class TestNaAtom {
    @Test
    public void testSingleton() {
        NaAtomStore store = NaAtomStore.sharedStore();
        assertThat( store, is(notNullValue()) );
    }
}
@@ -45,16 +45,17 @@
 t.Test;%0A
+%0A
 import s
@@ -322,10 +322,1219 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testBasicUndoRedo() %7B%0A        class ExampleData extends NaAtomData %7B%0A            protected String msg = %22%22;%0A            @Override%0A            public NaAtomData copy() %7B%0A                ExampleData cp = new ExampleData();%0A                cp.msg = this.msg;%0A                return cp;%0A            %7D%0A        %7D%0A%0A        class ExampleAtom extends NaAtom%3CExampleData%3E %7B%0A            public ExampleAtom() %7B%0A                super(new ExampleData());%0A            %7D%0A            public void setMsg(String msg) %7B%0A                beforeWrite();%0A                rawData().msg = msg;%0A            %7D%0A            public String getMsg() %7B%0A                return rawData().msg;%0A            %7D%0A        %7D%0A%0A        final NaAtomStore store = NaAtomStore.sharedStore();%0A%0A        ExampleAtom exam = new ExampleAtom();%0A%0A        store.start();%0A        exam.setMsg(%22hello%22);%0A        store.commit();%0A%0A        store.start();%0A        exam.setMsg(%22world%22);%0A        store.commit();%0A%0A        assertThat( exam.getMsg(), is( equalTo(%22world%22) ) );%0A%0A        store.undo();%0A        assertThat( exam.getMsg(), is( equalTo(%22hello%22) ) );%0A%0A        store.redo();%0A        assertThat( exam.getMsg(), is( equalTo(%22world%22) ) );%0A    %7D
 %0A%7D

完成了基本的案例，memor4j的接口已经被改坏