Author: jkaputin Date: Thu Dec 21 09:05:20 2006 New Revision: 489407 URL: http://svn.apache.org/viewvc?view=rev&rev=489407 Log: WODEN-86 improved the method names on HTTPLocation class and updated the Ant interchange format writers to handle HTTPLocation instead of java.net.URI for the {http location} property.
Modified: incubator/woden/trunk/java/src/org/apache/woden/ant/CmHttpWriter.java incubator/woden/trunk/java/src/org/apache/woden/ant/CmSoapWriter.java incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensionsTest.java incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPLocationTest.java Modified: incubator/woden/trunk/java/src/org/apache/woden/ant/CmHttpWriter.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/ant/CmHttpWriter.java?view=diff&rev=489407&r1=489406&r2=489407 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/ant/CmHttpWriter.java (original) +++ incubator/woden/trunk/java/src/org/apache/woden/ant/CmHttpWriter.java Thu Dec 21 09:05:20 2006 @@ -27,6 +27,7 @@ import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions; import org.apache.woden.wsdl20.extensions.http.HTTPErrorStatusCode; import org.apache.woden.wsdl20.extensions.http.HTTPHeader; +import org.apache.woden.wsdl20.extensions.http.HTTPLocation; /** * @author Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED]) @@ -91,7 +92,7 @@ .getHttpFaultSerialization()); out.write(PREFIX + ":httpInputSerialization", http .getHttpInputSerialization()); - cmbase.write(PREFIX + ":httpLocation", http.getHttpLocation()); + write(PREFIX + ":httpLocation", http.getHttpLocation()); out.write(PREFIX + ":httpLocationIgnoreUncited", http .isHttpLocationIgnoreUncited()); out.write(PREFIX + ":httpMethod", http.getHttpMethod()); @@ -197,6 +198,15 @@ return; out.write(tag, scheme.toString()); + } + + private void write(String tag, HTTPLocation location) { + + if(location == null) { + return; + } + + out.write(tag, location.getLocationTemplate()); } } Modified: incubator/woden/trunk/java/src/org/apache/woden/ant/CmSoapWriter.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/ant/CmSoapWriter.java?view=diff&rev=489407&r1=489406&r2=489407 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/ant/CmSoapWriter.java (original) +++ incubator/woden/trunk/java/src/org/apache/woden/ant/CmSoapWriter.java Thu Dec 21 09:05:20 2006 @@ -23,6 +23,7 @@ import javax.xml.namespace.QName; import org.apache.woden.wsdl20.ElementDeclaration; +import org.apache.woden.wsdl20.extensions.http.HTTPLocation; import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions; import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultExtensions; import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultReferenceExtensions; @@ -264,4 +265,14 @@ out.endElement(); } + + private void write(String tag, HTTPLocation location) { + + if(location == null) { + return; + } + + out.write(tag, location.getLocationTemplate()); + } + } Modified: incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java?view=diff&rev=489407&r1=489406&r2=489407 ============================================================================== --- incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java (original) +++ incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java Thu Dec 21 09:05:20 2006 @@ -53,7 +53,6 @@ private String leftBrace = "{".intern(); private String rightBrace = "}".intern(); - private String emptyString = "".intern(); public HTTPLocation(String httpLocation) { fLocation = httpLocation; @@ -127,7 +126,7 @@ * Returns the original value of the {http location} property, * prior to any template substitution. */ - public String getHttpLocationTemplate() { + public String getLocationTemplate() { return fLocation; } @@ -145,7 +144,7 @@ * enclosed in curly braces in the returned string. * */ - public String getHttpLocationSubstituted(String[] values) { + public String getLocationSubstituted(String[] values) { if(!isTemplateValid()) { return null; } Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensionsTest.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensionsTest.java?view=diff&rev=489407&r1=489406&r2=489407 ============================================================================== --- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensionsTest.java (original) +++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensionsTest.java Thu Dec 21 09:05:20 2006 @@ -95,7 +95,7 @@ String expected = "http://ws.apache.woden/location"; HTTPLocation httpLoc = httpBindOperExts.getHttpLocation(); - String actual = httpLoc.getHttpLocationTemplate(); + String actual = httpLoc.getLocationTemplate(); assertEquals("Unexpected value for http location", expected, actual); Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPLocationTest.java URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPLocationTest.java?view=diff&rev=489407&r1=489406&r2=489407 ============================================================================== --- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPLocationTest.java (original) +++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/http/HTTPLocationTest.java Thu Dec 21 09:05:20 2006 @@ -64,7 +64,7 @@ public void testGetHttpLocationTemplate() throws Exception { HTTPLocation loc = new HTTPLocation(httpLoc1); - assertEquals(httpLoc1, loc.getHttpLocationTemplate()); + assertEquals(httpLoc1, loc.getLocationTemplate()); } public void testIsTemplateValid() throws Exception @@ -138,62 +138,62 @@ //1 value array, but no template HTTPLocation loc = new HTTPLocation(httpLoc0); - String result = loc.getHttpLocationSubstituted(values1); + String result = loc.getLocationSubstituted(values1); assertEquals(httpLoc0,result); //2 value array, but no template loc = new HTTPLocation(httpLoc0); - result = loc.getHttpLocationSubstituted(values2); + result = loc.getLocationSubstituted(values2); assertEquals(httpLoc0,result); //1 value array and 1 local name template loc = new HTTPLocation(httpLoc1); - result = loc.getHttpLocationSubstituted(values1); + result = loc.getLocationSubstituted(values1); assertEquals("/temperature/ONE",result); //2 value array and 1 local name template loc = new HTTPLocation(httpLoc1); - result = loc.getHttpLocationSubstituted(values2); + result = loc.getLocationSubstituted(values2); assertEquals("/temperature/ONE",result); //1 value array and 2 local name template loc = new HTTPLocation(httpLoc2); - result = loc.getHttpLocationSubstituted(values1); + result = loc.getLocationSubstituted(values1); assertEquals("?op=Quote;key=ONE;amt={amount}",result); //2 value array and 2 local name template loc = new HTTPLocation(httpLoc2); - result = loc.getHttpLocationSubstituted(values2); + result = loc.getLocationSubstituted(values2); assertEquals("?op=Quote;key=ONE;amt=TWO",result); //3 value array and 2 local name template loc = new HTTPLocation(httpLoc2); - result = loc.getHttpLocationSubstituted(values3); + result = loc.getLocationSubstituted(values3); assertEquals("?op=Quote;key=ONE;amt=TWO",result); //empty value array and 3 local name template loc = new HTTPLocation(httpLoc3); - result = loc.getHttpLocationSubstituted(values0); + result = loc.getLocationSubstituted(values0); assertEquals("?first={FirstName};middle={MiddleName};last={LastName}",result); //1 value array and 3 local name template loc = new HTTPLocation(httpLoc3); - result = loc.getHttpLocationSubstituted(values1); + result = loc.getLocationSubstituted(values1); assertEquals("?first=ONE;middle={MiddleName};last={LastName}",result); //2 value array and 3 local name template loc = new HTTPLocation(httpLoc3); - result = loc.getHttpLocationSubstituted(values2); + result = loc.getLocationSubstituted(values2); assertEquals("?first=ONE;middle=TWO;last={LastName}",result); //3 value array and 3 local name template loc = new HTTPLocation(httpLoc3); - result = loc.getHttpLocationSubstituted(values3); + result = loc.getLocationSubstituted(values3); assertEquals("?first=ONE;middle=TWO;last=THREE",result); //4 value array and 3 local name template loc = new HTTPLocation(httpLoc3); - result = loc.getHttpLocationSubstituted(values4); + result = loc.getLocationSubstituted(values4); assertEquals("?first=ONE;middle=TWO;last=THREE",result); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]