Examples of Pojo


Examples of org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo

    tester.startPage(MockPageWithFormAndAjaxFormSubmitBehavior.class);

    // Get the page
    MockPageWithFormAndAjaxFormSubmitBehavior page = (MockPageWithFormAndAjaxFormSubmitBehavior)tester.getLastRenderedPage();

    Pojo pojo = page.getPojo();

    assertEquals("Mock name", pojo.getName());
    TextField<?> name = (TextField<?>)tester.getComponentFromLastRenderedPage("form:name");
    assertEquals("Mock name", name.getValue());

    assertFalse(page.isExecuted());

    tester.getRequest().getPostParameters().setParameterValue(name.getInputName(), "Mock name");

    // Execute the ajax event
    tester.executeAjaxEvent(MockPageWithFormAndAjaxFormSubmitBehavior.EVENT_COMPONENT,
      "onclick");

    assertTrue("AjaxFormSubmitBehavior.onSubmit() has not been executed in " +
      MockPageWithFormAndAjaxFormSubmitBehavior.class, page.isExecuted());

    assertEquals("Mock name",
      ((TextField<?>)tester.getComponentFromLastRenderedPage("form:name")).getValue());

    // The name of the pojo should still be the same. If the
    // executeAjaxEvent weren't submitting the form the name would have been
    // reset to null, because the form would have been updated but there
    // wouldn't be any data to update it with.
    assertNotNull("executeAjaxEvent() did not properly submit the form", pojo.getName());
    assertEquals("Mock name", pojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo

    form.setValue("name", "New name");
    tester.executeAjaxEvent(MockPageWithFormAndAjaxFormSubmitBehavior.EVENT_COMPONENT,
      "onclick");

    MockPageWithFormAndAjaxFormSubmitBehavior page = (MockPageWithFormAndAjaxFormSubmitBehavior)tester.getLastRenderedPage();
    Pojo pojo = page.getPojo();
    assertEquals("New name", pojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo

    tester.startPage(MockPageWithFormAndAjaxFormSubmitBehavior.class);

    // Get the page
    MockPageWithFormAndAjaxFormSubmitBehavior page = (MockPageWithFormAndAjaxFormSubmitBehavior)tester.getLastRenderedPage();

    Pojo pojo = page.getPojo();

    assertEquals("Mock name", pojo.getName());
    TextField<?> name = (TextField<?>)tester.getComponentFromLastRenderedPage("form:name");
    assertEquals("Mock name", name.getValue());

    assertFalse(page.isExecuted());

    tester.getRequest().getPostParameters().setParameterValue(name.getInputName(), "Mock name");

    // Execute the ajax event
    tester.executeAjaxEvent(MockPageWithFormAndAjaxFormSubmitBehavior.EVENT_COMPONENT,
      "onclick");

    assertTrue("AjaxFormSubmitBehavior.onSubmit() has not been executed in " +
      MockPageWithFormAndAjaxFormSubmitBehavior.class, page.isExecuted());

    assertEquals("Mock name",
      ((TextField<?>)tester.getComponentFromLastRenderedPage("form:name")).getValue());

    // The name of the pojo should still be the same. If the
    // executeAjaxEvent weren't submitting the form the name would have been
    // reset to null, because the form would have been updated but there
    // wouldn't be any data to update it with.
    assertNotNull("executeAjaxEvent() did not properly submit the form", pojo.getName());
    assertEquals("Mock name", pojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo

    form.setValue("name", "New name");
    tester.executeAjaxEvent(MockPageWithFormAndAjaxFormSubmitBehavior.EVENT_COMPONENT,
        "onclick");

    MockPageWithFormAndAjaxFormSubmitBehavior page = (MockPageWithFormAndAjaxFormSubmitBehavior)tester.getLastRenderedPage();
    Pojo pojo = page.getPojo();
    assertEquals("New name", pojo.getName());
  }
View Full Code Here

Examples of org.apache.wicket.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo

    tester.startPage(MockPageWithFormAndAjaxFormSubmitBehavior.class);

    // Get the page
    MockPageWithFormAndAjaxFormSubmitBehavior page = (MockPageWithFormAndAjaxFormSubmitBehavior)tester.getLastRenderedPage();

    Pojo pojo = page.getPojo();

    assertEquals("Mock name", pojo.getName());
    TextField<?> name = (TextField<?>)tester.getComponentFromLastRenderedPage("form:name");
    assertEquals("Mock name", name.getValue());

    assertFalse(page.isExecuted());

    tester.getRequest().getPostParameters().setParameterValue(name.getInputName(), "Mock name");

    // Execute the ajax event
    tester.executeAjaxEvent(MockPageWithFormAndAjaxFormSubmitBehavior.EVENT_COMPONENT,
      "onclick");

    assertTrue("AjaxFormSubmitBehavior.onSubmit() has not been executed in " +
      MockPageWithFormAndAjaxFormSubmitBehavior.class, page.isExecuted());

    assertEquals("Mock name",
      ((TextField<?>)tester.getComponentFromLastRenderedPage("form:name")).getValue());

    // The name of the pojo should still be the same. If the
    // executeAjaxEvent weren't submitting the form the name would have been
    // reset to null, because the form would have been updated but there
    // wouldn't be any data to update it with.
    assertNotNull("executeAjaxEvent() did not properly submit the form", pojo.getName());
    assertEquals("Mock name", pojo.getName());
  }
View Full Code Here

Examples of org.jboss.ejb3.mcint.metadata.Pojo

    */
   @Test
   public void testInjectionSuccess() throws Throwable
   {
      // Get the bean
      Pojo bean = Ejb3RegistrarLocator.locateRegistrar().lookup(MC_BEAN_NAME, Pojo.class);

      // Get the injected instance
      Object injected = bean.getInjectedMember();
      log.info("Got injected instance: " + injected);

      // Ensure we've been injected
      TestCase.assertNotNull("Injected instance was null", injected);
   }
View Full Code Here

Examples of org.jboss.test.aop.basic.POJO

   // Public -------------------------------------------------------

   public void testConstruction()
   {
      System.out.println("RUNNING TEST Construction");
      POJO pojo = new POJO();
      DefaultPOJO d = new DefaultPOJO();
   }
View Full Code Here

Examples of org.jboss.test.aop.bean.POJO

   }

   public void testRemoting() throws Exception
   {
      MBeanServerConnection server = getServer();
      POJO pojo = (POJO)server.invoke(testerName, "testRemoting", noparams, nosig);
      try
      {
         ClassProxy proxy = (ClassProxy)pojo;
         String rtn = pojo.remoteTest(); // invokes remotely
         if (!rtn.equals("hello"))
            throw new Exception("DID NOT GET EXPECTED REMOTE VALUE");
      }
      finally
      {
View Full Code Here

Examples of org.jboss.test.aop.packagedotdot.sub.POJO

      assertTrue(ConstructionInterceptor.intercepted);
      assertTrue(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      POJO pojo = new POJO(1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      Nested nested = new Nested(1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      //Matched by: *.packagedotdot..
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojoA = new POJOA(1, 1);
      assertTrue(ConstructionInterceptor.intercepted);
      assertTrue(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojoB = new POJOB(1, 1);
      assertTrue(ConstructionInterceptor.intercepted);
      assertTrue(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojo = new POJO(1, 1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      nested = new Nested(1, 1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      //Matched by: org.jboss.test.aop.packagedotdot.sub.*..
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojoA = new POJOA(1, 1, 1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojoB = new POJOB(1, 1, 1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);
     
      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
      pojo = new POJO(1, 1, 1);
      assertFalse(ConstructionInterceptor.intercepted);
      assertFalse(NotConstructionInterceptor.intercepted);

      ConstructionInterceptor.intercepted = false;
      NotConstructionInterceptor.intercepted = false;
View Full Code Here

Examples of org.jboss.test.microcontainer.advisor.test.some.Pojo

   {
      Object o1 = getBean("One");
      assertFalse(o1 instanceof Advised);
      assertTrue(o1 instanceof AspectManaged);
      assertTrue(Pojo.class.isAssignableFrom(o1.getClass()));
      Pojo pojo1 = (Pojo)o1;

      Object o2 = getBean("Two");
      assertFalse(o2 instanceof Advised);
      assertTrue(o2 instanceof AspectManaged);
      assertTrue(Pojo.class.isAssignableFrom(o2.getClass()));
      Pojo pojo2 = (Pojo)o2;
     
      Object o3 = getBean("Three");
      assertFalse(o3 instanceof Advised);
      assertFalse(o3 instanceof AspectManaged);
      assertTrue(Pojo.class.equals(o3.getClass()));
      Pojo pojo3 = (Pojo)o3;
     
      Object o4 = getBean("Four");
      assertFalse(o4 instanceof Advised);
      assertTrue(o4 instanceof AspectManaged);
      assertTrue(org.jboss.test.microcontainer.advisor.test.another.Pojo.class.isAssignableFrom(o4.getClass()));
      assertTrue(o4 instanceof org.jboss.test.microcontainer.advisor.test.another.Pojo);

      assertTrue(pojo1.getInstance() == pojo2.getInstance());
      assertFalse(pojo1.getInstance() == pojo3.getInstance());
   }
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.