forked from forge/plugin-arquillian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Template file for creating TestNG based Test Classes
- Loading branch information
1 parent
f36ec7a
commit 18b7bcb
Showing
1 changed file
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package $package; | ||
|
||
import ${packageImport}.${ClassToTest}; | ||
import javax.inject.Inject; | ||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.testng.annotations.Test; | ||
import org.testng.Assert; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
import org.jboss.arquillian.testng.Arquillian; | ||
|
||
|
||
public class ${ClassToTest}Test extends Arquillian{ | ||
@Inject private ${ClassToTest} ${classToTest}; | ||
|
||
@Deployment public static JavaArchive createDeployment() { | ||
return ShrinkWrap.create(JavaArchive.class, "test.jar") | ||
.addClass(${ClassToTest}.class) | ||
#if($enableJPA) | ||
.addAsManifestResource("META-INF/persistence.xml", "persistence.xml") | ||
#end | ||
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); | ||
} | ||
|
||
@Test | ||
public void testIsDeployed() { | ||
Assert.assertNotNull(${classToTest}); | ||
} | ||
} |