cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Reich <markus.re...@markusreich.at>
Subject Re: Unit Testing WebApp with 3.2M1 release
Date Thu, 25 Jul 2013 05:14:18 GMT
perfect, thx


2013/7/24 John Huss <johnthuss@gmail.com>

> getContext() was renamed to newContext()
>
>
> On Wed, Jul 24, 2013 at 3:51 PM, Markus Reich
> <markus.reich@markusreich.at>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
markus.reich@markusreich.at

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message