/* * IronJacamar, a Java EE Connector Architecture implementation * Copyright 2015, Red Hat Inc, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the Eclipse Public License 1.0 as * published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse * Public License for more details. * * You should have received a copy of the Eclipse Public License * along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.ironjacamar.core.workmanager; import org.ironjacamar.embedded.Configuration; import org.ironjacamar.embedded.Deployment; import org.ironjacamar.embedded.dsl.resourceadapters20.api.ResourceAdaptersDescriptor; import org.ironjacamar.embedded.junit4.AllChecks; import org.ironjacamar.embedded.junit4.IronJacamar; import org.ironjacamar.embedded.junit4.PostCondition; import org.ironjacamar.embedded.junit4.PreCondition; import org.ironjacamar.rars.ResourceAdapterFactory; import org.ironjacamar.rars.wm.WorkConnection; import org.ironjacamar.rars.wm.WorkConnectionFactory; import javax.annotation.Resource; import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertNotNull; /** * Basic WorkManager test case * @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a> */ @RunWith(IronJacamar.class) @Configuration(full = true) @PreCondition(condition = AllChecks.class) @PostCondition(condition = AllChecks.class) public class WorkManagerTestCase { /** The user transaction */ @Resource(mappedName = "java:/eis/WorkConnectionFactory") private WorkConnectionFactory wcf; /** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createWorkRar(); } /** * The activation * @throws Throwable In case of an error */ @Deployment(order = 2) private ResourceAdaptersDescriptor createActivation() throws Throwable { return ResourceAdapterFactory.createWorkDeployment(null); } /** * Deployment * @throws Throwable In case of an error */ @Test public void testDeployment() throws Throwable { assertNotNull(wcf); WorkConnection wc = wcf.getConnection(); assertNotNull(wc); wc.close(); } }