Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74df8fa
commit 2167d0f
Showing
22 changed files
with
449 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
impl/src/test/java/org/jboss/seam/exception/control/test/BaseWebArchive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...st/java/org/jboss/seam/exception/control/test/JBossAS7DeploymentExceptionTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
impl/src/test/java/org/jboss/seam/exception/control/test/JBossAS7Extension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
Oops, something went wrong.