package net.ihe.xcpd.init.assertion; import java.io.IOException; import org.w3c.dom.Element; import org.xml.sax.SAXException; import org.testng.annotations.Test; import junit.framework.TestCase; /** * * @author abderrazek boufahja * */ public class ElementStringTest extends TestCase { static String ss = "heloo"; public ElementStringTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } @Test(groups="P1") public void testString2Element0() { Element e = null; try { e = ElementString.string2Element0(ss); } catch (SAXException ee) { ee.printStackTrace(); } catch (IOException ee) { ee.printStackTrace(); } String com = null; try { com = ElementString.printAssertion(e); } catch (Exception e1) { e1.printStackTrace(); } assertEquals(ss,com); } @Test(groups="P2") public void testString2Element() { Element e = null; try { e = ElementString.string2Element0(ss); } catch (SAXException ee) { ee.printStackTrace(); } catch (IOException ee) { ee.printStackTrace(); } String com = null; try { com = ElementString.printAssertion(e); } catch (Exception e1) { e1.printStackTrace(); } assertEquals(ss,com); } }