Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BVTCK-48 Adding tests for overriding methods with @ValidateOnExecution
- Loading branch information
1 parent
01e41fd
commit 1988aba
Showing
9 changed files
with
404 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...validation/tck/tests/integration/cdi/executable/AnotherShipmentService1stInHierarchy.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,35 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
public interface AnotherShipmentService1stInHierarchy extends AnotherShipmentService2stInHierarchy { | ||
|
||
// The @ValidateOnExecution annotations here are expected to be ignored | ||
// since the methods override super-type methods | ||
|
||
@Override | ||
@NotNull | ||
@ValidateOnExecution(type = ExecutableType.NONE) | ||
public Shipment getShipment(); | ||
} |
32 changes: 32 additions & 0 deletions
32
...dation/tck/tests/integration/cdi/executable/AnotherShipmentService1stInHierarchyImpl.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,32 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
@ValidateOnExecution(type = ExecutableType.IMPLICIT) | ||
public class AnotherShipmentService1stInHierarchyImpl implements AnotherShipmentService1stInHierarchy { | ||
|
||
@Override | ||
public Shipment getShipment() { | ||
return null; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...validation/tck/tests/integration/cdi/executable/AnotherShipmentService2stInHierarchy.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,31 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
public interface AnotherShipmentService2stInHierarchy { | ||
|
||
@NotNull | ||
@ValidateOnExecution(type = ExecutableType.ALL) | ||
public Shipment getShipment(); | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...main/java/org/hibernate/beanvalidation/tck/tests/integration/cdi/executable/Shipment.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,32 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
public class Shipment { | ||
|
||
@NotNull | ||
private String name; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
.../java/org/hibernate/beanvalidation/tck/tests/integration/cdi/executable/ShipmentBase.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,42 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
@ValidateOnExecution(type = ExecutableType.ALL) | ||
public class ShipmentBase { | ||
|
||
public void findShipment(@NotNull String id) { | ||
} | ||
|
||
@ValidateOnExecution(type = ExecutableType.GETTER_METHODS) | ||
@NotNull | ||
public Shipment getShipment() { | ||
return null; | ||
} | ||
|
||
@NotNull | ||
public Shipment getAnotherShipment() { | ||
return null; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...va/org/hibernate/beanvalidation/tck/tests/integration/cdi/executable/ShipmentService.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,37 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
@ValidateOnExecution(type = ExecutableType.ALL) | ||
public interface ShipmentService { | ||
|
||
public void findShipment(@NotNull String id); | ||
|
||
@ValidateOnExecution(type = ExecutableType.GETTER_METHODS) | ||
@NotNull | ||
public Shipment getShipment(); | ||
|
||
@NotNull | ||
public Shipment getAnotherShipment(); | ||
} |
47 changes: 47 additions & 0 deletions
47
...rg/hibernate/beanvalidation/tck/tests/integration/cdi/executable/ShipmentServiceImpl.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,47 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2013, Red Hat, Inc. and/or its affiliates, 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.hibernate.beanvalidation.tck.tests.integration.cdi.executable; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.executable.ExecutableType; | ||
import javax.validation.executable.ValidateOnExecution; | ||
|
||
/** | ||
* @author Gunnar Morling | ||
*/ | ||
public class ShipmentServiceImpl implements ShipmentService { | ||
|
||
// The @ValidateOnExecution annotations here are expected to be ignored | ||
// since the methods override super-type methods | ||
|
||
@ValidateOnExecution(type = ExecutableType.NONE) | ||
@Override | ||
public void findShipment(@NotNull String id) { | ||
} | ||
|
||
@ValidateOnExecution(type = ExecutableType.NONE) | ||
@Override | ||
public Shipment getShipment() { | ||
return null; | ||
} | ||
|
||
@ValidateOnExecution(type = ExecutableType.NONE) | ||
@Override | ||
public Shipment getAnotherShipment() { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.