perfect, thx
2013/7/24 John Huss <[email protected]> > getContext() was renamed to newContext() > > > On Wed, Jul 24, 2013 at 3:51 PM, Markus Reich > <[email protected]>wrote: > > > 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 > > > -- *Markus Reich* Moosbach 28/2 6392 St. Jakob i.H. www.markusreich.at / www.meeximum.at [email protected]
