Revision 51281
Added by Alessia Bardi over 6 years ago
modules/dnet-parthenos/trunk/src/test/java/eu/dnetlib/parthenos/workflows/nodes/VirtuosoParthenosIteratorTest.java | ||
---|---|---|
7 | 7 |
import org.junit.Before; |
8 | 8 |
import org.junit.Test; |
9 | 9 |
|
10 |
import static org.junit.Assert.assertEquals; |
|
10 | 11 |
import static org.junit.Assert.assertTrue; |
11 | 12 |
|
12 | 13 |
/** |
... | ... | |
48 | 49 |
while(it.hasNext()) |
49 | 50 |
System.out.println(it.next()); |
50 | 51 |
} |
52 |
|
|
53 |
@Test |
|
54 |
public void testCompleteXml(){ |
|
55 |
String s = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><rdf:RDF/>"; |
|
56 |
String completed = it.completeXML(s, "theURL"); |
|
57 |
System.out.println(completed); |
|
58 |
} |
|
59 |
|
|
60 |
@Test |
|
61 |
public void testRemoveXmlDeclaration(){ |
|
62 |
String s = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><rdf:RDF"; |
|
63 |
String res = s.replaceAll("\\<\\?xml(.+?)\\?\\>", "").trim(); |
|
64 |
assertEquals("<rdf:RDF", res); |
|
65 |
s = "<rdf:RDF "; |
|
66 |
res = s.replaceAll("\\<\\?xml(.+?)\\?\\>", "").trim(); |
|
67 |
assertEquals("<rdf:RDF", res); |
|
68 |
} |
|
51 | 69 |
} |
Also available in: Unified diff
new tests for xml declaration