directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1591177 - in /directory/apacheds/trunk/protocol-dns/src: main/java/org/apache/directory/server/dns/io/decoder/ test/java/org/apache/directory/server/dns/io/decoder/
Date Wed, 30 Apr 2014 02:53:26 GMT
Author: elecharny
Date: Wed Apr 30 02:53:26 2014
New Revision: 1591177

URL: http://svn.apache.org/r1591177
Log:
Fixed the attributes.put( String, xxxx ) method to inject lower case keys into the map (DIRSERVER-1972)

Modified:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
Wed Apr 30 02:53:26 2014
@@ -26,6 +26,7 @@ import java.net.InetAddress;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 
@@ -55,7 +56,8 @@ public class AddressRecordDecoder implem
         Map<String, Object> attributes = new HashMap<String, Object>();
         byte[] addressBytes = new byte[length];
         byteBuffer.get( addressBytes );
-        attributes.put( DnsAttribute.IP_ADDRESS, InetAddress.getByAddress( addressBytes )
);
+        attributes.put( Strings.toLowerCase( DnsAttribute.IP_ADDRESS ), InetAddress.getByAddress(
addressBytes ) );
+        
         return attributes;
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
Wed Apr 30 02:53:26 2014
@@ -26,6 +26,7 @@ import java.net.InetAddress;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 
@@ -50,7 +51,8 @@ public class IPv6RecordDecoder implement
         Map<String, Object> attributes = new HashMap<String, Object>();
         byte[] addressBytes = new byte[length];
         byteBuffer.get( addressBytes );
-        attributes.put( DnsAttribute.IP_ADDRESS, InetAddress.getByAddress( addressBytes )
);
+        attributes.put( Strings.toLowerCase( DnsAttribute.IP_ADDRESS ), InetAddress.getByAddress(
addressBytes ) );
+        
         return attributes;
     }
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
Wed Apr 30 02:53:26 2014
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 
@@ -60,8 +61,9 @@ public class MailExchangeRecordDecoder i
     public Map<String, Object> decode( IoBuffer byteBuffer, short length ) throws IOException
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
-        attributes.put( DnsAttribute.MX_PREFERENCE, byteBuffer.getShort() );
-        attributes.put( DnsAttribute.DOMAIN_NAME, DnsMessageDecoder.getDomainName( byteBuffer
) );
+        attributes.put( Strings.toLowerCase( DnsAttribute.MX_PREFERENCE ), byteBuffer.getShort()
);
+        attributes.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), DnsMessageDecoder.getDomainName(
byteBuffer ) );
+        
         return attributes;
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
Wed Apr 30 02:53:26 2014
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 
@@ -54,7 +55,8 @@ public class NameServerRecordDecoder imp
     public Map<String, Object> decode( IoBuffer byteBuffer, short length ) throws IOException
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME, DnsMessageDecoder.getDomainName( byteBuffer )
);
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), DnsMessageDecoder.getDomainName(
byteBuffer ) );
+        
         return map;
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoderTest.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoderTest.java
Wed Apr 30 02:53:26 2014
@@ -24,10 +24,12 @@ package org.apache.directory.server.dns.
 import java.net.InetAddress;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.junit.Before;
 import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 
 
@@ -60,6 +62,6 @@ public class AddressRecordDecoderTest
     public void testDecode() throws Exception
     {
         Map<String, Object> attributes = decoder.decode( inputBuffer, ( short ) address.getAddress().length
);
-        assertEquals( address, attributes.get( DnsAttribute.IP_ADDRESS ) );
+        assertEquals( address, attributes.get( Strings.toLowerCase( DnsAttribute.IP_ADDRESS
) ) );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java
Wed Apr 30 02:53:26 2014
@@ -24,6 +24,7 @@ package org.apache.directory.server.dns.
 import java.net.InetAddress;
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.junit.Before;
@@ -61,6 +62,6 @@ public class IPv6RecordDecoderTest
     public void testDecode() throws Exception
     {
         Map<String, Object> attributes = decoder.decode( inputBuffer, ( short ) address.getAddress().length
);
-        assertEquals( address, attributes.get( DnsAttribute.IP_ADDRESS ) );
+        assertEquals( address, attributes.get( Strings.toLowerCase( DnsAttribute.IP_ADDRESS
) ) );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java
Wed Apr 30 02:53:26 2014
@@ -23,10 +23,12 @@ package org.apache.directory.server.dns.
 
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.junit.Before;
 import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 
 
@@ -69,7 +71,7 @@ public class MailExchangeRecordDecoderTe
     public void testDecode() throws Exception
     {
         Map<String, Object> attributes = decoder.decode( inputBuffer, ( short ) inputBuffer.remaining()
);
-        assertEquals( preference, attributes.get( DnsAttribute.MX_PREFERENCE ) );
-        assertEquals( domainName, attributes.get( DnsAttribute.DOMAIN_NAME ) );
+        assertEquals( preference, attributes.get( Strings.toLowerCase( DnsAttribute.MX_PREFERENCE
) ) );
+        assertEquals( domainName, attributes.get( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME
) ) );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java?rev=1591177&r1=1591176&r2=1591177&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java
Wed Apr 30 02:53:26 2014
@@ -23,10 +23,12 @@ package org.apache.directory.server.dns.
 
 import java.util.Map;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.junit.Before;
 import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 
 
@@ -67,6 +69,6 @@ public class NameServerRecordDecoderTest
     public void testDecode() throws Exception
     {
         Map<String, Object> attributes = decoder.decode( inputBuffer, ( short ) inputBuffer.remaining()
);
-        assertEquals( domainName, attributes.get( DnsAttribute.DOMAIN_NAME ) );
+        assertEquals( domainName, attributes.get( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME
) ) );
     }
 }



Mime
View raw message