juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/src/java/org/apache/juddi/handler AddressLineHandler.java
Date Tue, 15 Feb 2005 08:10:34 GMT
sviens      2005/02/15 00:10:33

  Modified:    src/java/org/apache/juddi/handler AddressLineHandler.java
  Log:
  Updated test driver in main()
  
  Revision  Changes    Path
  1.4       +23 -14    ws-juddi/src/java/org/apache/juddi/handler/AddressLineHandler.java
  
  Index: AddressLineHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/handler/AddressLineHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AddressLineHandler.java	6 Feb 2005 02:52:07 -0000	1.3
  +++ AddressLineHandler.java	15 Feb 2005 08:10:33 -0000	1.4
  @@ -88,20 +88,29 @@
     public static void main(String args[])
       throws Exception
     {
  -    // create the source object
  -    AddressLine lineIn = new AddressLine("AddressLine1","keyNameAttr","keyValueAttr");
  +      HandlerMaker maker = HandlerMaker.getInstance();
  +      AbstractHandler handler = maker.lookup(AddressLineHandler.TAG_NAME);
  +      Element parent = XMLUtils.newRootElement();
  +      Element child = null;
   
  -    // unmarshal & marshal (object->xml->object)
  -    HandlerMaker maker = HandlerMaker.getInstance();
  -    AbstractHandler handler = maker.lookup(AddressLineHandler.TAG_NAME);
  -    Element element = null;
  -    handler.marshal(lineIn,element);
  -    AddressLine lineOut = (AddressLine)handler.unmarshal(element);
  -
  -    // compare unmarshaled with marshaled obj
  -    if (lineOut.equals(lineIn))
  -      System.out.println("Input and output are the same.");
  -    else
  -      System.out.println("Input and output are NOT the same!");
  +      AddressLine object = new AddressLine("AddressLine1","keyNameAttr","keyValueAttr");
  +
  +      System.out.println();
  +
  +      RegistryObject regObject = object;
  +      handler.marshal(regObject,parent);
  +      child = (Element)parent.getFirstChild();
  +      parent.removeChild(child);
  +      XMLUtils.writeXML(child,System.out);
  +
  +      System.out.println();
  +
  +      regObject = handler.unmarshal(child);
  +      handler.marshal(regObject,parent);
  +      child = (Element)parent.getFirstChild();
  +      parent.removeChild(child);
  +      XMLUtils.writeXML(child,System.out);
  +
  +      System.out.println();
     }
   }
  \ No newline at end of file
  
  
  

Mime
View raw message