Hi,
I'm using following code for unit testing:
package db;
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.access.DataContext;
import org.apache.cayenne.configuration.server.ServerRuntime;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class PartnerTest {
private ObjectContext context;
@Before
public void setUp() throws Exception {
ServerRuntime runtime = new ServerRuntime("cayenne-mxerp.xml");
context = runtime.getContext();
}
@After
public void tearDown() throws Exception {
context.rollbackChanges();
}
@Test
public void testDB() {
}
}
...but it seems since 3.2M1 runtime.getContext() is deprecated?
What is the right way to get a context for testing?
regards
Markus