Package org.skife.jdbi.v2

Examples of org.skife.jdbi.v2.Binding


   * @return True if the binding specified the interface specified by the service or no interface, false otherwise.
   * @throws WSDLException
   */
  protected boolean testAssertionEndpoint1062(Endpoint endpoint, ErrorReporter errorReporter) throws WSDLException
  {
  Binding binding = endpoint.getBinding();
  // If no binding has been specified this assertion does not apply.
  if(binding == null)
    return true;
 
  Interface bindingInterface = binding.getInterface();
  WSDLComponent parent = endpoint.getParent();
  if(parent != null)
  {
    Service service = (Service)parent;
    Interface serviceInterface = service.getInterface();
View Full Code Here


  /**
  * Test that the included binding matches the expected value parsed from the WSDL.
  */
public void testCheckWSDLInclude()
{
     Binding binding1 = fBindings[0];
   
     assertEquals("Unexpected binding name.", "{http://example.com/bank}BankSOAPBinding", binding1.getName().toString());
}
View Full Code Here

     * <code>getHttpQueryParameterSeparatorDefault</code> method matches the expected value parsed
     * from the WSDL.
     */
    public void testGetHttpQueryParameterSeparatorDefault()
    {
        Binding binding1 = fBindings[0];
        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions)binding1
            .getComponentExtensionContext(HTTPConstants.NS_URI_HTTP);
       
        String actual = httpBindExts.getHttpQueryParameterSeparatorDefault();
        assertNotNull("The value for http query parameter separator default was null", actual);
        assertEquals("Unexpected value for http query parameter separator default.",
View Full Code Here

     * from the WSDL.
     */
    public void testIsHttpCookies()
    {
        //test that a whttp:cookies value "true" equates to Boolean(true)
        Binding binding1 = fBindings[0];
        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions)binding1
            .getComponentExtensionContext(HTTPConstants.NS_URI_HTTP);
       
        assertTrue("Expected 'true' for for http cookies.",
                httpBindExts.isHttpCookies().booleanValue());
       
        //test that a whttp:cookies value "false" equates to Boolean(false)
        Binding binding3 = fBindings[2];
        httpBindExts = (HTTPBindingExtensions)binding3
            .getComponentExtensionContext(HTTPConstants.NS_URI_HTTP);
       
        assertFalse("Expected 'false' for for http cookies.",
                httpBindExts.isHttpCookies().booleanValue());
    }
View Full Code Here

     * <code>getContentEncodingDefault</code> method matches the expected value parsed
     * from the WSDL.
     */
    public void testGetHttpContentEncodingDefault()
    {
        Binding binding1 = fBindings[0];
        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions)binding1
            .getComponentExtensionContext(HTTPConstants.NS_URI_HTTP);
       
        String actual = httpBindExts.getHttpContentEncodingDefault();
        assertEquals("Unexpected value for http content encoding default.",
                "chunked",
View Full Code Here

     * Test that the OPTIONAL property {http content encoding default} defaults to null
     * when the whttp:contentEncodingDefault attribute is omitted from the WSDL.
     */
    public void testHttpPropertyDefaults()
    {
        Binding binding2 = fBindings[1];
        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions)binding2
            .getComponentExtensionContext(HTTPConstants.NS_URI_HTTP);
        assertNotNull("The Binding '" +
                binding2.getName() +
                "' does not contain an HTTPBindingExtensions object.");
       
        assertEquals("The {http query parameter separator default} property should default to ampersand '&'",
                "&",
                httpBindExts.getHttpQueryParameterSeparatorDefault());
View Full Code Here

  /**
     * Test that the value for the {bar} property returned by the <code>getFooBar</code>
     * method matches the expected value parsed from the WSDL.
   */
  public void testGetFooBar() {
        Binding binding = null;
        FooBindingExtensions exts = null;
        binding = fBindings[0];
        exts = (FooBindingExtensions)binding
        .getComponentExtensionContext(FooConstants.NS_URI_FOO);
        assertNotNull("The Binding '" + binding.getName() + "' does not contain an FooBindingExtensions object.",
            exts);
        Integer actual = exts.getFooBar();
        assertEquals("Unexpected number of errors", 1, testErrorHandler.numErrors);
        assertEquals("Unexpected error key", "Errors: FOO-001 \n", testErrorHandler.getSummaryOfMessageKeys());

      binding = fBindings[1];
        exts = (FooBindingExtensions)binding
          .getComponentExtensionContext(FooConstants.NS_URI_FOO);
        assertNotNull("The Binding '" + binding.getName() + "' does not contain an FooBindingExtensions object.",
                exts);
       
        actual = exts.getFooBar();
        assertNotNull("The value for bar was null", actual);
        assertEquals("Unexpected value for bar.", 3, actual.intValue());
View Full Code Here

  /**
     * Test that the value for the {baz} property returned by the <code>getFooBaz</code>
     * method matches the expected value parsed from the WSDL.
   */
  public void testGetFooBaz() {
        Binding binding1 = fBindings[1];
        FooBindingExtensions exts = (FooBindingExtensions)binding1
          .getComponentExtensionContext(FooConstants.NS_URI_FOO);
        assertNotNull("The Binding '" + binding1.getName() + "' does not contain an FooBindingExtensions object.",
                exts);
       
        String actual = exts.getFooBaz();
        assertNotNull("The value for bar was null", actual);
        assertEquals("Unexpected value for baz.", "john", actual);
View Full Code Here

    private void addDeleteById(JDefinedClass classDefinition, Table table, Class clazz) {
        JMethod method = classDefinition.method(JMod.ABSTRACT, Integer.class, "delete" + clazz.getSimpleName());
        JAnnotationUse deleteAnnotation = method.annotate(SqlUpdate.class);
        SqlDeleteByPk sqlDeleteById = new SqlDeleteByPk(table);
        deleteAnnotation.param("value", sqlDeleteById.generate(new Binding()));
        for (Column column : table.getPrimaryKeyColumns()) {
            JVar param = method.param(column.getField().getType(), uncapitalize(column.getFieldName()));
            JAnnotationUse bind = param.annotate(Bind.class);
            bind.param("value", uncapitalize(column.getFieldName()));
        }
View Full Code Here

        method.type();
        method.annotate(StrategyAwareMapBean.class);
        method.annotate(SingleValueResult.class);
        JAnnotationUse selectAnnotation = method.annotate(SqlQuery.class);
        SqlSelectByPK sqlSelectById = new SqlSelectByPK(table);
        selectAnnotation.param("value", sqlSelectById.generate(new Binding()));
        for (Column column : table.getPrimaryKeyColumns()) {
            JVar param = method.param(column.getField().getType(), uncapitalize(column.getFieldName()));
            JAnnotationUse bind = param.annotate(Bind.class);
            bind.param("value", uncapitalize(column.getFieldName()));
        }
View Full Code Here

TOP

Related Classes of org.skife.jdbi.v2.Binding

Copyright © 2018 www.massapicom. 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.