Search in sources :

Example 26 with InSequence

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);
}
Also used : Customer(org.jboss.as.test.integration.jpa.hibernate.entity.Customer) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 27 with InSequence

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());
}
Also used : Company(org.jboss.as.test.integration.jpa.hibernate.entity.Company) Flight(org.jboss.as.test.integration.jpa.hibernate.entity.Flight) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 28 with InSequence

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());
}
Also used : Customer(org.jboss.as.test.integration.jpa.hibernate.entity.Customer) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) EntityTest(org.jboss.as.test.integration.jpa.hibernate.EntityTest) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 29 with InSequence

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());
}
Also used : SLSBValidityStrategyOrg(org.jboss.as.test.integration.jpa.hibernate.envers.SLSBValidityStrategyOrg) Organization(org.jboss.as.test.integration.jpa.hibernate.envers.Organization) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 30 with InSequence

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());
}
Also used : InitialContext(javax.naming.InitialContext) Date(java.util.Date) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Aggregations

InSequence (org.jboss.arquillian.junit.InSequence)103 Test (org.junit.Test)103 Simple (org.apache.deltaspike.data.test.ee7.domain.Simple)18 ModelNode (org.jboss.dmr.ModelNode)14 URL (java.net.URL)13 ModelControllerClient (org.jboss.as.controller.client.ModelControllerClient)8 PartitionManager (org.picketlink.idm.PartitionManager)7 StringTokenizer (java.util.StringTokenizer)6 IdentityManager (org.picketlink.idm.IdentityManager)6 RouteBuilder (org.apache.camel.builder.RouteBuilder)5 House (org.apache.deltaspike.data.test.ee7.domain.House)5 HttpResponse (org.apache.http.HttpResponse)5 HttpGet (org.apache.http.client.methods.HttpGet)5 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)5 ManagementClient (org.jboss.as.arquillian.container.ManagementClient)5 EntityTest (org.jboss.as.test.integration.jpa.hibernate.EntityTest)5 User (org.picketlink.idm.model.basic.User)5 Date (java.util.Date)4 InitialContext (javax.naming.InitialContext)4 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)4