Package org.megatome.frame2.plugin

Examples of org.megatome.frame2.plugin.PluginInterface


        Marshaller marshaller = jcontext.createMarshaller();

        Document doc = getTargetDocument();
       
        if (obj instanceof JaxbEventBase) {
          JaxbEventBase jeb = (JaxbEventBase)obj;
          marshaller.marshal(jeb.getMarshallableType(), doc);
        } else {
          marshaller.marshal(obj, doc);
        }
        result = doc.getDocumentElement();
      } catch (JAXBException e) {
View Full Code Here


    USAddress address = po.getShipTo();

    assertNotNull(address);
    assertEquals("Alice Smith", address.getName()); //$NON-NLS-1$

    Items items = po.getItems();

    assertNotNull(items);
    assertEquals(2, items.getItem().size());
  }
View Full Code Here

    Items.Item item = po.getItems().getItem().get(0);

    item.setComment("This comment has been changed"); //$NON-NLS-1$

    ObjectFactory of = new ObjectFactory();
    OutputStream ostream = Helper.marshall(of.createPurchaseOrder(po),
        TARGET_PACKAGE, getClass().getClassLoader());

    assertTrue(ostream.toString().indexOf("This comment has been changed") > 0); //$NON-NLS-1$
  }
View Full Code Here

  private static final String TARGET_PACKAGE = "org.megatome.frame2.jaxbgen"; //$NON-NLS-1$

  @SuppressWarnings("boxing")
  @Test
  public void testUnmarshall_InputStream() throws Exception {
    PurchaseOrderType po = unmarshall();

    assertNotNull(po);

    assertEquals("1999-10-20", Helper.calendarToString(po.getOrderDate())); //$NON-NLS-1$

    USAddress address = po.getShipTo();

    assertNotNull(address);
    assertEquals("Alice Smith", address.getName()); //$NON-NLS-1$

    Items items = po.getItems();

    assertNotNull(items);
    assertEquals(2, items.getItem().size());
  }
View Full Code Here

    assertEquals(2, items.getItem().size());
  }

  @Test
  public void testMarshall() throws Exception {
    PurchaseOrderType po = unmarshall();

    Items.Item item = po.getItems().getItem().get(0);

    item.setComment("This comment has been changed"); //$NON-NLS-1$

    ObjectFactory of = new ObjectFactory();
    OutputStream ostream = Helper.marshall(of.createPurchaseOrder(po),
View Full Code Here

  }

  @SuppressWarnings("boxing")
  @Test
  public void testValidate() throws Exception {
    PurchaseOrderType po = unmarshall();
    Schema s = loadSchema();
   
    Errors errors = ErrorsFactory.newInstance();

    Items.Item item1 = po.getItems().getItem().get(0);
   
    //assertTrue(po.validate(errors));
    roundTripValidate(po, s, errors);
    assertEquals(0, errors.size());
View Full Code Here

   public POResponderHandler() {
      super();
   }

   public String handle(Event event, Context context) {
      PurchaseOrderType po = (PurchaseOrderType) event;

      po.setComment(NEW_COMMENT);

      context.setRequestAttribute("key1",po); //$NON-NLS-1$
      return null;
   }
View Full Code Here

    assertNotNull(po);

    assertEquals("1999-10-20", Helper.calendarToString(po.getOrderDate())); //$NON-NLS-1$

    USAddress address = po.getShipTo();

    assertNotNull(address);
    assertEquals("Alice Smith", address.getName()); //$NON-NLS-1$

    Items items = po.getItems();

    assertNotNull(items);
    assertEquals(2, items.getItem().size());
View Full Code Here

    static private Logger getDefault(String name) {
        Logger result = null;

        if (STD_LOGGING_AVAILABLE) {
            try {
                result = new StandardLogger(name);
            } catch (Throwable t) {
                STD_LOGGING_AVAILABLE = false;
            }
        }
View Full Code Here

                STD_LOGGING_AVAILABLE = false;
            }
        }

        if (result == null) {
            result = new StdoutLogger(name);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.plugin.PluginInterface

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.