Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCE7710B65 for ; Thu, 17 Oct 2013 11:41:34 +0000 (UTC) Received: (qmail 10924 invoked by uid 500); 17 Oct 2013 11:41:34 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 10800 invoked by uid 500); 17 Oct 2013 11:41:33 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 10793 invoked by uid 99); 17 Oct 2013 11:41:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Oct 2013 11:41:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Oct 2013 11:41:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A7FCE238889B; Thu, 17 Oct 2013 11:41:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1533053 - in /cxf/branches/2.7.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java Date: Thu, 17 Oct 2013 11:41:09 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131017114109.A7FCE238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Thu Oct 17 11:41:09 2013 New Revision: 1533053 URL: http://svn.apache.org/r1533053 Log: Merged revisions 1533052 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1533052 | sergeyb | 2013-10-17 12:32:21 +0100 (Thu, 17 Oct 2013) | 1 line Updating JAXRS20 test to check methods in client filters ........ Modified: cxf/branches/2.7.x-fixes/ (props changed) cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/trunk:r1533052 Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java?rev=1533053&r1=1533052&r2=1533053&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java (original) +++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java Thu Oct 17 11:41:09 2013 @@ -256,7 +256,7 @@ public class JAXRS20ClientServerBookTest WebClient wc = WebClient.create(endpointAddress, Collections.singletonList(new ReplaceBodyFilter())); WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000L); - wc.accept("text/mistypedxml").type("text/xml"); + wc.accept("text/mistypedxml").type("text/xml").header("THEMETHOD", "PUT"); Book book = wc.put(new Book("book", 555L), Book.class); assertEquals(561L, book.getId()); } @@ -527,6 +527,19 @@ public class JAXRS20ClientServerBookTest @Override public void filter(ClientRequestContext rc) throws IOException { + String method = rc.getMethod(); + String expectedMethod = null; + if (rc.getAcceptableMediaTypes().contains(MediaType.valueOf("text/mistypedxml")) + && rc.getHeaders().getFirst("THEMETHOD") != null) { + expectedMethod = "PUT"; + } else { + expectedMethod = "POST"; + } + + + if (!expectedMethod.equals(method)) { + throw new RuntimeException(); + } rc.setEntity(new Book("book", ((Book)rc.getEntity()).getId() + 5), null, null); }