Changeset 3974 for trunk/pfixcore/tests
- Timestamp:
- 01/08/09 18:47:31 (3 years ago)
- Location:
- trunk/pfixcore/tests/junit
- Files:
-
- 5 added
- 7 modified
-
de/schlund/pfixcore/example (added)
-
de/schlund/pfixcore/example/AdultInfoHandlerTest.java (added)
-
de/schlund/pfixcore/example/HomePageTest.java (added)
-
de/schlund/pfixcore/example/OrderFlowTest.java (added)
-
de/schlund/pfixcore/example/TShirtWrapperTest.java (added)
-
de/schlund/pfixcore/oxm/BooleanBeanTest.java (modified) (3 diffs)
-
de/schlund/pfixcore/oxm/MapTest.java (modified) (3 diffs)
-
de/schlund/pfixcore/oxm/SetTest.java (modified) (3 diffs)
-
de/schlund/pfixcore/oxm/Test.java (modified) (6 diffs)
-
de/schlund/pfixxml/targets/TargetGeneratorTest.java (modified) (2 diffs)
-
de/schlund/pfixxml/util/XmlTest.java (modified) (2 diffs)
-
org/pustefixframework/config/generic/PropertyFileReaderTest.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pfixcore/tests/junit/de/schlund/pfixcore/oxm/BooleanBeanTest.java
r3570 r3974 28 28 import org.apache.log4j.Logger; 29 29 import org.apache.log4j.PatternLayout; 30 import org.pustefixframework.test.XmlAssert; 30 31 import org.w3c.dom.Document; 31 32 … … 35 36 import de.schlund.pfixcore.oxm.impl.MarshallerImpl; 36 37 import de.schlund.pfixcore.oxm.impl.SerializerRegistry; 37 import de.schlund.pfixxml.util.XMLUtils;38 38 39 39 /** … … 64 64 String expected = "<result admin=\"true\" deleted=\"false\"></result>"; 65 65 Document expDoc = OxmTestHelper.createDocument(expected); 66 X MLUtils.assertEquals(expDoc, doc);66 XmlAssert.assertEquals(expDoc, doc); 67 67 } 68 68 } -
trunk/pfixcore/tests/junit/de/schlund/pfixcore/oxm/MapTest.java
r3423 r3974 28 28 import org.apache.log4j.Logger; 29 29 import org.apache.log4j.PatternLayout; 30 import org.pustefixframework.test.XmlAssert; 30 31 import org.w3c.dom.Document; 31 32 … … 35 36 import de.schlund.pfixcore.oxm.impl.MarshallerImpl; 36 37 import de.schlund.pfixcore.oxm.impl.SerializerRegistry; 37 import de.schlund.pfixxml.util.XMLUtils;38 38 39 39 /** … … 66 66 String expected = "<result><annoMap><element><string>one</string><string>foo</string></element><element><string>two</string><string>bar</string></element></annoMap><myMap><entry><string>one</string><string>foo</string></entry><entry><string>two</string><string>bar</string></entry></myMap></result>"; 67 67 Document expDoc = OxmTestHelper.createDocument(expected); 68 X MLUtils.assertEquals(expDoc, doc);68 XmlAssert.assertEqualsUnordered(expDoc, doc); 69 69 } 70 70 } -
trunk/pfixcore/tests/junit/de/schlund/pfixcore/oxm/SetTest.java
r3967 r3974 28 28 import org.apache.log4j.Logger; 29 29 import org.apache.log4j.PatternLayout; 30 import org.pustefixframework.test.XmlAssert; 30 31 import org.w3c.dom.Document; 31 32 … … 35 36 import de.schlund.pfixcore.oxm.impl.MarshallerImpl; 36 37 import de.schlund.pfixcore.oxm.impl.SerializerRegistry; 37 import de.schlund.pfixxml.util.XMLUtils;38 38 39 39 /** … … 66 66 String expected = "<result><mySet><entry><string>foo</string></entry><entry><string>bar</string></entry></mySet><annoSet><element><string>foo</string></element><element><string>bar</string></element></annoSet></result>"; 67 67 Document expDoc = OxmTestHelper.createDocument(expected); 68 X MLUtils.assertEquals(expDoc, doc);68 XmlAssert.assertEquals(expDoc, doc); 69 69 } 70 70 } -
trunk/pfixcore/tests/junit/de/schlund/pfixcore/oxm/Test.java
r3402 r3974 39 39 import org.apache.log4j.Logger; 40 40 import org.apache.log4j.PatternLayout; 41 import org.pustefixframework.test.XmlAssert; 41 42 import org.w3c.dom.Document; 42 43 … … 80 81 String expected = "<result prio=\"HIGH\" text=\"abc\"><day name=\"FRIDAY\" workingHours=\"6\"/></result>"; 81 82 Document expDoc = OxmTestHelper.createDocument(expected); 82 X MLUtils.assertEquals(expDoc, doc);83 XmlAssert.assertEquals(expDoc, doc); 83 84 84 85 // List with enums … … 93 94 expected = "<result><weekDay workingHours=\"8\" name=\"MONDAY\"/><priority>LOW</priority></result>"; 94 95 expDoc = OxmTestHelper.createDocument(expected); 95 X MLUtils.assertEquals(expDoc, doc);96 XmlAssert.assertEquals(expDoc, doc); 96 97 } 97 98 … … 145 146 Result res = new DOMResult(doc); 146 147 m.marshal(bean, res); 147 X MLUtils.assertEquals(expDoc, doc);148 XmlAssert.assertEqualsUnordered(expDoc, doc); 148 149 } 149 150 … … 160 161 Result res = new DOMResult(doc); 161 162 m.marshal(fBean, res); 162 X MLUtils.assertEquals(expDoc, doc);163 XmlAssert.assertEquals(expDoc, doc); 163 164 } 164 165 … … 177 178 Document expDoc = OxmTestHelper.createDocument(expected); 178 179 179 X MLUtils.assertEquals(expDoc, doc);180 XmlAssert.assertEqualsUnordered(expDoc, doc); 180 181 } 181 182 -
trunk/pfixcore/tests/junit/de/schlund/pfixxml/targets/TargetGeneratorTest.java
r3531 r3974 15 15 16 16 import de.schlund.pfixxml.XMLException; 17 import de.schlund.pfixxml.config.GlobalConfig; 17 18 import de.schlund.pfixxml.config.GlobalConfigurator; 18 19 import de.schlund.pfixxml.resources.FileResource; … … 25 26 26 27 static { 27 GlobalConfigurator.setDocroot(DOCROOT.getAbsolutePath());28 if(GlobalConfig.getDocroot()==null) GlobalConfigurator.setDocroot(DOCROOT.getAbsolutePath()); 28 29 } 29 30 31 @Override 32 protected void tearDown() throws Exception { 33 TargetGeneratorFactory.getInstance().reset(); 34 } 35 30 36 public void testEmpty() throws Exception { 31 37 -
trunk/pfixcore/tests/junit/de/schlund/pfixxml/util/XmlTest.java
r2956 r3974 126 126 127 127 public void testSerializeDecl() throws Exception { 128 assertEquals("<?xml version=\"1.0\" encoding=\" ISO-8859-1\"?><a/>", serialize("<a/>", false, true));128 assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><a/>", serialize("<a/>", false, true)); 129 129 } 130 130 … … 160 160 dest= new ByteArrayOutputStream(); 161 161 Xml.serialize(parse(STR), dest, false, true); 162 checkEquals(("<?xml version=\"1.0\" encoding=\" ISO-8859-1\"?>" + STR).getBytes("ISO-8859-1"), dest.toByteArray());162 checkEquals(("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + STR).getBytes("UTF-8"), dest.toByteArray()); 163 163 } 164 164 -
trunk/pfixcore/tests/junit/org/pustefixframework/config/generic/PropertyFileReaderTest.java
r3804 r3974 4 4 5 5 import java.io.File; 6 import java.io.FileInputStream; 6 7 import java.io.InputStream; 7 8 import java.util.Properties; … … 39 40 @Test 40 41 public void test() throws Exception { 41 42 42 InputStream in = getClass().getResourceAsStream("properties.xml"); 43 if(in==null) in = new FileInputStream(new File("tests/junit/org/pustefixframework/config/generic/properties.xml")); 43 44 Properties props = new Properties(); 44 45 PropertyFileReader.read(in, props);
