Examples of MockPojo


Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }
    };
    page.add(link);

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;

      public Page getTestPage()
      {
        return page;
      }
    });

    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    page.getNameField().setModelValue(new String[] { "new mock value" });

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLinkInsideForm_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink("link")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    });

    tester.startPage(page);

    tester.assertRenderedPage(MockPageWithFormAndContainedLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("form:link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    };
    page.add(link);

    tester.startPage(page);
    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLinkInsideForm_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink("link")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    });

    tester.startPage(page);

    tester.assertRenderedPage(MockPageWithFormAndContainedLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("form:link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }

      @Override
      protected void onError(AjaxRequestTarget target, Form<?> form)
      {
      }
    };
    page.add(link);

    tester.startPage(page);
    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(page.getNameField().getInputName(), "new mock value");

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLinkInsideForm_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndContainedLink page = new MockPageWithFormAndContainedLink(mockPojo);
    page.addLink(new AjaxSubmitLink<Void>("link")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }
    });

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;

      public Page<?> getTestPage()
      {
        return page;
      }
    });

    tester.assertRenderedPage(MockPageWithFormAndContainedLink.class);

    // Change the name in the textfield
    page.getNameField().setModelValue(new String[] { "new mock value" });

    // Click the submit link
    tester.clickLink("form:link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink()
  {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");

    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink<?> link = new AjaxSubmitLink<Void>("link", page.getForm())
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {
        assertNotNull(form);
        linkClicked = true;
      }
    };
    page.add(link);

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;

      public Page<?> getTestPage()
      {
        return page;
      }
    });

    tester.assertRenderedPage(MockPageWithFormAndLink.class);

    // Change the name in the textfield
    page.getNameField().setModelValue(new String[] { "new mock value" });

    // Click the submit link
    tester.clickLink("link");

    // Has it really been clicked?
    assertTrue(linkClicked);

    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.apps_5.MockPageWithFormAndLink.MockPojo

  /**
   *
   */
  public void testClickLink_ajaxSubmitLink() {
    MockPojo mockPojo = new MockPageWithFormAndLink.MockPojo();
    mockPojo.setName("Mock name");
   
    final MockPageWithFormAndLink page = new MockPageWithFormAndLink(mockPojo);
    AjaxSubmitLink link = new AjaxSubmitLink("link", page.getForm()) {
      private static final long serialVersionUID = 1L;

      protected void onSubmit(AjaxRequestTarget target, Form form)
      {
        linkClicked = true;
      }
    };
    page.add(link);
   
    tester.startPage(new ITestPageSource() {
      private static final long serialVersionUID = 1L;

      public Page getTestPage()
      {
        return page;
      }
    });
   
    tester.assertRenderedPage(MockPageWithFormAndLink.class);
   
    // Change the name in the textfield
    page.getNameField().setModelValue("new mock value");

    // Click the submit link
    tester.clickLink("link");
   
    // Has it really been clicked?
    assertTrue(linkClicked);
   
    // And has the form been "submitted"
    assertEquals("new mock value", mockPojo.getName());
  }
View Full Code Here

Examples of org.jboss.soa.esb.actions.MockPojoAction.MockPojo

public class ObjectInvokeTest {

  @Test
  public void testObjectInvoke() throws Exception {
   
       MockPojo pojoObj = new MockPojo();
       pojoObj.name="Hello";
       String name = pojoObj.name;

         MockPojoAction.MockPojo pojo = ( MockPojoAction.MockPojo ) test_invoke(MockPojoAction.class.getName(), "doPojoAction", pojoObj);
   
View Full Code Here

Examples of org.jboss.soa.esb.actions.MockPojoAction.MockPojo

       Assert.assertNotSame(" Process didn't work " , name,pojo.name);
  }
 
    //@Test
    public void test_unknownProcesor() throws Exception {
        test_invoke("com.acme.UnknownProcessor", "doPojoAction", new MockPojo());
        // Expected a ConfigurationException of some sort here!!
    }
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.