cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r1023418 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/
Date Sun, 17 Oct 2010 02:31:18 GMT
Author: bimargulies
Date: Sun Oct 17 02:31:17 2010
New Revision: 1023418

URL: http://svn.apache.org/viewvc?rev=1023418&view=rev
Log:
Make some test failures more verbose. Eliminate another invalid call to getItems().add().
Make an element toplevel that needs
to be toplevel.

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/AttributeVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?rev=1023418&r1=1023417&r2=1023418&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Sun Oct 17 02:31:17 2010
@@ -52,7 +52,7 @@ import org.junit.rules.TemporaryFolder;
 public class ProcessorTestBase extends Assert {
 
     public static final List<String> DEFAULT_IGNORE_ATTR = Arrays.asList(new String[]{"attributeFormDefault",
-                                                                                      "elementFormDefault",

+                                                                                      "elementFormDefault",
                                                                                       "form",
                                                                                       "version",
                                                                                       "part@name"});
@@ -68,7 +68,7 @@ public class ProcessorTestBase extends A
         }
     };
     //CHECKSTYLE:ON
-    
+
     protected File output;
     protected ToolContext env = new ToolContext();
 
@@ -198,7 +198,7 @@ public class ProcessorTestBase extends A
         return assertXmlEquals(expected, source, attr);
     }
 
-    public boolean assertXmlEquals(final File expected, final File source, 
+    public boolean assertXmlEquals(final File expected, final File source,
                                    final List<String> ignoreAttr) throws Exception
{
         List<Tag> expectedTags = ToolsStaxUtils.getTags(expected);
         List<Tag> sourceTags = ToolsStaxUtils.getTags(source);
@@ -208,8 +208,8 @@ public class ProcessorTestBase extends A
         for (Tag expectedTag : expectedTags) {
             Tag sourceTag = iterator.next();
             if (!expectedTag.getName().equals(sourceTag.getName())) {
-                throw new ComparisonFailure("Tags not equal: ", 
-                                            expectedTag.getName().toString(), 
+                throw new ComparisonFailure("Tags not equal: ",
+                                            expectedTag.getName().toString(),
                                             sourceTag.getName().toString());
             }
             for (Map.Entry<QName, String> attr : expectedTag.getAttributes().entrySet())
{
@@ -219,9 +219,9 @@ public class ProcessorTestBase extends A
 
                 if (sourceTag.getAttributes().containsKey(attr.getKey())) {
                     if (!sourceTag.getAttributes().get(attr.getKey()).equals(attr.getValue()))
{
-                        throw new ComparisonFailure("Attributes not equal: ", 
-                                                attr.getKey() + ":" + attr.getValue(), 
-                                                attr.getKey() + ":" 
+                        throw new ComparisonFailure("Attributes not equal: ",
+                                                attr.getKey() + ":" + attr.getValue(),
+                                                attr.getKey() + ":"
                                                 + sourceTag.getAttributes().get(attr.getKey()).toString());
                     }
                 } else {
@@ -231,8 +231,8 @@ public class ProcessorTestBase extends A
 
             if (!StringUtils.isEmpty(expectedTag.getText())
                 && !expectedTag.getText().equals(sourceTag.getText())) {
-                throw new ComparisonFailure("Text not equal: ", 
-                                            expectedTag.getText().toString(), 
+                throw new ComparisonFailure("Text not equal: ",
+                                            expectedTag.getText().toString(),
                                             sourceTag.getText().toString());
             }
         }
@@ -245,7 +245,7 @@ public class ProcessorTestBase extends A
 
     protected void assertAttributesEquals(QName element,
                                           Map<QName, String> q1,
-                                          Map<QName, String> q2, 
+                                          Map<QName, String> q2,
                                           Collection<String> ignoreAttr) {
         for (Map.Entry<QName, String>  attr : q1.entrySet()) {
             if (ignoreAttr.contains(attr.getKey().getLocalPart())
@@ -253,52 +253,53 @@ public class ProcessorTestBase extends A
                                        + attr.getKey().getLocalPart())) {
                 continue;
             }
-            
+
             String found = q2.get(attr.getKey());
             if (found == null) {
-                throw new AssertionError("Attribute: " + attr.getKey() 
-                                         + " is missing in " 
-                                         + element);                
+                throw new AssertionError("Attribute: " + attr.getKey()
+                                         + " is missing in "
+                                         + element);
             }
             if (!found.equals(attr.getValue())) {
-                throw new ComparisonFailure("Attribute not equal: ", 
-                                            attr.getKey() + ":" + attr.getValue(), 
-                                            attr.getKey() + ":" + found); 
+                throw new ComparisonFailure("Attribute not equal: ",
+                                            attr.getKey() + ":" + attr.getValue(),
+                                            attr.getKey() + ":" + found);
             }
         }
     }
 
-    protected void assertTagEquals(Tag expected, Tag source, 
-                                   final List<String> ignoreAttr, 
+    protected void assertTagEquals(Tag expected, Tag source,
+                                   final List<String> ignoreAttr,
                                    final List<String> ignoreTag) {
         if (!expected.getName().equals(source.getName())) {
-            throw new ComparisonFailure("Tags not equal: ", 
-                                        expected.getName().toString(), 
+            throw new ComparisonFailure("Tags not equal: ",
+                                        expected.getName().toString(),
                                         source.getName().toString());
         }
 
-        assertAttributesEquals(expected.getName(), 
+        assertAttributesEquals(expected.getName(),
                                expected.getAttributes(), source.getAttributes(), ignoreAttr);
         assertAttributesEquals(expected.getName(),
                                source.getAttributes(), expected.getAttributes(), ignoreAttr);
 
         if (!StringUtils.isEmpty(expected.getText())
                 && !expected.getText().equals(source.getText())) {
-            throw new ComparisonFailure("Text not equal: ", 
-                                        expected.getText().toString(), 
+            throw new ComparisonFailure("Text not equal: ",
+                                        expected.getText().toString(),
                                         source.getText().toString());
         }
 
         if (!expected.getTags().isEmpty()) {
             for (Tag expectedTag : expected.getTags()) {
-                if (ignoreTag.contains(expectedTag.getName().getLocalPart()) 
+                if (ignoreTag.contains(expectedTag.getName().getLocalPart())
                     && expectedTag.getTags().isEmpty()) {
                     continue;
-                } 
+                }
                 Tag sourceTag = getFromSource(source, expectedTag);
                 if (sourceTag == null) {
-                    throw new AssertionError("\n" + expected.toString() 
-                                             + " is missing in the source file");
+                    throw new AssertionError("\n" + expected.toString()
+                                             + " is missing in the source file:"
+                                             + "\n" + source.toString());
                 }
                 assertTagEquals(expectedTag, sourceTag, ignoreAttr, ignoreTag);
             }
@@ -314,7 +315,7 @@ public class ProcessorTestBase extends A
         return null;
     }
 
-    public void assertWsdlEquals(final File expected, final File source, List<String>
attr, List<String> tag) 
+    public void assertWsdlEquals(final File expected, final File source, List<String>
attr, List<String> tag)
         throws Exception {
         Tag expectedTag = ToolsStaxUtils.getTagTree(expected, attr);
         Tag sourceTag = ToolsStaxUtils.getTagTree(source, attr);
@@ -326,7 +327,7 @@ public class ProcessorTestBase extends A
     }
 
     public void assertWsdlEquals(final InputStream expected, final InputStream source,
-                                 List<String> attr, List<String> tag) 
+                                 List<String> attr, List<String> tag)
         throws Exception {
         Tag expectedTag = ToolsStaxUtils.getTagTree(expected, attr);
         Tag sourceTag = ToolsStaxUtils.getTagTree(source, attr);

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/AttributeVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/AttributeVisitor.java?rev=1023418&r1=1023417&r2=1023418&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/AttributeVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/AttributeVisitor.java
Sun Oct 17 02:31:17 2010
@@ -244,9 +244,6 @@ public class AttributeVisitor extends Vi
         result.setName(name);
         result.setSchemaType(complex);
 
-
-        schema.getItems().add(result);
-
         return result;
     }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java?rev=1023418&r1=1023417&r2=1023418&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java
Sun Oct 17 02:31:17 2010
@@ -75,7 +75,7 @@ public class ExceptionVisitor extends Vi
         // xmlschema:exception
         Scope scopedName = new Scope(getScope(), identifierNode);
         String exceptionName = mapper.mapToQName(scopedName);
-        XmlSchemaElement element = new XmlSchemaElement(schema, false);
+        XmlSchemaElement element = new XmlSchemaElement(schema, true);
         element.setName(mapper.mapToQName(scopedName));
 
         String exceptionTypeName = exceptionName + TYPE_SUFFIX;



Mime
View raw message