@@ -0,0 +1,1532 @@
+package org.flymine.objectstore;%0A%0Aimport junit.extensions.TestSetup;%0Aimport junit.framework.TestSuite;%0Aimport junit.framework.Test;%0A%0A%0Aimport org.flymine.objectstore.ojb.ObjectStoreWriterOjbImpl;%0Aimport org.flymine.objectstore.ojb.ObjectStoreOjbImpl;%0Aimport org.flymine.sql.DatabaseFactory;%0A%0Apublic abstract class SetupDataTestCase extends ObjectStoreQueriesTestCase%0A%7B%0A    protected static final org.apache.log4j.Logger LOG%0A        = org.apache.log4j.Logger.getLogger(SetupDataTestCase.class);%0A%0A    public SetupDataTestCase(String arg) %7B%0A        super(arg);%0A    %7D%0A%0A    public static Test buildSuite(Class cls) %7B%0A        TestSetup setup = new TestSetup(new TestSuite(cls)) %7B%0A                protected void setUp() throws Exception %7B%0A                    oneTimeSetUp();%0A                %7D%0A                protected void tearDown() throws Exception %7B%0A                    oneTimeTearDown();%0A                %7D%0A            %7D;%0A        return setup;%0A    %7D%0A%0A    public static void oneTimeSetUp() throws Exception %7B%0A        ObjectStoreAbstractImpl osLocal = (ObjectStoreAbstractImpl) ObjectStoreFactory.getObjectStore(%22os.unittest%22);%0A        db = DatabaseFactory.getDatabase(%22db.unittest%22);%0A        // this needs to be changed to use AbstractImpl when one is written...%0A        writer = new ObjectStoreWriterOjbImpl((ObjectStoreOjbImpl) osLocal);%0A        setUpData();%0A        storeData();%0A        setUpQueries();%0A        setUpResults();%0A    %7D%0A%0A    public static void oneTimeTearDown() throws Exception %7B%0A        removeDataFromStore();%0A    %7D%0A%0A%7D%0A

build a test suite for given subclass, set up DB data once then run tests