From jboss-remoting-commits at lists.jboss.org Sat Apr 26 16:21:21 2008 Content-Type: multipart/mixed; boundary="===============9131592237448120039==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4083 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http. Date: Sat, 26 Apr 2008 16:21:20 -0400 Message-ID: --===============9131592237448120039== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-04-26 16:21:20 -0400 (Sat, 26 Apr 2008) New Revision: 4083 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/= HTTPInvokerClientTestCase_deleted.java Removed: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/= HTTPInvokerClientTestCase.java Log: JBREM-930: Renamed HTTPInvokerClientTestCase so it won't run in test suite. Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport= /http/HTTPInvokerClientTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /HTTPInvokerClientTestCase.java 2008-04-26 20:17:38 UTC (rev 4082) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /HTTPInvokerClientTestCase.java 2008-04-26 20:21:20 UTC (rev 4083) @@ -1,259 +0,0 @@ -/* -* JBoss, Home of Professional Open Source -* Copyright 2005, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - -package org.jboss.test.remoting.transport.http; - -import junit.framework.TestCase; -import org.apache.log4j.Level; -import org.jboss.remoting.Client; -import org.jboss.remoting.InvokerLocator; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -/** - * Test case that uses the HTTPInvoker client to call on two different pub= lic SOAP services (one based - * on Axis and the other based on .NET implementations). - * - * @author Tom Elrod - */ -public class HTTPInvokerClientTestCase extends TestCase -{ - private Client client; - - public void init(String httpTargetURL) - { - try - { - InvokerLocator locator =3D new InvokerLocator(httpTargetURL); - Map config =3D new HashMap(); - config.put(Client.ENABLE_LEASE, "false"); - client =3D new Client(locator, config); - client.connect(); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - public String makeInvocationCall(String httpTargetURL, String payload, = Map metadata) throws Throwable - { - init(httpTargetURL); - Object obj =3D client.invoke(payload, metadata); - - System.out.println("invoke returned" + obj); - - return (String) obj; - } - - /* *** commented out because external site no longer available *** - public void testWeatherHTTPInvocation() throws Throwable - { - - org.apache.log4j.BasicConfigurator.configure(); - org.apache.log4j.Category.getRoot().setLevel(Level.INFO); - org.apache.log4j.Category.getInstance("org.jgroups").setLevel(Level.= INFO); - org.apache.log4j.Category.getInstance("org.jboss.remoting").setLevel= (Level.DEBUG); - org.apache.log4j.Category.getInstance("test").setLevel(Level.DEBUG); - - - String testURL =3D "http://services.xmethods.net:80/soap/servlet/rpc= router"; - - String xml =3D "\n" + - "\n" + - " \n" + - " \n" + - " 30106\n" + - " \n" + - " \n" + - ""; - - Map metadata =3D new HashMap(); - metadata.put(Client.RAW, Boolean.TRUE); - metadata.put("TYPE", "POST"); - - // proxy info - //metadata.put("http.proxyHost", "ginger"); - //metadata.put("http.proxyPort", "80"); - //metadata.put("http.proxy.username", "tom"); - //metadata.put("http.proxy.password", "foobar"); - - Properties headerProps =3D new Properties(); - headerProps.put("SOAPAction", ""); - headerProps.put("Content-type", "text/xml; charset=3DUTF-8"); - - metadata.put("HEADER", headerProps); - - - HTTPInvokerClientTestCase client =3D new HTTPInvokerClientTestCase(); - - String result =3D client.makeInvocationCall(testURL, xml, metadata); - // don't need to comapre full string. (as actual temp value will cha= nge each time run) - assertEquals(getExpectedWeatherResult().substring(0, 380), result.su= bstring(0, 380)); - - } - */ - - public void testCitiesByCountryHTTPInvocation() throws Throwable - { - - org.apache.log4j.BasicConfigurator.configure(); - org.apache.log4j.Category.getRoot().setLevel(Level.INFO); - org.apache.log4j.Category.getInstance("org.jgroups").setLevel(Level.= INFO); - org.apache.log4j.Category.getInstance("org.jboss.remoting").setLevel= (Level.DEBUG); - org.apache.log4j.Category.getInstance("test").setLevel(Level.DEBUG); - - - String testURL =3D "http://www.webserviceX.NET/globalweather.asmx?op= =3DGetCitiesByCountry"; - - String xml =3D "\n" + - "\n" + - " \n" + - " \n" + - " Germany\n" + - " \n" + - " \n" + - ""; - - Map metadata =3D new HashMap(); - metadata.put(Client.RAW, Boolean.TRUE); - metadata.put("TYPE", "POST"); - - // proxy info - //metadata.put("http.proxyHost", "ginger"); - //metadata.put("http.proxyPort", "80"); - //metadata.put("http.proxy.username", "tom"); - //metadata.put("http.proxy.password", "foobar"); - - Properties headerProps =3D new Properties(); - headerProps.put("SOAPAction", "http://www.webserviceX.NET/GetCitiesB= yCountry"); - headerProps.put("Content-type", "text/xml; charset=3DUTF-8"); - - metadata.put("HEADER", headerProps); - - - HTTPInvokerClientTestCase client =3D new HTTPInvokerClientTestCase(); - - String result =3D client.makeInvocationCall(testURL, xml, metadata); - // 30 characters will be good enough. - assertEquals(getExpectedCityResult().substring(0, 200), result.subst= ring(0, 200)); - - } - - -// public void testGETHTTPInvocation() throws Throwable -// { -// -// org.apache.log4j.BasicConfigurator.configure(); -// org.apache.log4j.Category.getRoot().setLevel(Level.INFO); -// org.apache.log4j.Category.getInstance("org.jgroups").setLevel(Leve= l.INFO); -// org.apache.log4j.Category.getInstance("org.jboss.remoting").setLev= el(Level.DEBUG); -// org.apache.log4j.Category.getInstance("test").setLevel(Level.DEBUG= ); -// -// -// String testURL =3D "http://www.gnu.org/licenses/gpl.html"; -// -// Map metadata =3D new HashMap(); -// metadata.put(Client.RAW, Boolean.TRUE); -// metadata.put("TYPE", "GET"); -// -// HTTPInvokerClientTestCase client =3D new HTTPInvokerClientTestCase= (); -// -// String result =3D client.makeInvocationCall(testURL, null, metadat= a); -// // 30 characters will be good enough. -// assertEquals(getExpectedGETResult().substring(0, 100), result.subs= tring(0, 100)); -// -// } - - private String getExpectedGETResult() - { - return "GNU General Public License - " + - "GNU Project - Free Software Foundation (FSF)" + - "" + - "

GNU General Public License

" + - "" + - "[ " + - "Czech| English| Japane= se]" + - "" + - "" + + "" + + "[ " + + "Czech| English| Japane= se]" + + "" + + "