directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235374 [27/27] - in /directory/shared/trunk: ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/ ldap/model/src/main/java/org/apache/directory/shared/ldap/model/csn/ ldap/model/src/main/java/org/apache/directory/sha...
Date Tue, 24 Jan 2012 17:44:32 GMT
Modified: directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/OsgiUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/OsgiUtilsTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/OsgiUtilsTest.java
(original)
+++ directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/OsgiUtilsTest.java
Tue Jan 24 17:44:03 2012
@@ -49,7 +49,7 @@ public class OsgiUtilsTest
     {
         public boolean accept( File pathname )
         {
-            return pathname.getAbsolutePath().contains( "junit" ) || 
+            return pathname.getAbsolutePath().contains( "junit" ) ||
                 pathname.getAbsolutePath().contains( "slf4j" );
         }
     };
@@ -57,26 +57,27 @@ public class OsgiUtilsTest
     private static final FileFilter ONLY_ONE_FILTER = new FileFilter()
     {
         boolean isDone = false;
-        
+
+
         public boolean accept( File pathname )
         {
             if ( isDone )
             {
                 return false;
             }
-            
+
             isDone = true;
             return true;
         }
     };
 
-    
+
     @Test
     public void testSplitIntoPackageVersions()
     {
-        Set<String> pkgs = OsgiUtils.splitIntoPackages( 
+        Set<String> pkgs = OsgiUtils.splitIntoPackages(
             "org.ops4j.store.intern;uses:=\"org.ops4j.store,org.ops4j.io,org.apache.commons.logging\";"
+
-            "version=\"1.2.2\",org.ops4j.store;uses:=\"org.ops4j.store.intern\";version=\"1.2.2",

+                "version=\"1.2.2\",org.ops4j.store;uses:=\"org.ops4j.store.intern\";version=\"1.2.2",
             null );
 
         assertTrue( "org.ops4j.store.intern", pkgs.contains( "org.ops4j.store.intern" ) );
@@ -84,36 +85,36 @@ public class OsgiUtilsTest
 
         assertEquals( "Expecting 2 packages", 2, pkgs.size() );
     }
-    
-    
+
+
     @Test
     public void testSplitIntoPackages()
     {
-        Set<String> pkgs = OsgiUtils.splitIntoPackages( 
+        Set<String> pkgs = OsgiUtils.splitIntoPackages(
             "org.apache.log4j.net;uses:=\"org.apache.log4j,org.apache.log4j.spi," +
-            "javax.naming,org.apache.log4j.helpers,javax.jms,org.apache.log4j.xml," +
-            "javax.mail,javax.mail.internet,org.w3c.dom,javax.jmdns\"," +
-            "org.apache.log4j.jmx;uses:=\"org.apache.log4j,javax.management," +
-            "com.sun.jdmk.comm,org.apache.log4j.helpers,org.apache.log4j.spi\"," +
-            "org.apache.log4j.jdbc;uses:=\"org.apache.log4j,org.apache.log4j.spi\"," +
-            "org.apache.log4j.config;uses:=\"org.apache.log4j.helpers,org.apache.log4j,"
+
-            "org.apache.log4j.spi\",org.apache.log4j.helpers;uses:=\"org.apache.log4j," +
-            "org.apache.log4j.spi,org.apache.log4j.pattern\",org.apache.log4j;uses:=\"" +
-            "org.apache.log4j.spi,org.apache.log4j.helpers,org.apache.log4j.pattern," +
-            "org.apache.log4j.or,org.apache.log4j.config\",org.apache.log4j.or.jms;" +
-            "uses:=\"org.apache.log4j.helpers,javax.jms,org.apache.log4j.or\"," +
-            "org.apache.log4j.nt;uses:=\"org.apache.log4j.helpers,org.apache.log4j," +
-            "org.apache.log4j.spi\",org.apache.log4j.or.sax;uses:=\"org.apache.log4j.or,"
+
-            "org.xml.sax\",org.apache.log4j.pattern;uses:=\"org.apache.log4j.helpers," +
-            "org.apache.log4j.spi,org.apache.log4j,org.apache.log4j.or\"," +
-            "org.apache.log4j.spi;uses:=\"org.apache.log4j,org.apache.log4j.helpers," +
-            "com.ibm.uvm.tools,org.apache.log4j.or\",org.apache.log4j.or;uses:=\"" +
-            "org.apache.log4j.helpers,org.apache.log4j.spi,org.apache.log4j\"," +
-            "org.apache.log4j.xml;uses:=\"javax.xml.parsers,org.w3c.dom,org.xml.sax," +
-            "org.apache.log4j.config,org.apache.log4j.helpers,org.apache.log4j," +
-            "org.apache.log4j.spi,org.apache.log4j.or\",org.apache.log4j.varia;uses:=\""
+
-            "org.apache.log4j.spi,org.apache.log4j,org.apache.log4j.helpers\"", null );
-        
+                "javax.naming,org.apache.log4j.helpers,javax.jms,org.apache.log4j.xml," +
+                "javax.mail,javax.mail.internet,org.w3c.dom,javax.jmdns\"," +
+                "org.apache.log4j.jmx;uses:=\"org.apache.log4j,javax.management," +
+                "com.sun.jdmk.comm,org.apache.log4j.helpers,org.apache.log4j.spi\"," +
+                "org.apache.log4j.jdbc;uses:=\"org.apache.log4j,org.apache.log4j.spi\","
+
+                "org.apache.log4j.config;uses:=\"org.apache.log4j.helpers,org.apache.log4j,"
+
+                "org.apache.log4j.spi\",org.apache.log4j.helpers;uses:=\"org.apache.log4j,"
+
+                "org.apache.log4j.spi,org.apache.log4j.pattern\",org.apache.log4j;uses:=\""
+
+                "org.apache.log4j.spi,org.apache.log4j.helpers,org.apache.log4j.pattern,"
+
+                "org.apache.log4j.or,org.apache.log4j.config\",org.apache.log4j.or.jms;"
+
+                "uses:=\"org.apache.log4j.helpers,javax.jms,org.apache.log4j.or\"," +
+                "org.apache.log4j.nt;uses:=\"org.apache.log4j.helpers,org.apache.log4j,"
+
+                "org.apache.log4j.spi\",org.apache.log4j.or.sax;uses:=\"org.apache.log4j.or,"
+
+                "org.xml.sax\",org.apache.log4j.pattern;uses:=\"org.apache.log4j.helpers,"
+
+                "org.apache.log4j.spi,org.apache.log4j,org.apache.log4j.or\"," +
+                "org.apache.log4j.spi;uses:=\"org.apache.log4j,org.apache.log4j.helpers,"
+
+                "com.ibm.uvm.tools,org.apache.log4j.or\",org.apache.log4j.or;uses:=\"" +
+                "org.apache.log4j.helpers,org.apache.log4j.spi,org.apache.log4j\"," +
+                "org.apache.log4j.xml;uses:=\"javax.xml.parsers,org.w3c.dom,org.xml.sax,"
+
+                "org.apache.log4j.config,org.apache.log4j.helpers,org.apache.log4j," +
+                "org.apache.log4j.spi,org.apache.log4j.or\",org.apache.log4j.varia;uses:=\""
+
+                "org.apache.log4j.spi,org.apache.log4j,org.apache.log4j.helpers\"", null
);
+
         assertTrue( "org.apache.log4j.net", pkgs.contains( "org.apache.log4j.net" ) );
         assertTrue( "org.apache.log4j.jmx", pkgs.contains( "org.apache.log4j.jmx" ) );
         assertTrue( "org.apache.log4j.jdbc", pkgs.contains( "org.apache.log4j.jdbc" ) );
@@ -131,7 +132,7 @@ public class OsgiUtilsTest
 
         assertEquals( "Expecting 14 packages", 14, pkgs.size() );
     }
-    
+
 
     @Test
     public void testGetClasspathCandidates()
@@ -144,12 +145,12 @@ public class OsgiUtilsTest
 
         candidates = OsgiUtils.getClasspathCandidates( JUNIT_SLF4J_FILTER );
         assertTrue( "Should have at least 4 results with JUNIT_SLF4J_FILTER", candidates.size()
>= 4 );
-        
+
         candidates = OsgiUtils.getClasspathCandidates( null );
         assertTrue( "Should have at least 4 results with no filter", candidates.size() >=
4 );
     }
-    
-    
+
+
     @Test
     public void testGetAllBundleExports()
     {

Modified: directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/StringsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/StringsTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/StringsTest.java
(original)
+++ directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/StringsTest.java
Tue Jan 24 17:44:03 2012
@@ -41,7 +41,7 @@ import com.mycila.junit.concurrent.Concu
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith( ConcurrentJunitRunner.class )
+@RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
 public class StringsTest
 {
@@ -84,10 +84,10 @@ public class StringsTest
         List<String> list = new ArrayList<String>();
 
         list.add( "elem1" );
-        list.add("elem2");
+        list.add( "elem2" );
         list.add( "elem3" );
 
-        assertEquals("elem1, elem2, elem3", Strings.listToString(list));
+        assertEquals( "elem1, elem2, elem3", Strings.listToString( list ) );
     }
 
 
@@ -101,7 +101,7 @@ public class StringsTest
             int val;
 
 
-            public Value(String name, int val)
+            public Value( String name, int val )
             {
                 this.name = name;
                 this.val = val;
@@ -120,7 +120,7 @@ public class StringsTest
         map.put( "elem2", new Value( "name2", 2 ) );
         map.put( "elem3", new Value( "name3", 3 ) );
 
-        String result = Strings.mapToString(map);
+        String result = Strings.mapToString( map );
 
         boolean res = "elem1 = '[name1, 1]', elem2 = '[name2, 2]', elem3 = '[name3, 3]'".equals(
result )
             || "elem1 = '[name1, 1]', elem3 = '[name3, 3]', elem2 = '[name2, 2]'".equals(
result )
@@ -155,39 +155,39 @@ public class StringsTest
     @Test
     public void testTrim()
     {
-        assertEquals( "", Strings.trim((String) null) );
-        assertEquals( "", Strings.trim("") );
-        assertEquals( "", Strings.trim(" ") );
-        assertEquals( "", Strings.trim("  ") );
-        assertEquals( "a", Strings.trim("a  ") );
-        assertEquals( "a", Strings.trim("  a") );
-        assertEquals( "a", Strings.trim("  a  ") );
+        assertEquals( "", Strings.trim( ( String ) null ) );
+        assertEquals( "", Strings.trim( "" ) );
+        assertEquals( "", Strings.trim( " " ) );
+        assertEquals( "", Strings.trim( "  " ) );
+        assertEquals( "a", Strings.trim( "a  " ) );
+        assertEquals( "a", Strings.trim( "  a" ) );
+        assertEquals( "a", Strings.trim( "  a  " ) );
     }
 
 
     @Test
     public void testTrimLeft()
     {
-        assertEquals( "", Strings.trimLeft((String) null) );
-        assertEquals( "", Strings.trimLeft("") );
-        assertEquals( "", Strings.trimLeft(" ") );
-        assertEquals( "", Strings.trimLeft("  ") );
-        assertEquals( "a  ", Strings.trimLeft("a  ") );
-        assertEquals( "a", Strings.trimLeft("  a") );
-        assertEquals( "a  ", Strings.trimLeft("  a  ") );
+        assertEquals( "", Strings.trimLeft( ( String ) null ) );
+        assertEquals( "", Strings.trimLeft( "" ) );
+        assertEquals( "", Strings.trimLeft( " " ) );
+        assertEquals( "", Strings.trimLeft( "  " ) );
+        assertEquals( "a  ", Strings.trimLeft( "a  " ) );
+        assertEquals( "a", Strings.trimLeft( "  a" ) );
+        assertEquals( "a  ", Strings.trimLeft( "  a  " ) );
     }
 
 
     @Test
     public void testTrimRight()
     {
-        assertEquals( "", Strings.trimRight((String) null) );
-        assertEquals( "", Strings.trimRight("") );
-        assertEquals( "", Strings.trimRight(" ") );
-        assertEquals( "", Strings.trimRight("  ") );
-        assertEquals( "a", Strings.trimRight("a  ") );
-        assertEquals( "  a", Strings.trimRight("  a") );
-        assertEquals( "  a", Strings.trimRight("  a  ") );
+        assertEquals( "", Strings.trimRight( ( String ) null ) );
+        assertEquals( "", Strings.trimRight( "" ) );
+        assertEquals( "", Strings.trimRight( " " ) );
+        assertEquals( "", Strings.trimRight( "  " ) );
+        assertEquals( "a", Strings.trimRight( "a  " ) );
+        assertEquals( "  a", Strings.trimRight( "  a" ) );
+        assertEquals( "  a", Strings.trimRight( "  a  " ) );
     }
 
 
@@ -195,10 +195,12 @@ public class StringsTest
     public void testConvertUUID()
     {
         UUID uuid = UUID.randomUUID();
-        byte[] bytes = Strings.uuidToBytes(uuid.toString());
-        String string = Strings.uuidToString(bytes);
+        byte[] bytes = Strings.uuidToBytes( uuid.toString() );
+        String string = Strings.uuidToString( bytes );
         assertEquals( uuid.toString(), string );
     }
+
+
     /**
      * Test the DnUtils AreEquals method
      */
@@ -206,7 +208,7 @@ public class StringsTest
     public void testAreEqualsFull()
     {
         // Full compare
-        assertEquals( 6, Strings.areEquals("azerty".getBytes(), 0, "azerty") );
+        assertEquals( 6, Strings.areEquals( "azerty".getBytes(), 0, "azerty" ) );
     }
 
 

Modified: directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/UnicodeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/UnicodeTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/UnicodeTest.java
(original)
+++ directory/shared/trunk/util/src/test/java/org/apache/directory/shared/util/UnicodeTest.java
Tue Jan 24 17:44:03 2012
@@ -82,10 +82,10 @@ public class UnicodeTest
         ObjectOutputStream dos = new ObjectOutputStream( fos );
         ObjectInputStream dis = new ObjectInputStream( fis );
         String testString = null;
-        Unicode.writeUTF(dos, testString);
+        Unicode.writeUTF( dos, testString );
         dos.flush();
         dos.close();
-        assertEquals( testString, Unicode.readUTF(dis) );
+        assertEquals( testString, Unicode.readUTF( dis ) );
         dis.close();
     }
 
@@ -102,10 +102,10 @@ public class UnicodeTest
         ObjectOutputStream dos = new ObjectOutputStream( fos );
         ObjectInputStream dis = new ObjectInputStream( fis );
         String testString = "";
-        Unicode.writeUTF(dos, testString);
+        Unicode.writeUTF( dos, testString );
         dos.flush();
         dos.close();
-        assertEquals( testString, Unicode.readUTF(dis) );
+        assertEquals( testString, Unicode.readUTF( dis ) );
         dis.close();
     }
 
@@ -124,10 +124,10 @@ public class UnicodeTest
         char[] fill = new char[196622]; // 65535 * 3 + 17
         Arrays.fill( fill, '\u00fc' ); // German &&uuml
         String testString = new String( fill );
-        Unicode.writeUTF(dos, testString);
+        Unicode.writeUTF( dos, testString );
         dos.flush();
         dos.close();
-        assertEquals( testString, Unicode.readUTF(dis) );
+        assertEquals( testString, Unicode.readUTF( dis ) );
         dis.close();
     }
 
@@ -135,8 +135,8 @@ public class UnicodeTest
     @Test
     public void testOneByteChar()
     {
-        char res = Unicode.bytesToChar(new byte[]
-                {0x30});
+        char res = Unicode.bytesToChar( new byte[]
+            { 0x30 } );
 
         assertEquals( '0', res );
     }
@@ -145,8 +145,8 @@ public class UnicodeTest
     @Test
     public void testOneByteChar00()
     {
-        char res = Unicode.bytesToChar(new byte[]
-                {0x00});
+        char res = Unicode.bytesToChar( new byte[]
+            { 0x00 } );
 
         assertEquals( 0x00, res );
     }
@@ -155,8 +155,8 @@ public class UnicodeTest
     @Test
     public void testOneByteChar7F()
     {
-        char res = Unicode.bytesToChar(new byte[]
-                {0x7F});
+        char res = Unicode.bytesToChar( new byte[]
+            { 0x7F } );
 
         assertEquals( 0x7F, res );
     }
@@ -165,48 +165,48 @@ public class UnicodeTest
     @Test
     public void testTwoBytesChar()
     {
-        char res = Unicode.bytesToChar(new byte[]
-                {(byte) 0xCE, (byte) 0x91});
+        char res = Unicode.bytesToChar( new byte[]
+            { ( byte ) 0xCE, ( byte ) 0x91 } );
 
-        assertEquals(0x0391, res);
+        assertEquals( 0x0391, res );
     }
 
 
     @Test
     public void testThreeBytesChar()
     {
-        char res = Unicode.bytesToChar(new byte[]
-                {(byte) 0xE2, (byte) 0x89, (byte) 0xA2});
+        char res = Unicode.bytesToChar( new byte[]
+            { ( byte ) 0xE2, ( byte ) 0x89, ( byte ) 0xA2 } );
 
-        assertEquals(0x2262, res);
+        assertEquals( 0x2262, res );
     }
 
 
     @Test
     public void testcharToBytesOne()
     {
-        assertEquals( "0x00 ", Strings.dumpBytes(Unicode.charToBytes((char) 0x0000)) );
-        assertEquals( "0x61 ", Strings.dumpBytes(Unicode.charToBytes('a')) );
-        assertEquals("0x7F ", Strings.dumpBytes(Unicode.charToBytes((char) 0x007F)));
+        assertEquals( "0x00 ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x0000 )
) );
+        assertEquals( "0x61 ", Strings.dumpBytes( Unicode.charToBytes( 'a' ) ) );
+        assertEquals( "0x7F ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x007F )
) );
     }
 
 
     @Test
     public void testcharToBytesTwo()
     {
-        assertEquals( "0xC2 0x80 ", Strings.dumpBytes(Unicode.charToBytes((char) 0x0080))
);
-        assertEquals( "0xC3 0xBF ", Strings.dumpBytes(Unicode.charToBytes((char) 0x00FF))
);
-        assertEquals("0xC4 0x80 ", Strings.dumpBytes(Unicode.charToBytes((char) 0x0100)));
-        assertEquals("0xDF 0xBF ", Strings.dumpBytes(Unicode.charToBytes((char) 0x07FF)));
+        assertEquals( "0xC2 0x80 ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x0080
) ) );
+        assertEquals( "0xC3 0xBF ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x00FF
) ) );
+        assertEquals( "0xC4 0x80 ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x0100
) ) );
+        assertEquals( "0xDF 0xBF ", Strings.dumpBytes( Unicode.charToBytes( ( char ) 0x07FF
) ) );
     }
 
 
     @Test
     public void testcharToBytesThree()
     {
-        assertEquals( "0xE0 0xA0 0x80 ", Strings.dumpBytes(Unicode.charToBytes((char) 0x0800))
);
-        assertEquals( "0xE0 0xBF 0xBF ", Strings.dumpBytes(Unicode.charToBytes((char) 0x0FFF))
);
-        assertEquals("0xE1 0x80 0x80 ", Strings.dumpBytes(Unicode.charToBytes((char) 0x1000)));
-        assertEquals("0xEF 0xBF 0xBF ", Strings.dumpBytes(Unicode.charToBytes((char) 0xFFFF)));
+        assertEquals( "0xE0 0xA0 0x80 ", Strings.dumpBytes( Unicode.charToBytes( ( char )
0x0800 ) ) );
+        assertEquals( "0xE0 0xBF 0xBF ", Strings.dumpBytes( Unicode.charToBytes( ( char )
0x0FFF ) ) );
+        assertEquals( "0xE1 0x80 0x80 ", Strings.dumpBytes( Unicode.charToBytes( ( char )
0x1000 ) ) );
+        assertEquals( "0xEF 0xBF 0xBF ", Strings.dumpBytes( Unicode.charToBytes( ( char )
0xFFFF ) ) );
     }
 }



Mime
View raw message