Author: sergeyb
Date: Tue Nov 5 15:29:31 2013
New Revision: 1539031
URL: http://svn.apache.org/r1539031
Log:
[CXF-5309] Updating the system test to test the annotation inheritance, pacth
from Andriy Redko applied
Added:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
(with props)
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
(with props)
Modified:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreWithValidation.java
Added:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java?rev=1539031&view=auto
==============================================================================
---
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
(added)
+++
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
Tue Nov 5 15:29:31 2013
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.cxf.systest.jaxrs.validation;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Pattern;
+
+public abstract class AbstractBookStoreWithValidation {
+ @Valid public abstract BookWithValidation getBook(@Pattern(regexp =
"\\d+") String id);
+}
Propchange:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/AbstractBookStoreWithValidation.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java?rev=1539031&view=auto
==============================================================================
---
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
(added)
+++
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
Tue Nov 5 15:29:31 2013
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.cxf.systest.jaxrs.validation;
+
+import java.util.Collection;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Min;
+
+public interface BookStoreValidatable {
+ @Valid Collection< BookWithValidation > list(@Min(1) int page);
+}
Propchange:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreValidatable.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreWithValidation.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreWithValidation.java?rev=1539031&r1=1539030&r2=1539031&view=diff
==============================================================================
---
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreWithValidation.java
(original)
+++
cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/validation/BookStoreWithValidation.java
Tue Nov 5 15:29:31 2013
@@ -22,10 +22,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import javax.validation.Valid;
-import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -40,7 +37,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@Path("/bookstore/")
-public class BookStoreWithValidation {
+public class BookStoreWithValidation extends AbstractBookStoreWithValidation
implements BookStoreValidatable {
private Map< String, BookWithValidation > books = new HashMap< String,
BookWithValidation >();
public BookStoreWithValidation() {
@@ -48,8 +45,8 @@ public class BookStoreWithValidation {
@GET
@Path("/books/{bookId}")
- @Valid
- public BookWithValidation getBook(@Pattern(regexp = "\\d+")
@PathParam("bookId") String id) {
+ @Override
+ public BookWithValidation getBook(@PathParam("bookId") String id) {
return books.get(id);
}
@@ -64,8 +61,8 @@ public class BookStoreWithValidation {
@GET
@Path("/books")
- @Valid public Collection< BookWithValidation > list(
- @Min(1) @DefaultValue("1") @QueryParam("page") int page) {
+ @Override
+ public Collection< BookWithValidation > list(@DefaultValue("1")
@QueryParam("page") int page) {
return books.values();
}