Examples of PurchaseOrderType


Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  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

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

    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

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  }

  @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

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

   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

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

    SoapEventMap event = events.get(0);
    Object obj = event.getEvents().get(0);

    assertTrue(obj instanceof PurchaseOrderType);

    PurchaseOrderType po = (PurchaseOrderType) obj;

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

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  @Test
  public void testCallHandler() throws Exception {
    SoapRequestProcessor processor = (SoapRequestProcessor) RequestProcessorFactory
        .instance(this.config, this.elements, TARGET_PKG);

    PurchaseOrderType poi = new PurchaseOrderType();

    ForwardProxy response = processor.callHandlers(this.elements[0]
        .getNodeName(), poi, ViewType.XML);

    assertEquals("key1", response.getPath()); //$NON-NLS-1$

    Context context = processor.getContextWrapper();

    assertSame(poi, context.getRequestAttribute(response.getPath()));
    assertEquals(PurchaseOrderHandler.NEW_COMMENT, poi.getComment());
  }
View Full Code Here

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  @Test
  public void testCallHandlerReponder() throws Exception {
    SoapRequestProcessor processor = (SoapRequestProcessor) RequestProcessorFactory
        .instance(this.config, this.elements, TARGET_PKG);

    PurchaseOrderType poi = new PurchaseOrderType();

    ForwardProxy response = processor.callHandlers(
        "POResponderOrder", poi, ViewType.XML); //$NON-NLS-1$
    assertTrue(response.isResponderType());
View Full Code Here

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

    this.elements = Helper.loadEvents(
        "org/megatome/frame2/jaxb/pochildren.xml", getClass()); //$NON-NLS-1$
    SoapRequestProcessor processor = (SoapRequestProcessor) RequestProcessorFactory
        .instance(this.config, this.elements, TARGET_PKG);

    PurchaseOrderType poi = new PurchaseOrderType();

    ForwardProxy response = processor.callHandlers(
        "POTestChildren", poi, ViewType.XML); //$NON-NLS-1$
    assertTrue(response.isResponderType());
View Full Code Here

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  @Test
  public void testCallHandlerInvalidEvent() throws Exception {
    SoapRequestProcessor processor = (SoapRequestProcessor) RequestProcessorFactory
        .instance(this.config, this.elements, TARGET_PKG);

    PurchaseOrderType poi = new PurchaseOrderType();

    try {
      processor.callHandlers("InvalidEvent", poi, ViewType.XML); //$NON-NLS-1$
      fail();
    } catch (Frame2Exception expected) {
View Full Code Here

Examples of org.megatome.frame2.jaxbgen.PurchaseOrderType

  @Test
  public void testMarshalResponse() throws Exception {
    SoapRequestProcessor processor = (SoapRequestProcessor) RequestProcessorFactory
        .instance(this.config, this.elements, TARGET_PKG);

    PurchaseOrderType poi = getResponseObject("org/megatome/frame2/jaxb/po.xml"); //$NON-NLS-1$
    ObjectFactory of = new ObjectFactory();

    Element element = processor.marshallResponse(of
        .createPurchaseOrder(poi));
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.