org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive Java Examples
The following examples show how to use
org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConnectorTestCase.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Define the deployment * * @return The deployment archive */ @Deployment(order = 1) public static ResourceAdapterArchive createDeployment() { ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar"); ja.addClasses(HelloWorldResourceAdapter.class, HelloWorldManagedConnectionFactory.class, HelloWorldManagedConnection.class, HelloWorldManagedConnectionMetaData.class, HelloWorldConnectionFactory.class, HelloWorldConnectionFactoryImpl.class, HelloWorldConnection.class, HelloWorldConnectionImpl.class); raa.addAsLibrary(ja); // Contains the default deployment information raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml"); return raa; }
Example #2
Source File: ConnectorTestCase.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Define the deployment * * @return The deployment archive */ @Deployment(order = 1) public static ResourceAdapterArchive createDeployment() { ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar"); ja.addClasses(HelloWorldResourceAdapter.class, HelloWorldManagedConnectionFactory.class, HelloWorldManagedConnection.class, HelloWorldManagedConnectionMetaData.class, HelloWorldConnectionFactory.class, HelloWorldConnectionFactoryImpl.class, HelloWorldConnection.class, HelloWorldConnectionImpl.class); raa.addAsLibrary(ja); // Contains the default deployment information raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml"); return raa; }
Example #3
Source File: EmbeddedJCA.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Undeploy * @param raa The resource adapter archive * @exception Throwable If an error occurs */ public void undeploy(ResourceAdapterArchive raa) throws Throwable { if (raa == null) throw new IllegalArgumentException("Url is null"); if (!started) throw new IllegalStateException("Container not started"); File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir")); File raaFile = new File(parentDirectory, raa.getName()); log.debugf("Undeploying: %s", raaFile); if (shrinkwrapDeployments == null || !shrinkwrapDeployments.contains(raaFile)) throw new IOException(raa.getName() + " not deployed"); kernel.getMainDeployer().undeploy(raaFile.toURI().toURL()); removeDeployment(raaFile); }
Example #4
Source File: ValidatorTestCase.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Deployment * @throws Throwable In case of an error */ @Test public void testDeployment() throws Throwable { ResourceAdapterArchive rar = ResourceAdapterFactory.createWorkRarMCFNoHashCode(); ResourceAdaptersDescriptor raxml = ResourceAdapterFactory.createWorkDeploymentMCFNoHashCode(null); try { embedded.deploy(rar); embedded.deploy(raxml); fail(); } catch (Throwable t) { if (!t.getCause().getCause().getClass().equals(ValidatorException.class)) fail(); } finally { embedded.undeploy(raxml); embedded.undeploy(rar); } }
Example #5
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Create the perf.rar * * @return The resource adapter archive */ public static ResourceAdapterArchive createPerfRar() { org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5"); org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter(); org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(PerfManagedConnectionFactory.class.getName()) .connectionfactoryInterface(PerfConnectionFactory.class.getName()) .connectionfactoryImplClass(PerfConnectionFactoryImpl.class.getName()) .connectionInterface(PerfConnection.class.getName()) .connectionImplClass(PerfConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "perf.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "perf.jar"); ja.addPackages(true, PerfConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #6
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 6 votes |
/** * Create the txlog.rar * * @return The resource adapter archive */ public static ResourceAdapterArchive createTxLogRar() { org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5"); org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter(); org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(TxLogManagedConnectionFactory.class.getName()) .connectionfactoryInterface(TxLogConnectionFactory.class.getName()) .connectionfactoryImplClass(TxLogConnectionFactoryImpl.class.getName()) .connectionInterface(TxLogConnection.class.getName()) .connectionImplClass(TxLogConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "txlog.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "txlog.jar"); ja.addPackages(true, TxLogConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #7
Source File: ConnectorTestCase.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Define the deployment * * @return The deployment archive */ @Deployment(order = 1) public static ResourceAdapterArchive createDeployment() { String deploymentName = "ConnectorTestCase.rar"; ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar"); ja.addClasses(HelloWorldResourceAdapter.class, HelloWorldManagedConnectionFactory.class, HelloWorldManagedConnection.class, HelloWorldManagedConnectionMetaData.class, HelloWorldConnectionFactory.class, HelloWorldConnectionFactoryImpl.class, HelloWorldConnection.class, HelloWorldConnectionImpl.class); raa.addAsLibrary(ja); // Contains the deployment information raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml"); String rootPath = System.getProperty("test.dir") + File.separator + ".." + File.separator; File root = new File(rootPath); for (File f : root.listFiles()) { if (f.getName().contains("HelloWorld")) raa.addAsLibrary(f); } return raa; }
Example #8
Source File: EmbeddedJCA.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Deploy * @param raa The resource adapter archive * @exception Throwable If an error occurs */ public void deploy(ResourceAdapterArchive raa) throws Throwable { if (raa == null) throw new IllegalArgumentException("Url is null"); if (!raa.getName().endsWith(".rar")) throw new IllegalArgumentException(raa.getName() + " doesn't end with .rar"); if (!started) throw new IllegalStateException("Container not started"); File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir")); File raaFile = new File(parentDirectory, raa.getName()); if (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(raaFile)) throw new IOException(raa.getName() + " already deployed"); if (raaFile.exists()) recursiveDelete(raaFile); raa.as(ZipExporter.class).exportTo(raaFile, true); if (shrinkwrapDeployments == null) shrinkwrapDeployments = new ArrayList<File>(1); shrinkwrapDeployments.add(raaFile); log.debugf("Deploying: %s", raaFile); kernel.getMainDeployer().deploy(raaFile.toURI().toURL()); }
Example #9
Source File: RarInfoTestCase.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
private void assertRAXml(BufferedReader reader, ResourceAdapterArchive raArchive) throws IOException { String line = readNextNonemptyLine(reader); assertEquals("META-INF/ra.xml:", line); line = reader.readLine(); assertTrue(line, line.matches("-+")); BufferedReader raReader = new BufferedReader(new InputStreamReader(raArchive.get("META-INF/ra.xml").getAsset(). openStream())); while ((line = raReader.readLine()) != null) { assertEquals(line, reader.readLine()); } }
Example #10
Source File: CamelEnablementResourceAdapterTest.java From wildfly-camel with Apache License 2.0 | 5 votes |
@Deployment public static ResourceAdapterArchive rarDeployment() { return ShrinkWrap.create(ResourceAdapterArchive.class, DEPLOYMENT_RESADAPTOR_RAR) .addAsManifestResource("classloading/resource-adapter.xml", "ra.xml") .addAsLibrary(ShrinkWrap.create(JavaArchive.class) .addClasses(FakeResourceAdapter.class, FakeActivationSpec.class, CamelEnablementResourceAdapterTest.class) ); }
Example #11
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Create the lazy.rar * * @return The resource adapter archive */ public static ResourceAdapterArchive createLazyRar() { org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5"); org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter() .resourceadapterClass(LazyResourceAdapter.class.getName()); rt.createConfigProperty().configPropertyName("Enable") .configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.TRUE.toString()); rt.createConfigProperty().configPropertyName("LocalTransaction") .configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.FALSE.toString()); rt.createConfigProperty().configPropertyName("XATransaction") .configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.FALSE.toString()); org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(LazyManagedConnectionFactory.class.getName()) .connectionfactoryInterface(LazyConnectionFactory.class.getName()) .connectionfactoryImplClass(LazyConnectionFactoryImpl.class.getName()) .connectionInterface(LazyConnection.class.getName()) .connectionImplClass(LazyConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "lazy.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "lazy.jar"); ja.addPackages(true, LazyConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #12
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Create the work.rar * * @return The resource adapter archive */ public static ResourceAdapterArchive createWorkRar() { org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6"); org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter() .resourceadapterClass(WorkResourceAdapter.class.getName()); org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(WorkManagedConnectionFactory.class.getName()) .connectionfactoryInterface(WorkConnectionFactory.class.getName()) .connectionfactoryImplClass(WorkConnectionFactoryImpl.class.getName()) .connectionInterface(WorkConnection.class.getName()) .connectionImplClass(WorkConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "work.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "work.jar"); ja.addPackages(true, WorkConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #13
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Create the work.rar * * @return The resource adapter archive */ public static ResourceAdapterArchive createWorkRarMCFNoHashCode() { org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6"); org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter() .resourceadapterClass(WorkResourceAdapter.class.getName()); org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(WorkManagedConnectionFactoryNoHashCode.class.getName()) .connectionfactoryInterface(WorkConnectionFactory.class.getName()) .connectionfactoryImplClass(WorkConnectionFactoryImpl.class.getName()) .connectionInterface(WorkConnection.class.getName()) .connectionImplClass(WorkConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "work.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "work.jar"); ja.addPackages(true, WorkConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #14
Source File: ResourceAdapterFactory.java From ironjacamar with Eclipse Public License 1.0 | 5 votes |
/** * Create the unified-security.rar * * * @return The resource adapter archive */ public static ResourceAdapterArchive createUnifiedSecurityRar() { org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors .create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6"); org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter() .resourceadapterClass(UnifiedSecurityResourceAdapter.class.getName()); org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt .getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false); org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition() .managedconnectionfactoryClass(UnifiedSecurityManagedConnectionFactory.class.getName()) .connectionfactoryInterface(UnifiedSecurityConnectionFactory.class.getName()) .connectionfactoryImplClass(UnifiedSecurityConnectionFactoryImpl.class.getName()) .connectionInterface(UnifiedSecurityConnection.class.getName()) .connectionImplClass(UnifiedSecurityConnectionImpl.class.getName()); ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "unified-security.rar"); JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "unified-security.jar"); ja.addPackages(true, UnifiedSecurityConnection.class.getPackage()); raa.addAsLibrary(ja); raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml"); return raa; }
Example #15
Source File: PrefillNoCredentialsTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #16
Source File: FlushMethodCallNoCredentialsTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #17
Source File: PrefillSubjectTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #18
Source File: WorkAdapterAndWorkListenerTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createWorkRar(); }
Example #19
Source File: SmokeTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createTxLogRar(); }
Example #20
Source File: EnlistmentLocalTransactionTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createTxLogRar(); }
Example #21
Source File: EnlistmentNoTransactionTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createTxLogRar(); }
Example #22
Source File: DistributedWorkManagerSocketMITestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createWorkRar(); }
Example #23
Source File: FlushMethodCallSubjectTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #24
Source File: PrefillCriTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #25
Source File: BackgroundValidationTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createTestRar(); }
Example #26
Source File: CriTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #27
Source File: FlushAllGracefullyTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #28
Source File: FlushGracefullyTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #29
Source File: FlushEntirePoolTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * * @throws Throwable In case of an error */ @Deployment(order = 1) private ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createUnifiedSecurityRar(); }
Example #30
Source File: RetryTestCase.java From ironjacamar with Eclipse Public License 1.0 | 4 votes |
/** * The resource adapter * @throws Throwable In case of an error */ @Deployment(order = 1) private static ResourceAdapterArchive createResourceAdapter() throws Throwable { return ResourceAdapterFactory.createTestRar(); }