From 2db586f49d9d27ee249d3862189102b393b7846b Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 16 Nov 2010 21:31:40 +0000 Subject: Investigating migration to wink 1.2-SNAPSHOT git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035822 13f79535-47bb-0310-9956-ffa450edef68 --- .../wireformat/xml/CustomerServiceTestCase.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org') diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java index c6e487596b..cd69cd0c41 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java @@ -6,15 +6,15 @@ * 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. + * under the License. */ package org.apache.tuscany.sca.binding.rest.wireformat.xml; @@ -42,8 +42,8 @@ public class CustomerServiceTestCase { private static final String GET_RESPONSE = "john@domain.comJohnJohn"; private static final String UPDATED_ITEM = "john@updated-domain.comJohnJohn"; - private static final String GET_UPDATED_RESPONSE = "john@updated-domain.comJohnJohn"; - + private static final String GET_UPDATED_RESPONSE = "john@updated-domain.comJohnJohn"; + private static Node node; @BeforeClass @@ -63,15 +63,15 @@ public class CustomerServiceTestCase { node.stop(); } } - + @Test public void testPing() throws Exception { new Socket("127.0.0.1", 8085); //System.in.read(); } - + @Test - public void testGetInvocation() throws Exception { + public void testGetInvocation() throws Exception { WebConversation wc = new WebConversation(); WebRequest request = new GetMethodWebRequest(SERVICE_URL); request.setHeaderField("Content-Type", "application/xml"); @@ -82,20 +82,20 @@ public class CustomerServiceTestCase { //for(String headerField : response.getHeaderFieldNames()) { // System.out.println(">>> Header:" + headerField + " - " + response.getHeaderField(headerField)); //} - + //for debug purposes - //System.out.println(">>>" + GET_RESPONSE); - //System.out.println(">>>" + response.getText()); + System.out.println(">>>" + GET_RESPONSE); + System.out.println(">>>" + response.getText()); Assert.assertEquals(200, response.getResponseCode()); Assert.assertEquals("no-cache", response.getHeaderField("Cache-Control")); Assert.assertEquals("tuscany", response.getHeaderField("X-Tuscany")); Assert.assertEquals(GET_RESPONSE, response.getText()); - + } @Test - public void testPutInvocation() throws Exception { + public void testPutInvocation() throws Exception { //Add new item to catalog WebConversation wc = new WebConversation(); WebRequest request = new PostMethodWebRequest(SERVICE_URL, new ByteArrayInputStream(UPDATED_ITEM.getBytes("UTF-8")),"application/xml"); @@ -103,12 +103,12 @@ public class CustomerServiceTestCase { Assert.assertEquals(201, response.getResponseCode()); System.out.println(response.getHeaderField("Location")); - + //read new results and expect to get new item back in the response request = new GetMethodWebRequest(SERVICE_URL); request.setHeaderField("Content-Type", "application/xml"); response = wc.getResource(request); - + //for debug purposes //System.out.println(">>>" + GET_UPDATED_RESPONSE); //System.out.println(">>>" + response.getText()); -- cgit v1.2.3