1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.submit.filters;
14
15 import junit.framework.TestCase;
16
17 public class RemoveEmptyContentRequestFilterTestCase extends TestCase
18 {
19 public void testRemoval() throws Exception
20 {
21 doRemoval( "<test><testing/></test>", "<test/>" );
22 doRemoval( "<test><testing test=\"\"/></test>", "<test/>" );
23
24 doRemoval( "<test><testing> </testing></test>", "<test/>" );
25 doRemoval( "<test><testing> <testar test=\"\"></testar> </testing></test>",
26 "<test><testing> </testing></test>" );
27
28 doRemoval( "<test><testing>\n <testar test=\"\"></testar>\n </testing></test>",
29 "<test><testing>\n \n </testing></test>" );
30
31 doRemoval( "<test></test>", "<test></test>" );
32
33 doRemoval( "<test><testing/><testing/></test>", "<test/>" );
34 doRemoval(
35 "<dat1:documentType xmlns:dat1=\"test\"><dat1:listName test=\"\" xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/></dat1:documentType>",
36 "<dat1:documentType xmlns:dat1=\"test\"/>" );
37
38 }
39
40 public void doRemoval( String request, String expected ) throws Exception
41 {
42 assertEquals( expected, RemoveEmptyContentRequestFilter.removeEmptyContent( request, null, true ) );
43 }
44 }