Skip to content

Instantly share code, notes, and snippets.

@aslakknutsen
Created March 28, 2011 19:56
Show Gist options
  • Save aslakknutsen/891139 to your computer and use it in GitHub Desktop.
Save aslakknutsen/891139 to your computer and use it in GitHub Desktop.
Index: embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainerConfiguration.java
===================================================================
--- embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainerConfiguration.java (revision 111054)
+++ embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainerConfiguration.java (working copy)
@@ -21,8 +21,7 @@
*/
package org.jboss.jca.embedded.arquillian;
-import org.jboss.arquillian.spi.ContainerConfiguration;
-import org.jboss.arquillian.spi.ContainerProfile;
+import org.jboss.arquillian.spi.client.container.ContainerConfiguration;
/**
* {@link ContainerConfiguration} implementation specific to the EmbeddedJCA container
@@ -37,12 +36,4 @@
public EmbeddedJCAContainerConfiguration()
{
}
-
- /**
- * {@inheritDoc}
- */
- public ContainerProfile getContainerProfile()
- {
- return ContainerProfile.STANDALONE;
- }
}
Index: embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainer.java
===================================================================
--- embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainer.java (revision 111054)
+++ embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainer.java (working copy)
@@ -21,9 +21,6 @@
*/
package org.jboss.jca.embedded.arquillian;
-import org.jboss.jca.embedded.Embedded;
-import org.jboss.jca.embedded.EmbeddedFactory;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -33,16 +30,17 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
-import org.jboss.arquillian.protocol.local.LocalMethodExecutor;
-import org.jboss.arquillian.spi.Configuration;
-import org.jboss.arquillian.spi.ContainerMethodExecutor;
-import org.jboss.arquillian.spi.Context;
-import org.jboss.arquillian.spi.DeployableContainer;
-import org.jboss.arquillian.spi.DeploymentException;
-import org.jboss.arquillian.spi.LifecycleException;
+import org.jboss.arquillian.spi.client.container.DeployableContainer;
+import org.jboss.arquillian.spi.client.container.DeploymentException;
+import org.jboss.arquillian.spi.client.container.LifecycleException;
+import org.jboss.arquillian.spi.client.protocol.ProtocolDescription;
+import org.jboss.arquillian.spi.client.protocol.metadata.ProtocolMetaData;
+import org.jboss.jca.embedded.Embedded;
+import org.jboss.jca.embedded.EmbeddedFactory;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.asset.Asset;
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptor;
/**
* Arquillian {@link DeployableContainer} adaptor for EmbeddedJCA
@@ -50,7 +48,7 @@
* @author <a href="mailto:[email protected]">Jesper Pedersen</a>
* @version $Revision: $
*/
-public class EmbeddedJCAContainer implements DeployableContainer
+public class EmbeddedJCAContainer implements DeployableContainer<EmbeddedJCAContainerConfiguration>
{
/** EmbeddedJCA */
private Embedded embedded;
@@ -65,11 +63,51 @@
/**
* {@inheritDoc}
- * @see org.jboss.arquillian.spi.DeployableContainer#deploy
+ * @see DeployableContainer#getDefaultProtocol()
*/
@Override
- public ContainerMethodExecutor deploy(final Context context, final Archive<?> archive) throws DeploymentException
+ public ProtocolDescription getDefaultProtocol()
{
+ return new ProtocolDescription("Local");
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see DeployableContainer#getConfigurationClass()
+ */
+ @Override
+ public Class<EmbeddedJCAContainerConfiguration> getConfigurationClass()
+ {
+ return EmbeddedJCAContainerConfiguration.class;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see DeployableContainer#deploy(Descriptor)
+ */
+ @Override
+ public void deploy(Descriptor descriptor) throws DeploymentException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see DeployableContainer#undeploy(Descriptor)
+ */
+ @Override
+ public void undeploy(Descriptor descriptor) throws DeploymentException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see DeployableContainer#deploy(Archive)
+ */
+ @Override
+ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException
+ {
if (archive == null)
throw new DeploymentException("Could not deploy a null application");
@@ -79,6 +117,7 @@
try
{
ResourceAdapterArchive raa = ResourceAdapterArchive.class.cast(archive);
+ // TODO: This can be moved to Descriptor Deployment
if (raa.getName() != null && raa.getName().startsWith("complex_"))
{
if (raa.get(raa.getName().substring(8)) != null)
@@ -124,7 +163,7 @@
}
// Invoke locally
- return new LocalMethodExecutor();
+ return new ProtocolMetaData();
}
/**
@@ -195,10 +234,10 @@
/**
* {@inheritDoc}
- * @see org.jboss.arquillian.spi.DeployableContainer#undeploy
+ * @see DeployableContainer#undeploy(Archive)
*/
@Override
- public void undeploy(final Context context, final Archive<?> archive) throws DeploymentException
+ public void undeploy(final Archive<?> archive) throws DeploymentException
{
if (archive == null)
throw new DeploymentException("Could not undeploy a null application");
@@ -225,7 +264,7 @@
* @see org.jboss.arquillian.spi.DeployableContainer#start
*/
@Override
- public void setup(final Context context, final Configuration configuration)
+ public void setup(final EmbeddedJCAContainerConfiguration configuration)
{
}
@@ -235,7 +274,7 @@
* @see org.jboss.arquillian.spi.DeployableContainer#start
*/
@Override
- public void start(final Context context) throws LifecycleException
+ public void start() throws LifecycleException
{
embedded = EmbeddedFactory.create();
try
@@ -257,7 +296,7 @@
* @see org.jboss.arquillian.spi.DeployableContainer#stop
*/
@Override
- public void stop(final Context context) throws LifecycleException
+ public void stop() throws LifecycleException
{
try
{
Index: embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (revision 111054)
+++ embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer (working copy)
@@ -1 +0,0 @@
-org.jboss.jca.embedded.arquillian.EmbeddedJCAContainer
\ No newline at end of file
Index: embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration (revision 111054)
+++ embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration (working copy)
@@ -1 +0,0 @@
-org.jboss.jca.embedded.arquillian.EmbeddedJCAContainerConfiguration
@aslakknutsen
Copy link
Author

M embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainerConfiguration.java
M embedded/src/main/java/org/jboss/jca/embedded/arquillian/EmbeddedJCAContainer.java
A + embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.client.container.DeployableContainer
D embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
D embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment