You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/03/18 06:07:29 UTC
svn commit: r638218 [4/4] - in /directory/sandbox/akarasulu/bigbang/shared:
./ asn1-codec/ asn1-codec/src/main/resources/META-INF/ asn1-codec/src/site/
asn1/ asn1/src/main/resources/META-INF/ asn1/src/site/ convert/
convert/src/main/java/org/apache/dir...
Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java Mon Mar 17 22:07:20 2008
@@ -32,13 +32,16 @@
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
import org.apache.directory.shared.ldap.name.Rdn;
import org.apache.directory.shared.ldap.name.RdnParser;
import org.apache.directory.shared.ldap.util.StringTools;
+
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
@@ -46,482 +49,548 @@
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class RdnTest extends TestCase
+public class RdnTest
{
- // ~ Methods
- // ------------------------------------------------------------------------------------
- /**
- * Test a null RDN
- */
- public void testRdnNull()
- {
- Assert.assertEquals( "", new Rdn().toString() );
- }
-
-
- /**
- * test an empty RDN
- */
- public void testRdnEmpty() throws InvalidNameException
- {
- Assert.assertEquals( "", new Rdn( "" ).toString() );
- }
-
-
- /**
- * test a simple RDN : a = b
- */
- public void testRdnSimple() throws InvalidNameException
- {
- Assert.assertEquals( "a=b", new Rdn( "a = b" ).toString() );
- }
-
-
- /**
- * test a composite RDN : a = b, d = e
- */
- public void testRdnComposite() throws InvalidNameException
- {
- Assert.assertEquals( "a=b+c=d", new Rdn( "a = b + c = d" ).toString() );
- }
-
-
- /**
- * test a composite RDN with or without spaces: a=b, a =b, a= b, a = b, a =
- * b
- */
- public void testRdnCompositeWithSpace() throws InvalidNameException
- {
- Assert.assertEquals( "a=b", new Rdn( "a=b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a=b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a =b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a= b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a=b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a =b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a= b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a=b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a = b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a =b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a= b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a = b" ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a =b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a= b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( "a = b " ).toString() );
- Assert.assertEquals( "a=b", new Rdn( " a = b " ).toString() );
- }
-
-
- /**
- * test a simple RDN with differents separators : a = b + c = d
- */
- public void testRdnSimpleMultivaluedAttribute() throws InvalidNameException
- {
- String result = new Rdn( "a = b + c = d" ).toString();
- Assert.assertEquals( "a=b+c=d", result );
- }
-
-
- /**
- * test a composite RDN with differents separators : a=b+c=d, e=f + g=h +
- * i=j
- */
- public void testRdnCompositeMultivaluedAttribute() throws InvalidNameException
- {
- Rdn rdn = new Rdn( "a =b+c=d + e=f + g =h + i =j " );
-
- // NameComponent are not ordered
- Assert.assertEquals( "b", rdn.getValue( "a" ) );
- Assert.assertEquals( "d", rdn.getValue( "c" ) );
- Assert.assertEquals( "f", rdn.getValue( " E " ) );
- Assert.assertEquals( "h", rdn.getValue( "g" ) );
- Assert.assertEquals( "j", rdn.getValue( "i" ) );
- }
-
-
- /**
- * test a simple RDN with an oid prefix (uppercase) : OID.12.34.56 = azerty
- */
- public void testRdnOidUpper() throws InvalidNameException
- {
- Assert.assertEquals( "oid.12.34.56=azerty", new Rdn( "OID.12.34.56 = azerty" ).toString() );
- }
-
-
- /**
- * test a simple RDN with an oid prefix (lowercase) : oid.12.34.56 = azerty
- */
- public void testRdnOidLower() throws InvalidNameException
- {
- Assert.assertEquals( "oid.12.34.56=azerty", new Rdn( "oid.12.34.56 = azerty" ).toString() );
- }
-
-
- /**
- * test a simple RDN with an oid attribut wiithout oid prefix : 12.34.56 =
- * azerty
- */
- public void testRdnOidWithoutPrefix() throws InvalidNameException
- {
- Assert.assertEquals( "12.34.56=azerty", new Rdn( "12.34.56 = azerty" ).toString() );
- }
-
-
- /**
- * test a composite RDN with an oid attribut wiithout oid prefix : 12.34.56 =
- * azerty; 7.8 = test
- */
- public void testRdnCompositeOidWithoutPrefix() throws InvalidNameException
- {
- String result = new Rdn( "12.34.56 = azerty + 7.8 = test" ).toString();
- Assert.assertEquals( "12.34.56=azerty+7.8=test", result );
- }
-
-
- /**
- * test a simple RDN with pair char attribute value : a = \,\=\+\<\>\#\;\\\"\C3\A9"
- */
- public void testRdnPairCharAttributeValue() throws InvalidNameException
- {
- String rdn = StringTools.utf8ToString( new byte[]{'a', '=', '\\', ',', '=', '\\', '+', '\\', '<',
- '\\', '>', '#', '\\', ';', '\\', '\\', '\\', '"', '\\', 'C', '3', '\\', 'A', '9' });
- Assert.assertEquals( rdn, new Rdn(
- "a = \\,=\\+\\<\\>#\\;\\\\\\\"\\C3\\A9" ).toString() );
- }
-
-
- /**
- * test a simple RDN with hexString attribute value : a = #0010A0AAFF
- */
- public void testRdnHexStringAttributeValue() throws InvalidNameException
- {
- Assert.assertEquals( "a=#0010A0AAFF", new Rdn( "a = #0010A0AAFF" ).toString() );
- }
-
-
- /**
- * test a simple RDN with quoted attribute value : a = "quoted \"value"
- */
- public void testRdnQuotedAttributeValue() throws InvalidNameException
- {
- Assert.assertEquals( "a=quoted \\\"value", new Rdn( "a = quoted \\\"value" ).toString() );
- }
-
-
- /**
- * Test the clone method for a RDN.
- */
- public void testRDNCloningOneNameComponent() throws InvalidNameException
- {
- Rdn rdn = new Rdn( "a", "a", "b", "b" );
-
- Rdn rdnClone = ( Rdn ) rdn.clone();
-
- RdnParser.parse( "c=d", rdn );
-
- Assert.assertEquals( "b", rdnClone.getValue( "a" ) );
- }
-
-
- /**
- * Test the clone method for a RDN.
- */
- public void testRDNCloningTwoNameComponent() throws InvalidNameException
- {
- Rdn rdn = new Rdn( "a = b + aa = bb" );
-
- Rdn rdnClone = ( Rdn ) rdn.clone();
-
- rdn.clear();
- RdnParser.parse( "c=d", rdn );
-
- Assert.assertEquals( "b", rdnClone.getValue( "a" ) );
- Assert.assertEquals( "bb", rdnClone.getValue( "aa" ) );
- Assert.assertEquals( "", rdnClone.getValue( "c" ) );
- }
-
-
- /**
- * Test the compareTo method for a RDN.
- */
- public void testRDNCompareToNull() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
- Rdn rdn2 = null;
- Assert.assertEquals( 1, rdn1.compareTo( rdn2 ) );
- }
-
-
- /**
- * Compares a composite NC to a single NC.
- */
- public void testRDNCompareToNCS2NC() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
- Rdn rdn2 = new Rdn( " a = b " );
- Assert.assertTrue( rdn1.compareTo( rdn2 ) > 0 );
- }
-
-
- /**
- * Compares a single NC to a composite NC.
- */
- public void testRDNCompareToNC2NCS() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
- Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
-
- Assert.assertTrue( rdn1.compareTo( rdn2 ) < 0 );
- }
-
-
- /**
- * Compares a composite NCS to a composite NCS in the same order.
- */
- public void testRDNCompareToNCS2NCSOrdered() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
- Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
-
- Assert.assertEquals( 0, rdn1.compareTo( rdn2 ) );
- }
-
-
- /**
- * Compares a composite NCS to a composite NCS in a different order.
- */
- public void testRDNCompareToNCS2NCSUnordered() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b + a = f + g = h + c = d " );
- Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
-
- Assert.assertEquals( 0, rdn1.compareTo( rdn2 ) );
- }
-
-
- /**
- * Compares a composite NCS to a different composite NCS.
- */
- public void testRDNCompareToNCS2NCSNotEquals() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = f + g = h + c = d " );
- Rdn rdn2 = new Rdn( " c = d + a = h + g = h " );
-
- Assert.assertEquals( -1, rdn1.compareTo( rdn2 ) );
- }
-
-
- /**
- * Compares with a null RDN.
- */
- public void testRDNCompareToNullRdn() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
-
- Assert.assertEquals( 1, rdn1.compareTo( null ) );
- }
-
- /**
- * Compares with a bad object
- */
- public void testRDNCompareToBadObject() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
-
- Assert.assertEquals( Rdn.UNDEFINED, rdn1.compareTo( "test" ) );
- }
-
- /**
- * Compares a simple NC to a simple NC.
- */
- public void testRDNCompareToNC2NC() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
- Rdn rdn2 = new Rdn( " a = b " );
-
- Assert.assertEquals( 0, rdn1.compareTo( rdn2 ) );
- }
-
-
- /**
- * Compares a simple NC to a simple NC in UperCase.
- */
- public void testRDNCompareToNC2NCUperCase() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
- Rdn rdn2 = new Rdn( " A = b " );
-
- Assert.assertEquals( 0, rdn1.compareTo( rdn2 ) );
- Assert.assertEquals( true, rdn1.equals( rdn2 ) );
- }
-
-
- /**
- * Compares a simple NC to a different simple NC.
- */
- public void testRDNCompareToNC2NCNotEquals() throws InvalidNameException
- {
- Rdn rdn1 = new Rdn( " a = b " );
- Rdn rdn2 = new Rdn( " A = d " );
-
- Assert.assertTrue( rdn1.compareTo( rdn2 ) < 0 );
- }
-
-
- public void testToAttributes() throws InvalidNameException, NamingException
- {
- Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
-
- Attributes attributes = rdn.toAttributes();
-
- Assert.assertNotNull( attributes.get( "a" ) );
- Assert.assertNotNull( attributes.get( "g" ) );
- Assert.assertNotNull( attributes.get( "c" ) );
-
- Attribute attribute = attributes.get( "a" );
-
- Assert.assertNotNull( attribute.get( 0 ) );
- Assert.assertEquals( "b", attribute.get( 0 ) );
-
- Assert.assertNotNull( attribute.get( 1 ) );
- Assert.assertEquals( "f", attribute.get( 1 ) );
-
- attribute = attributes.get( "g" );
- Assert.assertNotNull( attribute.get( 0 ) );
- Assert.assertEquals( "h", attribute.get( 0 ) );
-
- attribute = attributes.get( "c" );
- Assert.assertNotNull( attribute.get( 0 ) );
- Assert.assertEquals( "d", attribute.get( 0 ) );
- }
-
-
- public void testGetValue() throws InvalidNameException
- {
- Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
-
- Assert.assertEquals( "b", rdn.getValue() );
- }
-
-
- public void testGetType() throws InvalidNameException
- {
- Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
-
- Assert.assertEquals( "a", rdn.getNormType() );
- }
-
-
- public void testGetSize() throws InvalidNameException
- {
- Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
-
- Assert.assertEquals( 4, rdn.size() );
- }
-
-
- public void testGetSize0()
- {
- Rdn rdn = new Rdn();
-
- Assert.assertEquals( 0, rdn.size() );
- }
-
-
- public void testEquals() throws InvalidNameException
- {
- Rdn rdn = new Rdn( "a=b + c=d + a=f" );
-
- Assert.assertFalse( rdn.equals( null ) );
- Assert.assertFalse( rdn.equals( "test" ) );
- Assert.assertFalse( rdn.equals( new Rdn( "a=c + c=d + a=f" ) ) );
- Assert.assertFalse( rdn.equals( new Rdn( "a=b" ) ) );
- Assert.assertTrue( rdn.equals( new Rdn( "a=b + c=d + a=f" ) ) );
- Assert.assertTrue( rdn.equals( new Rdn( "a=b + C=d + A=f" ) ) );
- Assert.assertTrue( rdn.equals( new Rdn( "c=d + a=f + a=b" ) ) );
- }
-
-
- public void testUnescapeValueHexa()
- {
- byte[] res = ( byte[] ) Rdn.unescapeValue( "#fF" );
-
- Assert.assertEquals( "0xFF ", StringTools.dumpBytes( res ) );
-
- res = ( byte[] ) Rdn.unescapeValue( "#0123456789aBCDEF" );
- Assert.assertEquals( "0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF ", StringTools.dumpBytes( res ) );
- }
-
-
- public void testUnescapeValueHexaWrong()
- {
- try
- {
- Rdn.unescapeValue( "#fF1" );
- Assert.fail(); // Should not happen
- }
- catch ( IllegalArgumentException iae )
- {
- Assert.assertTrue( true );
- }
- }
-
-
- public void testUnescapeValueString()
- {
- String res = ( String ) Rdn.unescapeValue( "azerty" );
-
- Assert.assertEquals( "azerty", res );
- }
-
-
- public void testUnescapeValueStringSpecial()
- {
- String res = ( String ) Rdn.unescapeValue( "\\\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ " );
-
- Assert.assertEquals( "\\#,+;<>=\" ", res );
- }
-
-
- public void testEscapeValueString()
- {
- String res = Rdn.escapeValue( StringTools.getBytesUtf8( "azerty" ) );
-
- Assert.assertEquals( "azerty", res );
- }
-
-
- public void testEscapeValueStringSpecial()
- {
- String res = Rdn.escapeValue( StringTools.getBytesUtf8( "\\#,+;<>=\" " ) );
-
- Assert.assertEquals( "\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ ", res );
- }
-
-
- public void testEscapeValueNumeric()
- {
- String res = Rdn.escapeValue( new byte[]
- { '-', 0x00, '-', 0x1F, '-', 0x7F, '-' } );
-
- Assert.assertEquals( "-\\00-\\1F-\\7F-", res );
- }
-
-
- public void testEscapeValueMix()
- {
- String res = Rdn.escapeValue( new byte[]
- { '\\', 0x00, '-', '+', '#', 0x7F, '-' } );
+ // ~ Methods
+ // ------------------------------------------------------------------------------------
+ /**
+ * Test a null RDN
+ */
+ @Test
+ public void testRdnNull()
+ {
+ assertEquals( "", new Rdn().toString() );
+ }
+
+
+ /**
+ * test an empty RDN
+ */
+ @Test
+ public void testRdnEmpty() throws InvalidNameException
+ {
+ assertEquals( "", new Rdn( "" ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN : a = b
+ */
+ @Test
+ public void testRdnSimple() throws InvalidNameException
+ {
+ assertEquals( "a=b", new Rdn( "a = b" ).toString() );
+ }
+
+
+ /**
+ * test a composite RDN : a = b, d = e
+ */
+ @Test
+ public void testRdnComposite() throws InvalidNameException
+ {
+ assertEquals( "a=b+c=d", new Rdn( "a = b + c = d" ).toString() );
+ }
+
+
+ /**
+ * test a composite RDN with or without spaces: a=b, a =b, a= b, a = b, a =
+ * b
+ */
+ @Test
+ public void testRdnCompositeWithSpace() throws InvalidNameException
+ {
+ assertEquals( "a=b", new Rdn( "a=b" ).toString() );
+ assertEquals( "a=b", new Rdn( " a=b" ).toString() );
+ assertEquals( "a=b", new Rdn( "a =b" ).toString() );
+ assertEquals( "a=b", new Rdn( "a= b" ).toString() );
+ assertEquals( "a=b", new Rdn( "a=b " ).toString() );
+ assertEquals( "a=b", new Rdn( " a =b" ).toString() );
+ assertEquals( "a=b", new Rdn( " a= b" ).toString() );
+ assertEquals( "a=b", new Rdn( " a=b " ).toString() );
+ assertEquals( "a=b", new Rdn( "a = b" ).toString() );
+ assertEquals( "a=b", new Rdn( "a =b " ).toString() );
+ assertEquals( "a=b", new Rdn( "a= b " ).toString() );
+ assertEquals( "a=b", new Rdn( " a = b" ).toString() );
+ assertEquals( "a=b", new Rdn( " a =b " ).toString() );
+ assertEquals( "a=b", new Rdn( " a= b " ).toString() );
+ assertEquals( "a=b", new Rdn( "a = b " ).toString() );
+ assertEquals( "a=b", new Rdn( " a = b " ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN with differents separators : a = b + c = d
+ */
+ @Test
+ public void testRdnSimpleMultivaluedAttribute() throws InvalidNameException
+ {
+ String result = new Rdn( "a = b + c = d" ).toString();
+ assertEquals( "a=b+c=d", result );
+ }
+
+
+ /**
+ * test a composite RDN with differents separators : a=b+c=d, e=f + g=h +
+ * i=j
+ */
+ @Test
+ public void testRdnCompositeMultivaluedAttribute() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( "a =b+c=d + e=f + g =h + i =j " );
+
+ // NameComponent are not ordered
+ assertEquals( "b", rdn.getValue( "a" ) );
+ assertEquals( "d", rdn.getValue( "c" ) );
+ assertEquals( "f", rdn.getValue( " E " ) );
+ assertEquals( "h", rdn.getValue( "g" ) );
+ assertEquals( "j", rdn.getValue( "i" ) );
+ }
+
+
+ /**
+ * test a simple RDN with an oid prefix (uppercase) : OID.12.34.56 = azerty
+ */
+ @Test
+ public void testRdnOidUpper() throws InvalidNameException
+ {
+ assertEquals( "oid.12.34.56=azerty", new Rdn( "OID.12.34.56 = azerty" ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN with an oid prefix (lowercase) : oid.12.34.56 = azerty
+ */
+ @Test
+ public void testRdnOidLower() throws InvalidNameException
+ {
+ assertEquals( "oid.12.34.56=azerty", new Rdn( "oid.12.34.56 = azerty" ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN with an oid attribut wiithout oid prefix : 12.34.56 =
+ * azerty
+ */
+ @Test
+ public void testRdnOidWithoutPrefix() throws InvalidNameException
+ {
+ assertEquals( "12.34.56=azerty", new Rdn( "12.34.56 = azerty" ).toString() );
+ }
+
+
+ /**
+ * test a composite RDN with an oid attribut wiithout oid prefix : 12.34.56 =
+ * azerty; 7.8 = test
+ */
+ @Test
+ public void testRdnCompositeOidWithoutPrefix() throws InvalidNameException
+ {
+ String result = new Rdn( "12.34.56 = azerty + 7.8 = test" ).toString();
+ assertEquals( "12.34.56=azerty+7.8=test", result );
+ }
+
+
+ /**
+ * test a simple RDN with pair char attribute value : a = \,\=\+\<\>\#\;\\\"\C3\A9"
+ */
+ @Test
+ public void testRdnPairCharAttributeValue() throws InvalidNameException
+ {
+ String rdn = StringTools.utf8ToString( new byte[]
+ { 'a', '=', '\\', ',', '=', '\\', '+', '\\', '<', '\\', '>', '#', '\\', ';', '\\', '\\', '\\', '"', '\\',
+ 'C', '3', '\\', 'A', '9' } );
+ assertEquals( rdn, new Rdn( "a = \\,=\\+\\<\\>#\\;\\\\\\\"\\C3\\A9" ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN with hexString attribute value : a = #0010A0AAFF
+ */
+ @Test
+ public void testRdnHexStringAttributeValue() throws InvalidNameException
+ {
+ assertEquals( "a=#0010A0AAFF", new Rdn( "a = #0010A0AAFF" ).toString() );
+ }
+
+
+ /**
+ * test a simple RDN with quoted attribute value : a = "quoted \"value"
+ */
+ @Test
+ public void testRdnQuotedAttributeValue() throws InvalidNameException
+ {
+ assertEquals( "a=quoted \\\"value", new Rdn( "a = quoted \\\"value" ).toString() );
+ }
+
+
+ /**
+ * Test the clone method for a RDN.
+ */
+ @Test
+ public void testParseRDNNull() throws InvalidNameException
+ {
+ Rdn rdn = null;
+
+ try
+ {
+ RdnParser.parse( "c=d", rdn );
+ fail();
+ }
+ catch ( InvalidNameException ine )
+ {
+ assertTrue( true );
+ }
+ }
+
+
+ /**
+ * Test the clone method for a RDN.
+ */
+ @Test
+ public void testRDNCloningOneNameComponent() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( "a", "a", "b", "b" );
+
+ Rdn rdnClone = ( Rdn ) rdn.clone();
+
+ RdnParser.parse( "c=d", rdn );
+
+ assertEquals( "b", rdnClone.getValue( "a" ) );
+ }
+
+
+ /**
+ * Test the clone method for a RDN.
+ */
+ @Test
+ public void testRDNCloningTwoNameComponent() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( "a = b + aa = bb" );
+
+ Rdn rdnClone = ( Rdn ) rdn.clone();
+
+ rdn.clear();
+ RdnParser.parse( "c=d", rdn );
+
+ assertEquals( "b", rdnClone.getValue( "a" ) );
+ assertEquals( "bb", rdnClone.getValue( "aa" ) );
+ assertEquals( "", rdnClone.getValue( "c" ) );
+ }
+
+
+ /**
+ * Test the compareTo method for a RDN.
+ */
+ @Test
+ public void testRDNCompareToNull() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
+ Rdn rdn2 = null;
+ assertEquals( 1, rdn1.compareTo( rdn2 ) );
+ }
+
+
+ /**
+ * Compares a composite NC to a single NC.
+ */
+ @Test
+ public void testRDNCompareToNCS2NC() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
+ Rdn rdn2 = new Rdn( " a = b " );
+ assertTrue( rdn1.compareTo( rdn2 ) > 0 );
+ }
+
+
+ /**
+ * Compares a single NC to a composite NC.
+ */
+ @Test
+ public void testRDNCompareToNC2NCS() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+ Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
+
+ assertTrue( rdn1.compareTo( rdn2 ) < 0 );
+ }
+
+
+ /**
+ * Compares a composite NCS to a composite NCS in the same order.
+ */
+ @Test
+ public void testRDNCompareToNCS2NCSOrdered() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b + c = d + a = f + g = h " );
+ Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
+
+ assertEquals( 0, rdn1.compareTo( rdn2 ) );
+ }
+
+
+ /**
+ * Compares a composite NCS to a composite NCS in a different order.
+ */
+ @Test
+ public void testRDNCompareToNCS2NCSUnordered() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b + a = f + g = h + c = d " );
+ Rdn rdn2 = new Rdn( " a = b + c = d + a = f + g = h " );
+
+ assertEquals( 0, rdn1.compareTo( rdn2 ) );
+ }
+
+
+ /**
+ * Compares a composite NCS to a different composite NCS.
+ */
+ @Test
+ public void testRDNCompareToNCS2NCSNotEquals() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = f + g = h + c = d " );
+ Rdn rdn2 = new Rdn( " c = d + a = h + g = h " );
+
+ assertEquals( -1, rdn1.compareTo( rdn2 ) );
+ }
+
+
+ /**
+ * Compares with a null RDN.
+ */
+ @Test
+ public void testRDNCompareToNullRdn() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+
+ assertEquals( 1, rdn1.compareTo( null ) );
+ }
+
+
+ /**
+ * Compares with a bad object
+ */
+ @Test
+ public void testRDNCompareToBadObject() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+
+ assertEquals( Rdn.UNDEFINED, rdn1.compareTo( "test" ) );
+ }
- Assert.assertEquals( "\\\\\\00-\\+#\\7F-", res );
- }
- public void testDIRSERVER_703() throws InvalidNameException
+ /**
+ * Compares a simple NC to a simple NC.
+ */
+ @Test
+ public void testRDNCompareToNC2NC() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+ Rdn rdn2 = new Rdn( " a = b " );
+
+ assertEquals( 0, rdn1.compareTo( rdn2 ) );
+ }
+
+
+ /**
+ * Compares a simple NC to a simple NC in UperCase.
+ */
+ @Test
+ public void testRDNCompareToNC2NCUperCase() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+ Rdn rdn2 = new Rdn( " A = b " );
+
+ assertEquals( 0, rdn1.compareTo( rdn2 ) );
+ assertEquals( true, rdn1.equals( rdn2 ) );
+ }
+
+
+ /**
+ * Compares a simple NC to a different simple NC.
+ */
+ @Test
+ public void testRDNCompareToNC2NCNotEquals() throws InvalidNameException
+ {
+ Rdn rdn1 = new Rdn( " a = b " );
+ Rdn rdn2 = new Rdn( " A = d " );
+
+ assertTrue( rdn1.compareTo( rdn2 ) < 0 );
+ }
+
+
+ @Test
+ public void testToAttributes() throws InvalidNameException, NamingException
+ {
+ Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
+
+ Attributes attributes = rdn.toAttributes();
+
+ assertNotNull( attributes.get( "a" ) );
+ assertNotNull( attributes.get( "g" ) );
+ assertNotNull( attributes.get( "c" ) );
+
+ Attribute attribute = attributes.get( "a" );
+
+ assertNotNull( attribute.get( 0 ) );
+ assertEquals( "b", attribute.get( 0 ) );
+
+ assertNotNull( attribute.get( 1 ) );
+ assertEquals( "f", attribute.get( 1 ) );
+
+ attribute = attributes.get( "g" );
+ assertNotNull( attribute.get( 0 ) );
+ assertEquals( "h", attribute.get( 0 ) );
+
+ attribute = attributes.get( "c" );
+ assertNotNull( attribute.get( 0 ) );
+ assertEquals( "d", attribute.get( 0 ) );
+ }
+
+
+ @Test
+ public void testGetValue() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
+
+ assertEquals( "b", rdn.getValue() );
+ }
+
+
+ @Test
+ public void testGetType() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
+
+ assertEquals( "a", rdn.getNormType() );
+ }
+
+
+ @Test
+ public void testGetSize() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( " a = b + a = f + g = h + c = d " );
+
+ assertEquals( 4, rdn.size() );
+ }
+
+
+ @Test
+ public void testGetSize0()
+ {
+ Rdn rdn = new Rdn();
+
+ assertEquals( 0, rdn.size() );
+ }
+
+
+ @Test
+ public void testEquals() throws InvalidNameException
+ {
+ Rdn rdn = new Rdn( "a=b + c=d + a=f" );
+
+ assertFalse( rdn.equals( null ) );
+ assertFalse( rdn.equals( "test" ) );
+ assertFalse( rdn.equals( new Rdn( "a=c + c=d + a=f" ) ) );
+ assertFalse( rdn.equals( new Rdn( "a=b" ) ) );
+ assertTrue( rdn.equals( new Rdn( "a=b + c=d + a=f" ) ) );
+ assertTrue( rdn.equals( new Rdn( "a=b + C=d + A=f" ) ) );
+ assertTrue( rdn.equals( new Rdn( "c=d + a=f + a=b" ) ) );
+ }
+
+
+ @Test
+ public void testUnescapeValueHexa()
+ {
+ byte[] res = ( byte[] ) Rdn.unescapeValue( "#fF" );
+
+ assertEquals( "0xFF ", StringTools.dumpBytes( res ) );
+
+ res = ( byte[] ) Rdn.unescapeValue( "#0123456789aBCDEF" );
+ assertEquals( "0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF ", StringTools.dumpBytes( res ) );
+ }
+
+
+ @Test
+ public void testUnescapeValueHexaWrong()
+ {
+ try
+ {
+ Rdn.unescapeValue( "#fF1" );
+ fail(); // Should not happen
+ }
+ catch ( IllegalArgumentException iae )
+ {
+ assertTrue( true );
+ }
+ }
+
+
+ @Test
+ public void testUnescapeValueString()
+ {
+ String res = ( String ) Rdn.unescapeValue( "azerty" );
+
+ assertEquals( "azerty", res );
+ }
+
+
+ @Test
+ public void testUnescapeValueStringSpecial()
+ {
+ String res = ( String ) Rdn.unescapeValue( "\\\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ " );
+
+ assertEquals( "\\#,+;<>=\" ", res );
+ }
+
+
+ @Test
+ public void testEscapeValueString()
+ {
+ String res = Rdn.escapeValue( StringTools.getBytesUtf8( "azerty" ) );
+
+ assertEquals( "azerty", res );
+ }
+
+
+ @Test
+ public void testEscapeValueStringSpecial()
+ {
+ String res = Rdn.escapeValue( StringTools.getBytesUtf8( "\\#,+;<>=\" " ) );
+
+ assertEquals( "\\\\#\\,\\+\\;\\<\\>\\=\\\"\\ ", res );
+ }
+
+
+ @Test
+ public void testEscapeValueNumeric()
+ {
+ String res = Rdn.escapeValue( new byte[]
+ { '-', 0x00, '-', 0x1F, '-', 0x7F, '-' } );
+
+ assertEquals( "-\\00-\\1F-\\7F-", res );
+ }
+
+
+ @Test
+ public void testEscapeValueMix()
+ {
+ String res = Rdn.escapeValue( new byte[]
+ { '\\', 0x00, '-', '+', '#', 0x7F, '-' } );
+
+ assertEquals( "\\\\\\00-\\+#\\7F-", res );
+ }
+
+
+ @Test
+ public void testDIRSERVER_703() throws InvalidNameException
{
Rdn rdn = new Rdn( "cn=Kate Bush+sn=Bush" );
assertEquals( "cn=Kate Bush+sn=Bush", rdn.getUpName() );
}
+ @Test
public void testMultiValuedIterator() throws InvalidNameException
{
Rdn rdn = new Rdn( "cn=Kate Bush+sn=Bush" );
@@ -535,6 +604,7 @@
}
+ @Test
public void testSingleValuedIterator() throws InvalidNameException
{
Rdn rdn = new Rdn( "cn=Kate Bush" );
@@ -546,6 +616,7 @@
}
+ @Test
public void testEmptyIterator() throws InvalidNameException
{
Rdn rdn = new Rdn();
@@ -555,12 +626,15 @@
}
+ @Test
public void testRdnWithSpaces() throws InvalidNameException
{
Rdn rdn = new Rdn( "cn=a\\ b\\ c" );
assertEquals( "cn=a b c", rdn.toString() );
}
+
+ @Test
public void testEscapedSpaceInValue() throws InvalidNameException
{
Rdn rdn1 = new Rdn( "cn=a b c" );
@@ -577,6 +651,7 @@
}
+ @Test
public void testEscapedHashInValue() throws InvalidNameException
{
Rdn rdn1 = new Rdn( "cn=a#b#c" );
@@ -593,6 +668,7 @@
}
+ @Test
public void testEscapedAttributeValue() throws InvalidNameException
{
// space doesn't need to be escaped in the middle of a string
@@ -605,7 +681,7 @@
assertEquals( "a b\\ ", Rdn.escapeValue( "a b " ) );
assertEquals( "\\ a b\\ ", Rdn.escapeValue( " a b " ) );
assertEquals( "\\ a b \\ ", Rdn.escapeValue( " a b " ) );
-
+
// hash doesn't need to be escaped in the middle and the end of a string
assertEquals( "a#b", Rdn.escapeValue( "a#b" ) );
assertEquals( "a#b#", Rdn.escapeValue( "a#b#" ) );
@@ -613,7 +689,7 @@
assertEquals( "a#b#c#", Rdn.escapeValue( "a#b#c#" ) );
assertEquals( "a#b#c#d", Rdn.escapeValue( "a#b#c#d" ) );
assertEquals( "a#b#c#d#", Rdn.escapeValue( "a#b#c#d#" ) );
-
+
// hash must be escaped at the beginning of a string
assertEquals( "\\#a#b", Rdn.escapeValue( "#a#b" ) );
assertEquals( "\\##a#b", Rdn.escapeValue( "##a#b" ) );
@@ -724,7 +800,7 @@
assertEquals( rdn, rdn2 );
}
-
+
/**
* Test serialization of a simple Rdn with no value
*/
@@ -750,7 +826,7 @@
assertEquals( rdn, rdn2 );
}
-
+
/**
* Test serialization of a simple Rdn with one value
*/
@@ -776,7 +852,7 @@
assertEquals( rdn, rdn2 );
}
-
+
/**
* Test serialization of a simple Rdn with three values
*/
@@ -802,12 +878,13 @@
assertEquals( rdn, rdn2 );
}
-
+
/**
* Test serialization of a simple Rdn with three unordered values
*/
@Test
- public void testSimpleRdnThreeValuesUnorderedSerialization() throws NamingException, IOException, ClassNotFoundException
+ public void testSimpleRdnThreeValuesUnorderedSerialization() throws NamingException, IOException,
+ ClassNotFoundException
{
Rdn rdn = new Rdn( " B = b + A = a + C = c " );
rdn.normalize();
@@ -827,4 +904,221 @@
assertEquals( rdn, rdn2 );
}
+
+
+ /** Static Serialization tests ------------------------------------------------- */
+
+ /**
+ * Test serialization of an empty RDN
+ */
+ @Test
+ public void testEmptyRDNStaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( "" );
+
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ @Test
+ public void testNullRdnStaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn();
+
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn
+ */
+ @Test
+ public void testSimpleRdnStaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( "a=b" );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn
+ */
+ @Test
+ public void testSimpleRdn2StaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( " ABC = DEF " );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn with no value
+ */
+ @Test
+ public void testSimpleRdnNoValueStaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( " ABC =" );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn with one value
+ */
+ @Test
+ public void testSimpleRdnOneValueStaticSerialization() throws NamingException, IOException, ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( " ABC = def " );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn with three values
+ */
+ @Test
+ public void testSimpleRdnThreeValuesStaticSerialization() throws NamingException, IOException,
+ ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( " A = a + B = b + C = c " );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * Test serialization of a simple Rdn with three unordered values
+ */
+ @Test
+ public void testSimpleRdnThreeValuesUnorderedStaticSerialization() throws NamingException, IOException,
+ ClassNotFoundException
+ {
+ Rdn rdn = new Rdn( " B = b + A = a + C = c " );
+ rdn.normalize();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream( baos );
+
+ RdnSerializer.serialize( rdn, out );
+
+ ObjectInputStream in = null;
+
+ byte[] data = baos.toByteArray();
+ in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+
+ Rdn rdn2 = RdnSerializer.deserialize( in );
+
+ assertEquals( rdn, rdn2 );
+ }
+
+
+ /**
+ * test an RDN with empty value
+ */
+ @Test
+ public void testRdnWithEmptyValue() throws InvalidNameException
+ {
+ assertTrue( RdnParser.isValid( "a=" ) );
+ assertTrue( RdnParser.isValid( "a=\"\"" ) );
+ assertEquals( "a=", new Rdn( "a=\"\"" ).toString() );
+ assertEquals( "a=", new Rdn( "a=" ).toString() );
+ }
+
}
Modified: directory/sandbox/akarasulu/bigbang/shared/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/pom.xml Mon Mar 17 22:07:20 2008
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<!-- $Rev: $ $Date: $ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -21,14 +21,19 @@
<parent>
<groupId>org.apache.directory.project</groupId>
<artifactId>project</artifactId>
- <version>9-SNAPSHOT</version>
+ <version>10-SNAPSHOT</version>
</parent>
<groupId>org.apache.directory.shared</groupId>
<artifactId>shared-parent</artifactId>
<name>Apache Directory Shared</name>
- <packaging>pom</packaging>
- <version>0.9.8-SNAPSHOT</version>
-
+ <packaging>pom</packaging>
+ <version>0.9.9-SNAPSHOT</version>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://issues.apache.org/jira/browse/DIRSHARED</url>
+ </issueManagement>
+
<modules>
<module>asn1</module>
<module>ldap</module>
@@ -69,8 +74,8 @@
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
-
- <dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
@@ -79,7 +84,7 @@
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
- <version>1.1.2</version>
+ <version>1.1.6</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -127,25 +132,84 @@
</plugins>
</build>
+ <distributionManagement>
+ <site>
+ <id>apache.directory.shared</id>
+ <url>scpexe://people.apache.org/home/felixk/public_html/projects/directory/shared/</url>
+ </site>
+ </distributionManagement>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
- <report>project-team</report>
- <report>mailing-list</report>
- <report>issue-tracking</report>
<report>license</report>
- <report>scm</report>
+ <report>dependencies</report>
+ <report>issue-tracking</report>
+ <report>index</report>
</reports>
</reportSet>
</reportSets>
</plugin>
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changelog-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <id>dual-report</id>
+ <configuration>
+ <type>range</type>
+ <range>30</range>
+ </configuration>
+ <reports>
+ <report>changelog</report>
+ <report>file-activity</report>
+ <report>dev-activity</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <configuration>
+ <tags>
+ <tag>TODO</tag>
+ <tag>@todo</tag>
+ <tag>@deprecated</tag>
+ <tag>FIXME</tag>
+ </tags>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -153,6 +217,36 @@
<aggregate>true</aggregate>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <configuration>
+ <xmlOutput>false</xmlOutput>
+ <!--
+ <xmlOutput>true|false</xmlOutput>
+ <xmlOutputDirectory>directory location of xml findbugs report</xmlOutputDirectory>
+ <threshold>High|Normal|Low|Exp|Ignore</threshold>
+ <effort>Min|Default|Max</effort>
+ <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
+ <includeFilterFile>findbugs-include.xml</includeFilterFile>
+ <visitors>FindDeadLocalStores,UnreadFields</visitors>
+ <omitVisitors>FindDeadLocalStores,UnreadFields</omitVisitors>
+ <onlyAnalyze>org.codehaus.mojo.findbugs.*</onlyAnalyze>
+ <pluginList>/libs/fb-contrib/fb-contrib-2.8.0.jar</pluginList>
+ <debug>true|false</debug>
+ <relaxed>true|false</relaxed>
+ -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
</plugins>
</reporting>
@@ -198,11 +292,9 @@
</build>
</profile>
</profiles>
-
+
<scm>
- <connection>
- scm:svn:http://svn.apache.org/repos/asf/directory/shared/branches/bigbang
- </connection>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/directory/shared/branches/bigbang</connection>
</scm>
</project>