Skip to content

Commit

Permalink
BVTCK-42 Assigning CDI test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Mar 7, 2013
1 parent 69c5c8c commit 5766c50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
Expand Up @@ -28,6 +28,7 @@
import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -62,14 +63,18 @@ public class DefaultInjectionTest extends Arquillian {
@Deployment
public static WebArchive createTestArchive() {
return new WebArchiveBuilder()
.withTestClassPackage( DefaultInjectionTest.class )
.withValidationXml( "test-validation.xml" )
.withTestClass( DefaultInjectionTest.class )
.withClass( ConstantMessageInterpolator.class )
.withValidationXml( "validation-DefaultInjectionTest.xml" )
.withEmptyBeansXml()
.build();
}

@SpecAssertion(section = "10.3.1", id = "a")
@Test
@SpecAssertions({
@SpecAssertion(section = "10.1.1", id = "a"),
@SpecAssertion(section = "10.3.1", id = "a")
})
private void testDefaultValidatorFactoryGetsInjected() {
assertNotNull( defaultValidatorFactory, "Default validator factory should be injectable." );
assertTrue(
Expand All @@ -84,8 +89,11 @@ private void testDefaultValidatorFactoryGetsInjected() {
assertCorrectConstraintViolationMessages( violations, "Invalid constraint" );
}

@SpecAssertion(section = "10.3.1", id = "a")
@Test
@SpecAssertions({
@SpecAssertion(section = "10.1.1", id = "a"),
@SpecAssertion(section = "10.3.1", id = "a")
})
private void testQualifiedDefaultValidatorFactoryGetsInjected() {
assertNotNull(
qualifiedDefaultValidatorFactory,
Expand All @@ -103,8 +111,11 @@ private void testQualifiedDefaultValidatorFactoryGetsInjected() {
assertCorrectConstraintViolationMessages( violations, "Invalid constraint" );
}

@SpecAssertion(section = "10.3.1", id = "a")
@Test
@SpecAssertions({
@SpecAssertion(section = "10.1.1", id = "a"),
@SpecAssertion(section = "10.3.1", id = "a")
})
private void testDefaultValidatorGetsInjected() {
assertNotNull( defaultValidator, "Default validator should be injectable." );

Expand All @@ -114,8 +125,11 @@ private void testDefaultValidatorGetsInjected() {
assertCorrectConstraintViolationMessages( violations, "Invalid constraint" );
}

@SpecAssertion(section = "10.3.1", id = "a")
@Test
@SpecAssertions({
@SpecAssertion(section = "10.1.1", id = "a"),
@SpecAssertion(section = "10.3.1", id = "a")
})
private void testQualifiedDefaultValidatorGetsInjected() {
assertNotNull(
qualifiedDefaultValidator,
Expand Down

0 comments on commit 5766c50

Please sign in to comment.