You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by sv...@apache.org on 2005/01/16 04:51:27 UTC

cvs commit: ws-juddi/src/junit/org/apache/juddi/handler HandlerTestCase.java

sviens      2005/01/15 19:51:27

  Added:       src/junit/org/apache/juddi/handler HandlerTestCase.java
  Log:
  Added common utility methods to common abstract (base) class for all jUDDI handler JUnit classes
  
  Revision  Changes    Path
  1.1                  ws-juddi/src/junit/org/apache/juddi/handler/HandlerTestCase.java
  
  Index: HandlerTestCase.java
  ===================================================================
  /*
   * Created on Jan 15, 2005
   *
   * TODO To change the template for this generated file go to
   * Window - Preferences - Java - Code Style - Code Templates
   */
  package org.apache.juddi.handler;
  
  import java.io.IOException;
  import java.io.StringWriter;
  
  import junit.framework.TestCase;
  
  import org.apache.juddi.util.xml.XMLUtils;
  import org.w3c.dom.Element;
  
  /**
   * @author sviens
   *
   * TODO To change the template for this generated type comment go to
   * Window - Preferences - Java - Code Style - Code Templates
   */
  public abstract class HandlerTestCase extends TestCase
  {
  	public HandlerTestCase(String arg0)
  	{
  		super(arg0);
  	}
  	
  	protected final String getXMLString(Element element)
  	{
  		StringWriter writer = new StringWriter();
          
  		XMLUtils.writeXML(element,writer);
  
  		String xmlString = writer.toString();
  
  		try
  		{
  			writer.close();
  		}
  		catch(IOException exp)
  		{
  		}
  
  		return xmlString;
  	}
  }