Skip to content

Commit

Permalink
BVTCK-32 Incorporating review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jan 23, 2013
1 parent 8571f26 commit 1181fb6
Show file tree
Hide file tree
Showing 33 changed files with 361 additions and 320 deletions.

Large diffs are not rendered by default.

Expand Up @@ -30,19 +30,20 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ExtendedOrderServiceImplementation;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationAddingParameterConstraints;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationMarkingParameterAsCascaded;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationOfCascadingAndNonCascadingInterfaces;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationOfCascadingInterfaceExtendingUncascadingSuperClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationOfConstrainedAndUnconstrainedInterfaces;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.ImplementationOfConstrainedInterfaceExtendingUnconstrainedSuperClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.OrderServiceImplementation;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.OrderServiceSubClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.SubClassAddingParameterConstraints;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl.SubClassMarkingParameterAsCascaded;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Order;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Person;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.AbstractCalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ExtendedOrderServiceImplementation;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationAddingParameterConstraints;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationMarkingParameterAsCascaded;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationOfCascadingAndNonCascadingInterfaces;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationOfCascadingInterfaceExtendingUncascadingSuperClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationOfConstrainedAndUnconstrainedInterfaces;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.ImplementationOfConstrainedInterfaceExtendingUnconstrainedSuperClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.OrderServiceImplementation;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.OrderServiceSubClass;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.SubClassAddingParameterConstraints;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl.SubClassMarkingParameterAsCascaded;
import org.hibernate.beanvalidation.tck.util.Groups;
import org.hibernate.beanvalidation.tck.util.TestUtil;
import org.hibernate.beanvalidation.tck.util.shrinkwrap.WebArchiveBuilder;
Expand All @@ -62,6 +63,7 @@ public static WebArchive createTestArchive() {
return new WebArchiveBuilder()
.withTestClassPackage( InvalidMethodConstraintDeclarationTest.class )
.withPackage( ImplementationAddingParameterConstraints.class.getPackage() )
.withPackage( AbstractCalendarService.class.getPackage() )
.withPackage( Person.class.getPackage() )
.build();
}
Expand All @@ -73,7 +75,8 @@ public void setupValidator() {

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "a")
public void testParameterConstraintsAddedInInterfaceImplementation() throws Exception {
public void testParameterConstraintsAddedInInterfaceImplementationCausesException()
throws Exception {
Object object = new ImplementationAddingParameterConstraints();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -84,7 +87,7 @@ public void testParameterConstraintsAddedInInterfaceImplementation() throws Exce

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "a")
public void testParameterConstraintsAddedInSubClass() throws Exception {
public void testParameterConstraintsAddedInSubClassCausesException() throws Exception {
Object object = new SubClassAddingParameterConstraints();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -95,7 +98,8 @@ public void testParameterConstraintsAddedInSubClass() throws Exception {

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "a")
public void testParameterMarkedAsCascadedInInterfaceImplementation() throws Exception {
public void testParameterMarkedAsCascadedInInterfaceImplementationCausesException()
throws Exception {
Object object = new ImplementationMarkingParameterAsCascaded();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -106,7 +110,7 @@ public void testParameterMarkedAsCascadedInInterfaceImplementation() throws Exce

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "a")
public void testParameterMarkedAsCascadedInSubClass() throws Exception {
public void testParameterMarkedAsCascadedInSubClassCausesException() throws Exception {
Object object = new SubClassMarkingParameterAsCascaded();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -117,7 +121,8 @@ public void testParameterMarkedAsCascadedInSubClass() throws Exception {

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "b")
public void testParameterIsConstrainedInParallelInterfaceMethod() throws Exception {
public void testConstrainedParameterInOneMethodOfParallelInterfacesCausesException()
throws Exception {
Object object = new ImplementationOfConstrainedAndUnconstrainedInterfaces();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -128,7 +133,8 @@ public void testParameterIsConstrainedInParallelInterfaceMethod() throws Excepti

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "b")
public void testParameterIsConstrainedInInterfaceMethodAndSuperClassMethod() throws Exception {
public void testParameterIsConstrainedInInterfaceMethodAndSuperClassMethodCausesException()
throws Exception {
Object object = new ImplementationOfConstrainedInterfaceExtendingUnconstrainedSuperClass();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -139,7 +145,8 @@ public void testParameterIsConstrainedInInterfaceMethodAndSuperClassMethod() thr

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "b")
public void testParameterIsCascadingInParallelInterfaceMethod() throws Exception {
public void testParameterIsCascadingInOneMethodOfParallelInterfacesCausesException()
throws Exception {
Object object = new ImplementationOfCascadingAndNonCascadingInterfaces();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -150,7 +157,8 @@ public void testParameterIsCascadingInParallelInterfaceMethod() throws Exception

@Test(expectedExceptions = ConstraintDeclarationException.class)
@SpecAssertion(section = "4.5.5", id = "b")
public void testParameterIsCascadingInInterfaceMethodAndSuperClassMethod() throws Exception {
public void testParameterIsCascadingInInterfaceMethodAndSuperClassMethodCausesException()
throws Exception {
Object object = new ImplementationOfCascadingInterfaceExtendingUncascadingSuperClass();
Method method = getCreateEventMethod( object );
Object[] parameterValues = new Object[3];
Expand All @@ -161,7 +169,8 @@ public void testParameterIsCascadingInInterfaceMethodAndSuperClassMethod() throw

@Test(expectedExceptions = ConstraintDeclarationException.class, groups = Groups.FAILING_IN_RI)
@SpecAssertion(section = "4.5.5", id = "d")
public void testReturnValueIsMarkedAsCascadedInInterfaceAndImplementation() throws Exception {
public void testReturnValueIsMarkedAsCascadedInInterfaceAndImplementationCausesException()
throws Exception {
Object object = new OrderServiceImplementation();
Method method = getPlaceOrderMethod( object );
Object returnValue = new Order();
Expand All @@ -172,7 +181,8 @@ public void testReturnValueIsMarkedAsCascadedInInterfaceAndImplementation() thro

@Test(expectedExceptions = ConstraintDeclarationException.class, groups = Groups.FAILING_IN_RI)
@SpecAssertion(section = "4.5.5", id = "d")
public void testReturnValueIsMarkedAsCascadedInBaseAndSubClass() throws Exception {
public void testReturnValueIsMarkedAsCascadedInBaseAndSubClassCausesException()
throws Exception {
Object object = new OrderServiceSubClass();
Method method = getPlaceOrderMethod( object );
Object returnValue = new Order();
Expand All @@ -183,7 +193,8 @@ public void testReturnValueIsMarkedAsCascadedInBaseAndSubClass() throws Exceptio

@Test(expectedExceptions = ConstraintDeclarationException.class, groups = Groups.FAILING_IN_RI)
@SpecAssertion(section = "4.5.5", id = "d")
public void testReturnValueIsMarkedAsCascadedInSuperAndDerivedInterface() throws Exception {
public void testReturnValueIsMarkedAsCascadedInSuperAndDerivedInterfaceCausesException()
throws Exception {
Object object = new ExtendedOrderServiceImplementation();
Method method = getPlaceOrderMethod( object );
Object returnValue = new Order();
Expand Down
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import java.util.Date;
import java.util.List;
Expand Down
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import javax.validation.Valid;

Expand Down
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import java.util.Date;
import java.util.List;
Expand All @@ -25,7 +25,7 @@
/**
* @author Gunnar Morling
*/
public interface IAnotherCalendarService {
public interface AnotherCalendarService {

void createEvent(@NotNull Date start, @NotNull Date end, @NotNull List<Person> participants);
}
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import java.util.Date;
import java.util.List;
Expand All @@ -24,7 +24,7 @@
/**
* @author Gunnar Morling
*/
public interface ICalendarService {
public interface CalendarService {

void createEvent(Date start, Date end, List<Person> participants);
}
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import javax.validation.Valid;

Expand All @@ -23,7 +23,7 @@
/**
* @author Gunnar Morling
*/
public interface IExtendedOrderService extends IOrderService {
public interface ExtendedOrderService extends OrderService {

@Override
@Valid
Expand Down
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import javax.validation.Valid;

Expand All @@ -23,7 +23,7 @@
/**
* @author Gunnar Morling
*/
public interface IOrderService {
public interface OrderService {

@Valid
Order placeOrder(String item, int quantity);
Expand Down
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service;

import java.util.Date;
import java.util.List;
Expand All @@ -25,7 +25,7 @@
/**
* @author Gunnar Morling
*/
public interface IYetAnotherCalendarService {
public interface YetAnotherCalendarService {

void createEvent(Date start, Date end, @Valid List<Person> participants);
}
Expand Up @@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.IExtendedOrderService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Order;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.ExtendedOrderService;

/**
* @author Gunnar Morling
*/
public class ExtendedOrderServiceImplementation implements IExtendedOrderService {
public class ExtendedOrderServiceImplementation implements ExtendedOrderService {

@Override
public Order placeOrder(String item, int quantity) {
Expand Down
Expand Up @@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl;

import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotNull;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.ICalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Person;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.CalendarService;

/**
* @author Gunnar Morling
*/
public class ImplementationAddingParameterConstraints implements ICalendarService {
public class ImplementationAddingParameterConstraints implements CalendarService {

@Override
public void createEvent(@NotNull Date start, @NotNull Date end, @NotNull List<Person> participants) {
Expand Down
Expand Up @@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl;

import java.util.Date;
import java.util.List;
import javax.validation.Valid;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.ICalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Person;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.CalendarService;

/**
* @author Gunnar Morling
*/
public class ImplementationMarkingParameterAsCascaded implements ICalendarService {
public class ImplementationMarkingParameterAsCascaded implements CalendarService {

@Override
public void createEvent(Date start, Date end, @Valid List<Person> participants) {
Expand Down
Expand Up @@ -14,20 +14,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl;

import java.util.Date;
import java.util.List;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.ICalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.IYetAnotherCalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Person;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.CalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.YetAnotherCalendarService;

/**
* @author Gunnar Morling
*/
public class ImplementationOfCascadingAndNonCascadingInterfaces
implements ICalendarService, IYetAnotherCalendarService {
implements CalendarService, YetAnotherCalendarService {

@Override
public void createEvent(Date start, Date end, List<Person> participants) {
Expand Down
Expand Up @@ -14,20 +14,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.impl;
package org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.impl;

import java.util.Date;
import java.util.List;

import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.AbstractCalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.IYetAnotherCalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.model.Person;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.AbstractCalendarService;
import org.hibernate.beanvalidation.tck.tests.constraints.inheritance.method.invaliddeclarations.service.YetAnotherCalendarService;

/**
* @author Gunnar Morling
*/
public class ImplementationOfCascadingInterfaceExtendingUncascadingSuperClass
extends AbstractCalendarService implements IYetAnotherCalendarService {
extends AbstractCalendarService implements YetAnotherCalendarService {

@Override
public void createEvent(Date start, Date end, List<Person> participants) {
Expand Down

0 comments on commit 1181fb6

Please sign in to comment.