Mars.Ma
5 years ago
2 changed files with 52 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||||||
|
package com.fanruan.api.xml; |
||||||
|
|
||||||
|
import com.fr.base.Parameter; |
||||||
|
import com.fr.base.TableData; |
||||||
|
import com.fr.plugin.db.json.core.JSONTableData; |
||||||
|
import com.fr.stable.ParameterProvider; |
||||||
|
import com.fr.stable.bridge.StableFactory; |
||||||
|
import com.fr.stable.xml.StableXMLUtils; |
||||||
|
import com.fr.stable.xml.XMLPrintWriter; |
||||||
|
import com.fr.stable.xml.XMLUtils; |
||||||
|
import com.fr.stable.xml.XMLableReader; |
||||||
|
import com.fr.third.javax.xml.stream.XMLStreamException; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import static org.junit.Assert.*; |
||||||
|
|
||||||
|
public class XmlKitTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void readParameter() { |
||||||
|
try { |
||||||
|
XMLableReader xml = XMLableReader.createXMLableReader("<!-- Edited by XMLSpy® -->\n" + |
||||||
|
"<note>\n" + |
||||||
|
"<Parameter>Tove</Parameter>\n" + |
||||||
|
"<from>Jani</from>\n" + |
||||||
|
"<heading>Reminder</heading>\n" + |
||||||
|
"<body>Don't forget me this weekend!</body>\n" + |
||||||
|
"</note>"); |
||||||
|
Parameter parameter = new Parameter("test", 1); |
||||||
|
StableFactory.registerXMLDescription("Parameter",parameter); |
||||||
|
Parameter p = (Parameter)XmlKit.readParameter(xml); |
||||||
|
Assert.assertTrue(p.getName().equals("test")); |
||||||
|
} catch (XMLStreamException e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue