Examples of HTTPLocation


Examples of kku.cs.util.HTTPLocation

  private boolean isApplet = false;

  public GameLoader() {
    ClasspathLocation.addClass(this.getClass());
    ResourceLoader.addResourceLocation(new HTTPLocation());
  }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

            URI soapMep = soapBindingOperationExtensions.getSoapMep();
            if (soapMep != null) {
                axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_MEP,
                                                 soapMep.toString());
            }
            HTTPLocation httpLocation = soapBindingOperationExtensions.getHttpLocation();
            // If httpLocation is not null we should extract a constant part from it and add its value and the
            // corresponding AxisOperation to a map in order to dispatch rest messages. If httpLocation is null we add
            // the operation name into this map.
            String httpLocationString = "";
            if (httpLocation != null) {
                String httpLocationTemplete = httpLocation.getOriginalLocation();
                axisBindingOperation
                        .setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, httpLocationTemplete);
                httpLocationString = RESTUtil.getConstantFromHTTPLocation(httpLocationTemplete, HTTPConstants.HEADER_POST);

            }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

                    }
                }
            }
            axisBindingOperation
                    .setProperty(WSDL2Constants.ATTR_WHTTP_METHOD, httpMethod);
            HTTPLocation httpLocation = httpBindingOperationExtensions.getHttpLocation();

            // If httpLocation is not null we should extract a constant part from it and add its value and the
            // corresponding AxisOperation to a map in order to dispatch rest messages. If httpLocation is null we add
            // the operation name into this map.
            String httpLocationString = "";
            if (httpLocation != null) {
                String httpLocationTemplete = httpLocation.getOriginalLocation();
                axisBindingOperation
                        .setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, httpLocationTemplete);
                httpLocationString = RESTUtil.getConstantFromHTTPLocation(httpLocationTemplete, httpMethod);

            }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

        if( (SOAPConstants.VERSION_1_2.equals(version) && protocol.equals(SOAPConstants.PROTOCOL_URI_SOAP12_HTTP)) ||
            (SOAPConstants.VERSION_1_1.equals(version) && protocol.equals(SOAPConstants.PROTOCOL_URI_SOAP11_HTTP)) )
        {
            StringAttr httpLoc = (StringAttr) ((WSDLElement)getParent())
                .getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
            return httpLoc != null ? new HTTPLocation(httpLoc.getString()) : null;
        }
        else
        {
            return null;
        }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

   * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
   */
  public HTTPLocation getHttpLocation() {
    StringAttr httpLoc = (StringAttr) ((WSDLElement) getParent())
        .getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
    return httpLoc != null ? new HTTPLocation(httpLoc.getString()) : null;
  }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

        return new TestSuite(HTTPLocationTest.class);
    }
   
    public void testCtor() throws Exception
    {
        HTTPLocation loc;
       
        //empty string
        loc = new HTTPLocation("");
        assertNotNull(loc);
       
        //no curly braces
        loc = new HTTPLocation("/temperature/");
        assertNotNull(loc);
       
        //no curly braces, path and query string
        loc = new HTTPLocation("/temperature/town?month=Jan&day=01");
        assertNotNull(loc);
       
        //one local name
        loc = new HTTPLocation("/temperature/{town}/");
        assertNotNull(loc);
       
        //multiple local names
        loc = new HTTPLocation("/temperature/{town}/{state}/{country}");
        assertNotNull(loc);
       
        //multiple local names, encoded & raw, path & query string
        loc = new HTTPLocation("/temperature/{town}/{!state}/{country}?month={mth}&date={!dt}");
        assertNotNull(loc);
       
        //with double curly braces
        loc = new HTTPLocation("{{XXX}}/temperature/{town}/{{{state}}}/{country}");
        assertNotNull(loc);
       
        //invalid template
        loc = new HTTPLocation("{{XXX}}/te}mp}erature/{town}/{state}/{coun{try}");
        assertNotNull(loc);
       
    }
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

       
    }
   
    public void testGetTemplates_noArg() {
       
        HTTPLocation loc;
        loc = new HTTPLocation("/temperature/{town}/{!state}/{country}?temp={tmp}&month={mth}&date={!dt}&place={town}");
       
        HTTPLocationTemplate[] templates = loc.getTemplates();
        assertEquals("Incorrect number of templates", 7, templates.length);
       
        loc = new HTTPLocation("/travel/flight?no=BA6&dep=13.55");
        templates = loc.getTemplates();
        assertEquals("Unexpected templates", 0, templates.length);
       
        loc = new HTTPLocation("/in}valid/abc?{localname}");
        templates = loc.getTemplates();
        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
       
    public void testGetTemplatesInPath_noArg() {
       
        HTTPLocation loc;
        loc = new HTTPLocation("/temperature/{town}/{!state}/{country}?temp={tmp}&month={mth}&date={!dt}&place={town}");
       
        HTTPLocationTemplate[] templates = loc.getTemplatesInPath();
        assertEquals("Incorrect number of templates", 3, templates.length);
        for(int i=0; i<templates.length; i++) {
            assertFalse(templates[i].isQuery());
        }
       
        loc = new HTTPLocation("/travel/flight?no=BA6&dep=13.55");
        templates = loc.getTemplatesInPath();
        assertEquals("Unexpected templates", 0, templates.length);
       
        loc = new HTTPLocation("/in}valid/{localname}?abc");
        templates = loc.getTemplatesInPath();
        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
       
    public void testGetTemplatesInQuery_noArg() {
       
        HTTPLocation loc;
        loc = new HTTPLocation("/temperature/{town}/{!state}/{country}?temp={tmp}&month={mth}&date={!dt}&place={town}");
       
        HTTPLocationTemplate[] templates = loc.getTemplatesInQuery();
        assertEquals("Incorrect number of templates", 4, templates.length);
        for(int i=0; i<templates.length; i++) {
            assertTrue(templates[i].isQuery());
        }
       
        loc = new HTTPLocation("/travel/flight?no=BA6&dep=13.55");
        templates = loc.getTemplatesInQuery();
        assertEquals("Unexpected templates", 0, templates.length);
       
        loc = new HTTPLocation("/in}valid/abc?{localname}");
        templates = loc.getTemplatesInQuery();
        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
View Full Code Here

Examples of org.apache.woden.wsdl20.extensions.http.HTTPLocation

        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
       
    public void testGetTemplates_oneArg() {
       
        HTTPLocation loc;
        loc = new HTTPLocation("/temperature/{town}/{!state}/{country}?temp={tmp}&month={mth}&date={!dt}&place={town}");
       
        HTTPLocationTemplate[] templates = loc.getTemplates("town");
        assertEquals("Incorrect number of templates", 2, templates.length);
       
        templates = loc.getTemplates("state");
        assertEquals("Incorrect number of templates", 1, templates.length);
       
        templates = loc.getTemplates("mth");
        assertEquals("Incorrect number of templates", 1, templates.length);
       
        templates = loc.getTemplates("dummy");
        assertEquals("Unexpected templates", 0, templates.length);
       
        loc = new HTTPLocation("/travel/flight?no=BA6&dep=13.55");
        templates = loc.getTemplates("dummy");
        assertEquals("Unexpected templates", 0, templates.length);
       
        loc = new HTTPLocation("/in}valid/abc?{localname}");
        templates = loc.getTemplates("localname");
        assertEquals("Location is invalid, so no templates were expected", 0, templates.length);
    }   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.