1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
@RunWith( JMock.class )
@ContextConfiguration(locations="classpath:/metadata/applicationContextTest.xml")
public class TestRetraRfoperBH extends TestMain_BH //qui étend bien de l'abstract context de spring...
{
public final static String REVISION = "$LastChangedRevision: 7514 $";
public final static String ND_DEB = "#ND_DEB#";
public final static String ND_FIN = "#ND_FIN#";
@Autowired JUnit4Mockery myContext;
@Autowired private IRfocteDao rfocteDao = null;
@Autowired private IRetraRfoperBH retraRfoperBH = null;
private Rfocte rfoCte= null;
@Test
public void testCreatePeriodes() throws UnexpectedDaoException, DataFormMapException
{
ds = new SDataSet();
rfoCte = ds.createWithNullKey(Rfocte.meta);
rfoCte.setInt(Rfocte.rfoctecal, 0);
//lTpe.add(rfoTpe);
//lTpe.add(rfoTpe);
tabArgFind1[0]= "testRef";
tabArgFind1[1]= "testCte";
myContext.checking(new Expectations() {{
oneOf(rfocteDao).find(with(any(SDataSet.class)), with(equal(tabArgFind1))); will(returnValue(rfoCte)); //ERREUR A CETTE LIGNE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}});
try {
retraRfoperBH.createPeriodes(DefaultDates.debutRfoper(), DefaultDates.finRfoper(), "testRef", "testCte", logger, new JobState("test"));
} catch (BusinessException e) {
logger.debug(e.getMessage());
fail("Business Exception");
} catch(AssumptionViolatedException e) {
fail("Mock Exeception");
}
catch (Exception e) {
fail("Exception non gérée");
}
myContext.assertIsSatisfied();
}
} |
Partager