cvs commit: spice/sandbox/metaclass/src/test/org/realityforge/metaclass/tools/qdox NonNamespaceAttributeRemovingInterceptorTestCase.java
Peter Donald <[email protected]>
| Newsgroups | gmane.comp.java.spice.cvs |
|---|---|
| Message-ID | <[email protected]> |
donaldp 03/10/29 00:27:02
Added: sandbox/metaclass/src/test/org/realityforge/metaclass/tools/qdox
NonNamespaceAttributeRemovingInterceptorTestCase.java
Log:
Add interceptor to strip out non-namespaced attributes and corresponding test case
Revision Changes Path
1.1 spice/sandbox/metaclass/src/test/org/realityforge/metaclass/tools/qdox/NonNamespaceAttributeRemovingInterceptorTestCase.java
Index: NonNamespaceAttributeRemovingInterceptorTestCase.java
===================================================================
/*
* Copyright (C) The Spice Group. All rights reserved.
*
* This software is published under the terms of the Spice
* Software License version 1.1, a copy of which has been included
* with this distribution in the LICENSE.txt file.
*/
package org.realityforge.metaclass.tools.qdox;
import junit.framework.TestCase;
import org.realityforge.metaclass.model.Attribute;
/**
*
* @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2003/10/29 08:27:02 $
*/
public class NonNamespaceAttributeRemovingInterceptorTestCase
extends TestCase
{
public void testProcessAttributeWithNamespacedAttribute()
throws Exception
{
final NonNamespaceAttributeRemovingInterceptor interceptor =
new NonNamespaceAttributeRemovingInterceptor();
final Attribute attribute = new Attribute( "foo.baz" );
final Attribute result = interceptor.processAttribute( attribute );
assertEquals( "attribute", attribute, result );
}
public void testProcessAttributeWithNonNamespacedAttribute()
throws Exception
{
final NonNamespaceAttributeRemovingInterceptor interceptor =
new NonNamespaceAttributeRemovingInterceptor();
final Attribute attribute = new Attribute( "baz" );
final Attribute result = interceptor.processAttribute( attribute );
assertEquals( "attribute", null, result );
}
public void testProcessAttributeWithNamespaceSeparatorAtStart()
throws Exception
{
final NonNamespaceAttributeRemovingInterceptor interceptor =
new NonNamespaceAttributeRemovingInterceptor();
final Attribute attribute = new Attribute( ".baz" );
final Attribute result = interceptor.processAttribute( attribute );
assertEquals( "attribute", null, result );
}
public void testProcessAttributeWithNamespaceSeparatorAtEnd()
throws Exception
{
final NonNamespaceAttributeRemovingInterceptor interceptor =
new NonNamespaceAttributeRemovingInterceptor();
final Attribute attribute = new Attribute( "baz." );
final Attribute result = interceptor.processAttribute( attribute );
assertEquals( "attribute", null, result );
}
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/