Skip to content

Commit

Permalink
Create TestNGTemplateTest.vtl
Browse files Browse the repository at this point in the history
Template file for creating TestNG based Test Classes
  • Loading branch information
sathiyaseelan committed Feb 2, 2013
1 parent f36ec7a commit 18b7bcb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/main/resources/TestNGTemplateTest.vtl
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});
}
}

0 comments on commit 18b7bcb

Please sign in to comment.