Skip to content

Commit

Permalink
Trying to get Catch to run on OWB
Browse files Browse the repository at this point in the history
  • Loading branch information
LightGuard committed Aug 5, 2011
1 parent 74df8fa commit 2167d0f
Show file tree
Hide file tree
Showing 22 changed files with 449 additions and 211 deletions.
222 changes: 196 additions & 26 deletions impl/pom.xml
Expand Up @@ -31,7 +31,11 @@

<!-- Overrides -->
<properties>
<arquillian.version>1.0.0.Alpha5</arquillian.version>
<arquillian.version>1.0.0.CR1</arquillian.version>
<arquillian.jbossas7.version>7.0.0.CR1</arquillian.jbossas7.version>
<arquillian.openwebbeans.version>1.0.0.Final-SNAPSHOT</arquillian.openwebbeans.version>
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<openwebbeans.version>1.1.1-SNAPSHOT</openwebbeans.version>
</properties>

<name>Seam Catch Implementation</name>
Expand All @@ -51,13 +55,8 @@
</dependency>

<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-junit</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<groupId>org.jboss.seam.solder</groupId>
<artifactId>seam-solder</artifactId>
</dependency>

<dependency>
Expand All @@ -66,35 +65,32 @@
</dependency>

<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.seam.solder</groupId>
<artifactId>seam-solder</artifactId>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<scope>provided</scope>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<scope>provided</scope>
<type>pom</type>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-spi</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-spi</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<profiles>
Expand All @@ -117,8 +113,182 @@
</plugins>
</build>
</profile>
</profiles>

<profile>
<id>arq-weld-ee-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>arq-jbossas6-remote</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jbossas-remote-6</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>arq-jbossas7-remote</id>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
<version>${arquillian.jbossas7.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>arq-glassfish-3.1-remote</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-remote-3.1</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>

<profile>
<id>arq-openwebbeans-embedded</id>
<repositories>
<repository>
<id>apache-snapshot</id>
<name>Apache Snapshot</name>
<url>http://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-openwebbeans-embedded-1</artifactId>
<version>${arquillian.openwebbeans.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
<version>${openwebbeans.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${openwebbeans.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-el_2.2_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-validation_1.0_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-interceptor_1.1_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_1.0_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-resource</artifactId>
<version>${openwebbeans.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans</artifactId>
<version>${openwebbeans.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
</profiles>

<build>
<plugins>
Expand Down
@@ -0,0 +1,53 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.seam.exception.control.test;

import java.util.Collection;

import javax.enterprise.inject.spi.Extension;

import org.jboss.seam.exception.control.CaughtException;
import org.jboss.seam.exception.control.extension.CatchExtension;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;

/**
* @author <a href="http://community.jboss.org/people/LightGuard">Jason Porter</a>
*/
public final class BaseWebArchive {
static Collection<JavaArchive> libraries;

public static WebArchive createBase(final String name) {
if (libraries == null) {
// The JBoss Repository must be defined in the user's settings.xml for this to work.
libraries = DependencyResolvers.use(MavenDependencyResolver.class)
.artifacts("org.jboss.seam.solder:seam-solder:3.0.0.Final").resolveAs(JavaArchive.class);
}

return ShrinkWrap.create(WebArchive.class, name)
.addPackage(CaughtException.class.getPackage())
.addClass(CatchExtension.class)
.addAsServiceProvider(Extension.class, CatchExtension.class)
.addAsLibraries(libraries)
.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
}
}
@@ -0,0 +1,36 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.seam.exception.control.test;

import org.jboss.arquillian.container.spi.client.container.DeploymentExceptionTransformer;

/**
* @author <a href="http://community.jboss.org/people/LightGuard">Jason Porter</a>
*/
public class JBossAS7DeploymentExceptionTransformer implements DeploymentExceptionTransformer {
@Override
public Throwable transform(Throwable exception) {
Throwable rootCause = exception;

while (rootCause.getCause() != null) {
rootCause = exception.getCause();
}

System.out.println(rootCause);
return rootCause;
}
}
@@ -0,0 +1,30 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.seam.exception.control.test;

import org.jboss.arquillian.container.spi.client.container.DeploymentExceptionTransformer;
import org.jboss.arquillian.core.spi.LoadableExtension;

/**
* @author <a href="http://community.jboss.org/people/LightGuard">Jason Porter</a>
*/
public class JBossAS7Extension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.service(DeploymentExceptionTransformer.class, JBossAS7DeploymentExceptionTransformer.class);
}
}

0 comments on commit 2167d0f

Please sign in to comment.