Package org.megatome.frame2.errors

Examples of org.megatome.frame2.errors.Errors


   private PluginProxy proxy = null;

   @Before
   public void setUp() throws Exception {
      PluginDef pluginDef = new PluginDef();
      pluginDef.setName("PluginName"); //$NON-NLS-1$
      pluginDef.setType("PluginType"); //$NON-NLS-1$
      Map<String, String> testParams = new HashMap<String, String>();
      testParams.put("param1", "value1"); //$NON-NLS-1$ //$NON-NLS-2$
      pluginDef.setInitParams(testParams);
      MockPluginInterface mockPlugin = new MockPluginInterface(100);
     
      this.proxy = new PluginProxy(pluginDef, mockPlugin);
   }
View Full Code Here


  @SuppressWarnings("unchecked")
  static public RequestProcessor instance(Configuration config,
      ServletContext context, HttpServletRequest request,
      HttpServletResponse response) {

    RequestProcessorDef requestProcessorDef = config
        .getHttpRequestProcessor();
    if (requestProcessorDef != null) {

      Class<RequestProcessor> c = createClass(requestProcessorDef
          .getType());
      if (c == null) {
        return null;
      }
View Full Code Here

  @SuppressWarnings("unchecked")
  static public RequestProcessor instance(Configuration config,
      Element[] elements, String eventPkg) {

    RequestProcessorDef requestProcessorDef = config
        .getSoapRequestProcessor();
    if (requestProcessorDef != null) {

      Class c = createClass(requestProcessorDef.getType());
      if (c == null) {
        return null;
      }

      Object[] objects = { config, elements, eventPkg };
View Full Code Here

            }

            if (eventProxy.isParent()) {
              // put eventNames in arraylist for iteration
              // put events in list mapped by eventName
              JaxbEventBase evt = unmarshall(unmarshaller, DOMStreamConverter
                  .toInputStream(element));
              evt.setValidatingSchema(s);
              eventList.add(evt);
              /*
               * eventList.add((Event)unmarshaller
               * .unmarshal(DOMStreamConverter
               * .toInputStream(this.elements[i])));
               */
              event.setResolve(ResolveType.PARENT);
              event.setEvents(eventList);
              events.add(event);
            } else if (eventProxy.isChildren()) {
              NodeList nodeList = element.getChildNodes();

              for (int j = 0; j < nodeList.getLength(); j++) {
                if (nodeList.item(j).getNodeType() == Node.ELEMENT_NODE) {
                  JaxbEventBase evt = unmarshall(unmarshaller,
                      DOMStreamConverter
                          .toInputStream(nodeList
                              .item(j)));
                  evt.setValidatingSchema(s);
                  eventList.add(evt);
                  /*
                   * eventList.add((Event)unmarshaller
                   * .unmarshal(DOMStreamConverter
                   * .toInputStream(nodeList .item(j))));
View Full Code Here

        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

TOP

Related Classes of org.megatome.frame2.errors.Errors

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.