use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.
the class EntityTestCase method testNamedQueries.
@Test
@InSequence(4)
public void testNamedQueries() throws Exception {
EntityTest test = lookup("EntityTest", EntityTest.class);
int count = test.testAllCustomersQuery();
assertEquals("Number returned for allCustomers query", 4, count);
Customer c = test.testCustomerByIdQuery();
assertNotNull("One object should be returned by customerById query", c);
}
use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.
the class EntityTestCase method testManyToOne.
@Test
@InSequence(2)
public void testManyToOne() throws Exception {
EntityTest test = lookup("EntityTest", EntityTest.class);
Flight f = test.manyToOneCreate();
Flight f2 = test.findFlightById(f.getId());
assertEquals(f.getId(), new Long(1));
assertEquals(f.getName(), f2.getName());
assertEquals(f.getCompany().getName(), f2.getCompany().getName());
Company c = test.findCompanyById(f.getCompany().getId());
assertNotNull("Company has one flight.", c.getFlights());
assertEquals(f.getCompany().getFlights().size(), c.getFlights().size());
}
use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.
the class EntityTestCase method testFlush.
@Test
@InSequence(5)
public void testFlush() throws Exception {
EntityTest test = lookup("EntityTest", EntityTest.class);
Customer c = test.createCustomer("Thomas");
test.changeCustomer(c.getId(), "George");
Customer c2 = test.findCustomerById(c.getId());
assertEquals("George", c2.getName());
}
use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.
the class ImplementValidityAuditStrategyTestCase method testEnversforValidityStrategy.
@Test
@InSequence(1)
public void testEnversforValidityStrategy() throws Exception {
SLSBValidityStrategyOrg slsbvalidityOrg = lookup("SLSBValidityStrategyOrg", SLSBValidityStrategyOrg.class);
Organization o1 = slsbvalidityOrg.createOrg("REDHAT", "Software Co", "10/10/1994", "eternity", "Raleigh");
Organization o2 = slsbvalidityOrg.createOrg("HALDIRAMS", "Food Co", "10/10/1974", "eternity", "Delhi");
o2.setStartDate("10/10/1924");
o2.setName("BIKANER");
slsbvalidityOrg.updateOrg(o2);
Organization ret1 = slsbvalidityOrg.retrieveOldOrgbyId(o2.getId());
// check that property startDate is audited
Assert.assertEquals("10/10/1974", ret1.getStartDate());
Assert.assertEquals("HALDIRAMS", ret1.getName());
// check that property location is notaudited
Assert.assertNull(ret1.getLocation());
}
use of org.jboss.arquillian.junit.InSequence in project wildfly by wildfly.
the class SimpleTimerServiceTestCase method testAnnotationTimeoutMethod.
@Test
@InSequence(1)
public void testAnnotationTimeoutMethod() throws NamingException {
InitialContext ctx = new InitialContext();
AnnotationTimerServiceBean bean = (AnnotationTimerServiceBean) ctx.lookup("java:module/" + AnnotationTimerServiceBean.class.getSimpleName());
bean.resetTimerServiceCalled();
bean.getTimerService().createTimer(TIMER_TIMEOUT_TIME_MS, INFO_MSG_FOR_CHECK);
Assert.assertTrue(AnnotationTimerServiceBean.awaitTimerCall());
bean.resetTimerServiceCalled();
long ts = (new Date()).getTime() + TIMER_INIT_TIME_MS;
bean.getTimerService().createTimer(new Date(ts), INFO_MSG_FOR_CHECK);
Assert.assertTrue(AnnotationTimerServiceBean.awaitTimerCall());
Assert.assertEquals(INFO_MSG_FOR_CHECK, bean.getTimerInfo());
Assert.assertFalse(bean.isCalendar());
Assert.assertTrue(bean.isPersistent());
}
Aggregations