Examples of Pojo


Examples of com.bubble.serializer.objects.Pojo

  /*
   * Test method for 'com.bubble.serializer.FieldResolver.getField(Class, String)'
   */
  public void testGetField() {
    Pojo pojo = new Pojo(4);
    Field f = FieldResolver.getField(Pojo.class, "value");
    int val = FieldResolver.getInt(f, pojo);
    assertEquals(4, val);
    FieldResolver.setInt(f, pojo, 7);
    assertEquals(7, pojo.getValue());
  }
View Full Code Here

Examples of com.director.test.Pojo

            Provider provider = configuration.getProvider("test-remoting-provider");
            provider.process(new HttpServletInputOutputAdapter(request, response));
            String result = out.toString();
            System.out.println("result = " + result);
         }
      }, new Object[]{new Pojo[]{new Pojo(1L), new Pojo(2L)}});

      this.doJsonRequest("testAction", "methodWithArray", new RequestWorker() {
         @Override
         public void doInRequest(HttpServletRequest request, HttpServletResponse response, Writer out) throws Exception {
            Provider provider = configuration.getProvider("test-remoting-provider");
            provider.process(new HttpServletInputOutputAdapter(request, response));
            String result = out.toString();
            System.out.println("result = " + result);
         }
      }, new Pojo(1L));
   }
View Full Code Here

Examples of example.Pojo

public class PojoTest {

    @Test
    public void test() throws IOException, SAXException {
        Smooks smooks = new Smooks("smooks-config.xml");
        Pojo pojo = new Pojo(smooks);
        Order order = pojo.filter("input-message.xml");

        assertNotNull(order);
        assertNotNull(order.getHeader());
        assertNotNull(order.getOrderItems());
        assertEquals(2, order.getOrderItems().size());
View Full Code Here

Examples of net.sourceforge.javautil.common.proxy.pojo.Pojo

  public Object getTarget() { return target; }

  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    if (method.getDeclaringClass() == Object.class) return method.invoke(target, args);
   
    Pojo pojo = method.getAnnotation(Pojo.class);
    ClassMethod cm = null;
    Object returnValue = null;
    if (pojo != null) {
      cm = targetType.getMethod(pojo.value());
    } else {
      cm = targetType.findMethod(method.getName(), args);
    }
    if (cm != null) returnValue = cm.invoke(target, args);
    else if (this.allEventHandler != null && method.getAnnotation(CollectionProxyCondition.class) == null) {
View Full Code Here

Examples of org.apache.felix.ipojo.Pojo

        // Get foo object
        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

        // Cast to POJO
        Pojo pojo = (Pojo) fs;
        Field im = fs.getClass().getDeclaredField("__IM");
        assertNotNull(im);
        im.setAccessible(true);
        assertNotNull(im.get(fs));

        Method method = fs.getClass().getMethod("getComponentInstance");
        assertNotNull(method);

        // GetComponentInstance
        ComponentInstance instance = pojo.getComponentInstance();
        assertNotNull(instance);
        assertEquals("Check component instance name", instance.getInstanceName(), compName);
        assertEquals("Check component factory name", instance.getFactory().getName(), factName);
        assertNotNull("Instance description not null", instance.getInstanceDescription());
        PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();
View Full Code Here

Examples of org.apache.felix.ipojo.Pojo

    /*
     * If this is a Apam native component (iPOJO+APAM) then just follow the
     * chained references
     */
    if (service instanceof Pojo) {
      Pojo pojo = (Pojo) service;
      if (pojo.getComponentInstance() instanceof ApformInstance) {
        ApformInstance apform = (ApformInstance) pojo.getComponentInstance();
        return apform.getApamComponent();
      }
    }

    // it is a legacy, use brute force
View Full Code Here

Examples of org.apache.felix.ipojo.Pojo

      for (ServiceReference serviceReference : trackedReferences != null ? trackedReferences : new ServiceReference[0]) {

        Object factoryName = serviceReference.getProperty("factory.name");
        if ( factoryName != null && component.getName().equals(factoryName)) {

          Pojo pojo = (Pojo) instancesServiceTracker.getService(serviceReference);
          if (pojo != null) {
                instanceBound(serviceReference,pojo.getComponentInstance());
          }
        }
      }
    }
   
View Full Code Here

Examples of org.apache.felix.ipojo.Pojo

   
    // Get foo object
    FooService fs = (FooService) getServiceObject(ref);
   
    // Cast to POJO
    Pojo pojo = (Pojo) fs;
   
    // GetComponentInstance
    ComponentInstance instance = pojo.getComponentInstance();
    assertEquals("Check component instance name", instance.getInstanceName(), compName);
    assertEquals("Check component factory name", instance.getFactory().getName(), factName);
    assertNotNull("Instance description not null", instance.getInstanceDescription());
    PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();
    assertTrue("Check instance state", id.getState() == ComponentInstance.VALID);
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
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.