cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: svn commit: r578093 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/util/ common/src/test/java/org/apache/cxf/tools/util/ common/src/test/java/org/apache/cxf/tools/util/resour...
Date Fri, 21 Sep 2007 14:05:36 GMT
Am Freitag, den 21.09.2007, 13:06 +0000 schrieb mmao@apache.org:
> Author: mmao
> Date: Fri Sep 21 06:06:53 2007
> New Revision: 578093
> 

> Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?rev=578093&r1=578092&r2=578093&view=diff
> ==============================================================================
> --- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(original)
> +++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Fri Sep 21 06:06:53 2007

> +                boolean found = false;
> +                for (QName attr2 : sourceTag.getAttributes()) {
> +                    if
> (attr2.getNamespaceURI().equals(attr.getNamespaceURI())) {
> +                        if
> (attr2.getLocalPart().equals(attr.getLocalPart())) {
> +                            found = true;
> +                        } else {
> +                            throw new ComparisonFailure("Attribute
> not equal: ", 

Attributes not equal:

> +                                                        attr.toString(), 
> +                                                        attr2.toString());
> +                        }
> +                    }
> +                }
> +                if (!found) {
> +                    throw new AssertionError("Attribute: " + attr + " is missing is
the source file.");

...is missing in...

> +                }
> +            }
> +
> +            if (!StringUtils.isEmpty(expectedTag.getText())
> +                && !expectedTag.getText().equals(sourceTag.getText())) {
> +                throw new ComparisonFailure("Text not equal ", 

Text not equal:
(colon added for consistency with similar messages below)

> +                                            expectedTag.getText().toString(), 
> +                                            sourceTag.getText().toString());
> +            }
> +        }
> +        return true;
> +    }
> +
> +    protected void assertTagEquals(Tag expected, Tag source) {
> +        assertTagEquals(expected, source, DEFAULT_IGNORE_ATTR, DEFAULT_IGNORE_TAG);
> +    }
> +
> +    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(), 
> +                                        source.getName().toString());
> +        }
> +
> +        for (QName attr : expected.getAttributes()) {
> +            if (ignoreAttr.contains(attr.getNamespaceURI())) {
> +                continue;
> +            }
> +            boolean found = false;
> +            for (QName attr2 : source.getAttributes()) {
> +                if (attr2.getNamespaceURI().equals(attr.getNamespaceURI())) {
> +                    if (attr2.getLocalPart().equals(attr.getLocalPart())) {
> +                        found = true;
> +                    } else {
> +                        throw new ComparisonFailure("Attribute not equal: ", 

Attributes not equal:

> +                                                    attr.toString(), 
> +                                                    attr2.toString());
> +                    }
> +                }
> +            }
> +            if (!found) {
> +                throw new AssertionError("Attribute: " + attr + " is missing is the
source file.");

"...in the source file."

> +            }
> +        }
> +        if (!StringUtils.isEmpty(expected.getText())
> +                && !expected.getText().equals(source.getText())) {
> +            throw new ComparisonFailure("Text not equal ",

<raise exceptionName="eyebrow"/>

I think readability suffers when formatting is placed in the message
string (I think the trailing space above, after "equal", is to make the
subsequent error message simpler to program, no?)  The trailing space
looks like a bug to the reader of the source file raising the error, and
it looks like the spaces were not properly inserted in to the reader of
the source file processing the exception.  Perhaps in the future we can
create or find a utility function that would eliminate the need to add
trailing spaces to exception messages and at the same time make printing
of the subsequent error message not so cumbersome.


>  }
> 
> Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Tag.java
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Tag.java?rev=578093&view=auto
> ==============================================================================
> --- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Tag.java
(added)
> +++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Tag.java
Fri Sep 21 06:06:53 2007
> @@ -0,0 +1,165 @@
> +    
> +    private String getIndent(int size) {

createIndent(int size)?  (This method does not appear to be a POJO accessor)

> +        String indent = "    ";
> +        StringBuffer sb = new StringBuffer();
> +        for (int i = 0; i < size; i++) {
> +            sb.append(indent);
> +        }
> +        return sb.toString();
> +    }
> +

> Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java?rev=578093&r1=578092&r2=578093&view=diff
> ==============================================================================
> --- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
(original)
> +++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
Fri Sep 21 06:06:53 2007
> @@ -91,6 +91,7 @@
>      }
>      
>      @Test 
> +    @org.junit.Ignore("The test seems failed on Vista")

(The/This) test seems to have failed on Vista

>      public void testAegisReconfigureDatabinding() throws Exception {
>          final String sei = "org.apache.cxf.tools.fortest.aegis2ws.TestAegisSEI";
>          String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/aegis.wsdl",

> 

Regards,
Glen



Mime
View raw message