directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r547511 - in /directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns: ./ io/decoder/ io/encoder/
Date Fri, 15 Jun 2007 03:31:39 GMT
Author: erodriguez
Date: Thu Jun 14 20:31:38 2007
New Revision: 547511

URL: http://svn.apache.org/viewvc?view=rev&rev=547511
Log:
Formatting and imports organization of DNS tests.

Modified:
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.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/MailExchangeRecordDecoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
Thu Jun 14 20:31:38 2007
@@ -57,14 +57,14 @@
     {
         return getByteBufferFromFile( "DNS-QUERY.pdu" );
     }
-    
-    
+
+
     protected ByteBuffer getTestResponseByteBuffer() throws IOException
     {
         return getByteBufferFromFile( "DNS-RESPONSE.pdu" );
     }
-    
-    
+
+
     protected ByteBuffer getTestMxQueryByteBuffer() throws IOException
     {
         return getByteBufferFromFile( "MX-QUERY.pdu" );
@@ -76,7 +76,7 @@
         return getByteBufferFromFile( "MX-RESPONSE.pdu" );
     }
 
-    
+
     protected ByteBuffer getByteBufferFromFile( String file ) throws IOException
     {
         InputStream is = getClass().getResourceAsStream( file );
@@ -94,9 +94,9 @@
 
         return ByteBuffer.wrap( bytes );
     }
-    
-    
-    protected DnsMessage getTestQuery() 
+
+
+    protected DnsMessage getTestQuery()
     {
         DnsMessageModifier modifier = new DnsMessageModifier();
         modifier.setTransactionId( ( short ) 27799 );
@@ -111,13 +111,13 @@
         return modifier.getDnsMessage();
     }
 
-    
-    protected QuestionRecord getTestQuestionRecord() 
+
+    protected QuestionRecord getTestQuestionRecord()
     {
         return new QuestionRecord( "www.example.com", RecordType.A, RecordClass.IN );
     }
-    
-    
+
+
     protected DnsMessage getTestMxQuery()
     {
         DnsMessageModifier modifier = new DnsMessageModifier();
@@ -132,13 +132,14 @@
         modifier.setAdditionalRecords( new ArrayList<ResourceRecord>() );
         return modifier.getDnsMessage();
     }
-    
 
-    protected QuestionRecord getTestMxQuestionRecord() 
+
+    protected QuestionRecord getTestMxQuestionRecord()
     {
         return new QuestionRecord( "apache.org", RecordType.MX, RecordClass.IN );
     }
-    
+
+
     protected DnsMessage getTestMxResponse() throws UnknownHostException
     {
         DnsMessageModifier modifier = new DnsMessageModifier();
@@ -154,69 +155,69 @@
         modifier.setAdditionalRecords( getTestMxAdditionalRecords() );
         return modifier.getDnsMessage();
     }
-    
-    
+
+
     protected List<ResourceRecord> getTestMxAnswerRecords()
     {
         List<ResourceRecord> records = new ArrayList<ResourceRecord>();
-        
+
         ResourceRecordModifier modifier = new ResourceRecordModifier();
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsType (RecordType.MX);
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsTtl (267);
-        modifier.put (DnsAttribute.MX_PREFERENCE, "10");
-        modifier.put (DnsAttribute.DOMAIN_NAME, "herse.apache.org");
-        records.add (modifier.getEntry ());
-        
-        modifier = new ResourceRecordModifier();
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsType (RecordType.MX);
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsTtl (267);
-        modifier.put (DnsAttribute.MX_PREFERENCE, "20");
-        modifier.put (DnsAttribute.DOMAIN_NAME, "mail.apache.org");
-        records.add (modifier.getEntry ());
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsType( RecordType.MX );
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsTtl( 267 );
+        modifier.put( DnsAttribute.MX_PREFERENCE, "10" );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "herse.apache.org" );
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsType( RecordType.MX );
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsTtl( 267 );
+        modifier.put( DnsAttribute.MX_PREFERENCE, "20" );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "mail.apache.org" );
+        records.add( modifier.getEntry() );
 
         return records;
     }
-    
+
 
     protected List<ResourceRecord> getTestMxAuthorityRecords()
     {
         List<ResourceRecord> records = new ArrayList<ResourceRecord>();
 
         ResourceRecordModifier modifier = new ResourceRecordModifier();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsTtl (1932);
-        modifier.setDnsType (RecordType.NS);
-        modifier.put (DnsAttribute.DOMAIN_NAME, "ns.hyperreal.org");
-        records.add (modifier.getEntry());
-
-        modifier = new ResourceRecordModifier();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsTtl (1932);
-        modifier.setDnsType (RecordType.NS);
-        modifier.put (DnsAttribute.DOMAIN_NAME, "ns1.eu.bitnames.com");
-        records.add (modifier.getEntry());
-        
-        modifier = new ResourceRecordModifier();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsTtl (1932);
-        modifier.setDnsType (RecordType.NS);
-        modifier.put (DnsAttribute.DOMAIN_NAME, "ns1.us.bitnames.com");
-        records.add (modifier.getEntry());
-
-        modifier = new ResourceRecordModifier();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("apache.org");
-        modifier.setDnsTtl (1932);
-        modifier.setDnsType (RecordType.NS);
-        modifier.put (DnsAttribute.DOMAIN_NAME, "ns2.surfnet.nl");
-        records.add (modifier.getEntry());
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsTtl( 1932 );
+        modifier.setDnsType( RecordType.NS );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "ns.hyperreal.org" );
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsTtl( 1932 );
+        modifier.setDnsType( RecordType.NS );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "ns1.eu.bitnames.com" );
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsTtl( 1932 );
+        modifier.setDnsType( RecordType.NS );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "ns1.us.bitnames.com" );
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "apache.org" );
+        modifier.setDnsTtl( 1932 );
+        modifier.setDnsType( RecordType.NS );
+        modifier.put( DnsAttribute.DOMAIN_NAME, "ns2.surfnet.nl" );
+        records.add( modifier.getEntry() );
 
         return records;
     }
@@ -225,54 +226,54 @@
     protected List<ResourceRecord> getTestMxAdditionalRecords() throws UnknownHostException
     {
         List<ResourceRecord> records = new ArrayList<ResourceRecord>();
-        
+
         ResourceRecordModifier modifier = new ResourceRecordModifier();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("herse.apache.org");
-        modifier.setDnsTtl (3313);
-        modifier.setDnsType (RecordType.A);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("140.211.11.133").toString
());
-        records.add (modifier.getEntry());
-
-        modifier = new ResourceRecordModifier ();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("mail.apache.org");
-        modifier.setDnsTtl (3313);
-        modifier.setDnsType (RecordType.A);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("140.211.11.2").toString
());
-        records.add (modifier.getEntry ());
-        
-        modifier = new ResourceRecordModifier ();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("ns1.eu.bitnames.com");
-        modifier.setDnsTtl (156234);
-        modifier.setDnsType (RecordType.A);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("82.195.149.118").toString
());
-        records.add (modifier.getEntry ());
-        
-        modifier = new ResourceRecordModifier ();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("ns1.us.bitnames.com");
-        modifier.setDnsTtl (156236);
-        modifier.setDnsType (RecordType.A);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("216.52.237.236").toString
());
-        records.add (modifier.getEntry ());
-        
-        modifier = new ResourceRecordModifier ();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("ns2.surfnet.nl");
-        modifier.setDnsTtl (77100);
-        modifier.setDnsType (RecordType.A);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("192.87.36.2").toString
());
-        records.add (modifier.getEntry ());
-
-        modifier = new ResourceRecordModifier ();
-        modifier.setDnsClass (RecordClass.IN);
-        modifier.setDnsName ("ns2.surfnet.nl");
-        modifier.setDnsTtl (77100);
-        modifier.setDnsType (RecordType.AAAA);
-        modifier.put (DnsAttribute.IP_ADDRESS, InetAddress.getByName ("2001:610:3:200a:192:87:36:2").toString
());
-        records.add (modifier.getEntry ());
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "herse.apache.org" );
+        modifier.setDnsTtl( 3313 );
+        modifier.setDnsType( RecordType.A );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "140.211.11.133" ).toString()
);
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "mail.apache.org" );
+        modifier.setDnsTtl( 3313 );
+        modifier.setDnsType( RecordType.A );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "140.211.11.2" ).toString()
);
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "ns1.eu.bitnames.com" );
+        modifier.setDnsTtl( 156234 );
+        modifier.setDnsType( RecordType.A );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "82.195.149.118" ).toString()
);
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "ns1.us.bitnames.com" );
+        modifier.setDnsTtl( 156236 );
+        modifier.setDnsType( RecordType.A );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "216.52.237.236" ).toString()
);
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "ns2.surfnet.nl" );
+        modifier.setDnsTtl( 77100 );
+        modifier.setDnsType( RecordType.A );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "192.87.36.2" ).toString()
);
+        records.add( modifier.getEntry() );
+
+        modifier = new ResourceRecordModifier();
+        modifier.setDnsClass( RecordClass.IN );
+        modifier.setDnsName( "ns2.surfnet.nl" );
+        modifier.setDnsTtl( 77100 );
+        modifier.setDnsType( RecordType.AAAA );
+        modifier.put( DnsAttribute.IP_ADDRESS, InetAddress.getByName( "2001:610:3:200a:192:87:36:2"
).toString() );
+        records.add( modifier.getEntry() );
 
         return records;
     }

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?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- 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
Thu Jun 14 20:31:38 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.common.ByteBuffer;
 
+
 /**
  * Tests for the A resource record decoder.
  * 

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?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- 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
Thu Jun 14 20:31:38 2007
@@ -37,7 +37,6 @@
  */
 public class MailExchangeRecordDecoderTest extends TestCase
 {
-
     ByteBuffer inputBuffer;
 
     short preference = 10;

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?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- 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
Thu Jun 14 20:31:38 2007
@@ -44,10 +44,11 @@
         { "ns", "hyperreal", "org" };
 
     NameServerRecordDecoder decoder;
-    
+
+
     public void setUp()
     {
-        inputBuffer = ByteBuffer.allocate( 128 );        
+        inputBuffer = ByteBuffer.allocate( 128 );
         inputBuffer.put( ( byte ) domainNameParts[0].length() );
         inputBuffer.put( domainNameParts[0].getBytes() );
         inputBuffer.put( ( byte ) domainNameParts[1].length() );
@@ -59,7 +60,8 @@
 
         decoder = new NameServerRecordDecoder();
     }
-    
+
+
     public void testDecode() throws Exception
     {
         Map attributes = decoder.decode( inputBuffer, ( short ) inputBuffer.remaining() );

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -43,7 +43,6 @@
  */
 public abstract class AbstractResourceRecordEncoderTest extends TestCase
 {
-
     ByteBuffer expectedData;
     String domainName = "herse.apache.org";
     String[] domainNameParts = domainName.split( "\\." );

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.dns.store.DnsAttribute;
 import org.apache.mina.common.ByteBuffer;
 
+
 /**
  * Tests for the A record encoder.
  * 
@@ -37,15 +38,16 @@
  */
 public class AddressRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-
     InetAddress address;
 
-    
+
     protected void setUpResourceData()
     {
-        try {
+        try
+        {
             address = InetAddress.getByName( "127.0.0.1" );
-        } catch (UnknownHostException e)
+        }
+        catch ( UnknownHostException e )
         {
             // should never happen
         }
@@ -58,7 +60,7 @@
         attributes.put( DnsAttribute.IP_ADDRESS, address );
         return attributes;
     }
-    
+
 
     protected ResourceRecordEncoder getEncoder()
     {

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -77,12 +77,12 @@
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {
         expectedData.put( ( byte ) 18 );
-        expectedData.put( ( byte ) cnameParts[0].length() );    // 1
-        expectedData.put( cnameParts[0].getBytes() );           // + 5
-        expectedData.put( ( byte ) cnameParts[1].length() );    // + 1
-        expectedData.put( cnameParts[1].getBytes() );           // + 6
-        expectedData.put( ( byte ) cnameParts[2].length() );    // + 1
-        expectedData.put( cnameParts[2].getBytes() );           // + 3
-        expectedData.put( ( byte ) 0x00 );                      // + 1 = 18
+        expectedData.put( ( byte ) cnameParts[0].length() ); // 1
+        expectedData.put( cnameParts[0].getBytes() ); // + 5
+        expectedData.put( ( byte ) cnameParts[1].length() ); // + 1
+        expectedData.put( cnameParts[1].getBytes() ); // + 6
+        expectedData.put( ( byte ) cnameParts[2].length() ); // + 1
+        expectedData.put( cnameParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 18
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -36,7 +36,6 @@
  */
 public class MailExchangeRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-
     String mxPreference = "10";
     String mxHost = "mail.apache.org";
     String[] mxParts = mxHost.split( "\\." );
@@ -61,12 +60,12 @@
     {
         expectedData.put( ( byte ) 20 );
         expectedData.putShort( Short.parseShort( mxPreference ) );
-        expectedData.put( ( byte ) mxParts[0].length() );    // 1
-        expectedData.put( mxParts[0].getBytes() );           // + 4
-        expectedData.put( ( byte ) mxParts[1].length() );    // + 1
-        expectedData.put( mxParts[1].getBytes() );           // + 6
-        expectedData.put( ( byte ) mxParts[2].length() );    // + 1
-        expectedData.put( mxParts[2].getBytes() );           // + 3
-        expectedData.put( ( byte ) 0x00 );                   // + 1 = 17
+        expectedData.put( ( byte ) mxParts[0].length() ); // 1
+        expectedData.put( mxParts[0].getBytes() ); // + 4
+        expectedData.put( ( byte ) mxParts[1].length() ); // + 1
+        expectedData.put( mxParts[1].getBytes() ); // + 6
+        expectedData.put( ( byte ) mxParts[2].length() ); // + 1
+        expectedData.put( mxParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 17
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dns.io.encoder;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,10 +36,10 @@
  */
 public class NameServerRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-
     String nsName = "ns1.eu.bitnames.com";
     String[] nsParts = nsName.split( "\\." );
-    
+
+
     protected Map getAttributes()
     {
         Map map = new HashMap();
@@ -46,22 +47,24 @@
         return map;
     }
 
+
     protected ResourceRecordEncoder getEncoder()
     {
         return new NameServerRecordEncoder();
     }
 
+
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {
         expectedData.put( ( byte ) 19 );
-        expectedData.put( ( byte ) nsParts[0].length() );    // 1
-        expectedData.put( nsParts[0].getBytes() );           // + 3
-        expectedData.put( ( byte ) nsParts[1].length() );    // + 1
-        expectedData.put( nsParts[1].getBytes() );           // + 2
-        expectedData.put( ( byte ) nsParts[2].length() );    // + 1
-        expectedData.put( nsParts[2].getBytes() );           // + 7
-        expectedData.put( ( byte ) nsParts[3].length() );    // + 1
-        expectedData.put( nsParts[3].getBytes() );           // + 3
-        expectedData.put( ( byte ) 0x00 );                   // + 1 = 19
+        expectedData.put( ( byte ) nsParts[0].length() ); // 1
+        expectedData.put( nsParts[0].getBytes() ); // + 3
+        expectedData.put( ( byte ) nsParts[1].length() ); // + 1
+        expectedData.put( nsParts[1].getBytes() ); // + 2
+        expectedData.put( ( byte ) nsParts[2].length() ); // + 1
+        expectedData.put( nsParts[2].getBytes() ); // + 7
+        expectedData.put( ( byte ) nsParts[3].length() ); // + 1
+        expectedData.put( nsParts[3].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 19
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dns.io.encoder;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,10 +36,10 @@
  */
 public class PointerRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-    
     String ptrName = "ptr.apache.org";
     String[] ptrParts = ptrName.split( "\\." );
 
+
     protected Map getAttributes()
     {
         Map map = new HashMap();
@@ -46,21 +47,22 @@
         return map;
     }
 
+
     protected ResourceRecordEncoder getEncoder()
     {
         return new PointerRecordEncoder();
     }
 
+
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {
         expectedData.put( ( byte ) 15 );
-        expectedData.put( ( byte ) ptrParts[0].length() );    // 1
-        expectedData.put( ptrParts[0].getBytes() );           // + 3
-        expectedData.put( ( byte ) ptrParts[1].length() );    // + 1
-        expectedData.put( ptrParts[1].getBytes() );           // + 6
-        expectedData.put( ( byte ) ptrParts[2].length() );    // + 1
-        expectedData.put( ptrParts[2].getBytes() );           // + 3
-        expectedData.put( ( byte ) 0x00 );                      // + 1 = 15
+        expectedData.put( ( byte ) ptrParts[0].length() ); // 1
+        expectedData.put( ptrParts[0].getBytes() ); // + 3
+        expectedData.put( ( byte ) ptrParts[1].length() ); // + 1
+        expectedData.put( ptrParts[1].getBytes() ); // + 6
+        expectedData.put( ( byte ) ptrParts[2].length() ); // + 1
+        expectedData.put( ptrParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 15
     }
-    
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dns.io.encoder;
 
+
 import junit.framework.TestCase;
 
 import org.apache.directory.server.dns.messages.QuestionRecord;
@@ -37,9 +38,9 @@
 public class QuestionRecordEncoderTest extends TestCase
 {
     ByteBuffer expectedData;
-    
+
     QuestionRecordEncoder encoder;
-    
+
     String name = "www.apache.org";
     String[] nameParts = name.split( "\\." );
     RecordType type = RecordType.A;
@@ -47,26 +48,28 @@
 
     QuestionRecord record = new QuestionRecord( name, type, rClass );
 
+
     public void setUp()
     {
         encoder = new QuestionRecordEncoder();
-        
+
         expectedData = ByteBuffer.allocate( 128 );
-        expectedData.put( ( byte ) nameParts[0].length() );     // 1
-        expectedData.put( nameParts[0].getBytes() );            // + 3
-        expectedData.put( ( byte ) nameParts[1].length() );     // + 1
-        expectedData.put( nameParts[1].getBytes() );            // + 6
-        expectedData.put( ( byte ) nameParts[2].length() );     // + 1
-        expectedData.put( nameParts[2].getBytes() );            // + 3
-        expectedData.put( ( byte ) 0x00 );                      // + 1 = 16
+        expectedData.put( ( byte ) nameParts[0].length() ); // 1
+        expectedData.put( nameParts[0].getBytes() ); // + 3
+        expectedData.put( ( byte ) nameParts[1].length() ); // + 1
+        expectedData.put( nameParts[1].getBytes() ); // + 6
+        expectedData.put( ( byte ) nameParts[2].length() ); // + 1
+        expectedData.put( nameParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 16
         expectedData.putShort( type.convert() );
         expectedData.putShort( rClass.convert() );
     }
-    
+
+
     public void testEncode()
     {
         ByteBuffer out = ByteBuffer.allocate( 128 );
-        encoder.put( out, record);
+        encoder.put( out, record );
         assertEquals( expectedData, out );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dns.io.encoder;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,13 +36,13 @@
  */
 public class ServerSelectionRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-    
     String priority = "0";
     String weight = "3";
     String port = "9";
     String srvName = "srv.apache.org";
     String[] srvParts = srvName.split( "\\." );
 
+
     @Override
     protected Map getAttributes()
     {
@@ -53,12 +54,14 @@
         return map;
     }
 
+
     @Override
     protected ResourceRecordEncoder getEncoder()
     {
         return new ServerSelectionRecordEncoder();
     }
 
+
     @Override
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {
@@ -66,13 +69,12 @@
         expectedData.putShort( Short.parseShort( priority ) );
         expectedData.putShort( Short.parseShort( weight ) );
         expectedData.putShort( Short.parseShort( port ) );
-        expectedData.put( ( byte ) srvParts[0].length() );  // 1
-        expectedData.put( srvParts[0].getBytes() );         // + 3
-        expectedData.put( ( byte ) srvParts[1].length() );  // + 1
-        expectedData.put( srvParts[1].getBytes() );         // + 6
-        expectedData.put( ( byte ) srvParts[2].length() );  // + 1
-        expectedData.put( srvParts[2].getBytes() );         // + 3
-        expectedData.put( ( byte ) 0x00 );                  // + 1 = 16
+        expectedData.put( ( byte ) srvParts[0].length() ); // 1
+        expectedData.put( srvParts[0].getBytes() ); // + 3
+        expectedData.put( ( byte ) srvParts[1].length() ); // + 1
+        expectedData.put( srvParts[1].getBytes() ); // + 6
+        expectedData.put( ( byte ) srvParts[2].length() ); // + 1
+        expectedData.put( srvParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 16
     }
-
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -45,7 +45,8 @@
     String retry = "900";
     String expire = "604800";
     String minimum = "3600";
-    
+
+
     protected Map getAttributes()
     {
         Map map = new HashMap();
@@ -68,26 +69,25 @@
 
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {
-        expectedData.put( ( byte ) 60 );   // 1 + 18 + 1 + 20 + 4 + 4 + 4 + 4 + 4
-        expectedData.put( ( byte ) mNameParts[0].length() );    // 1
-        expectedData.put( mNameParts[0].getBytes() );           // + 2
-        expectedData.put( ( byte ) mNameParts[1].length() );    // + 1
-        expectedData.put( mNameParts[1].getBytes() );           // + 9
-        expectedData.put( ( byte ) mNameParts[2].length() );    // + 1
-        expectedData.put( mNameParts[2].getBytes() );           // + 3
-        expectedData.put( ( byte  ) 0x00 );                     // + 1 = 18
-        expectedData.put( ( byte ) rNameParts[0].length() );    // 1
-        expectedData.put( rNameParts[0].getBytes() );           // + 4
-        expectedData.put( ( byte ) rNameParts[1].length() );    // + 1
-        expectedData.put( rNameParts[1].getBytes() );           // + 9
-        expectedData.put( ( byte ) rNameParts[2].length() );    // + 1
-        expectedData.put( rNameParts[2].getBytes() );           // + 3
-        expectedData.put( ( byte  ) 0x00 );                     // + 1 = 20
+        expectedData.put( ( byte ) 60 ); // 1 + 18 + 1 + 20 + 4 + 4 + 4 + 4 + 4
+        expectedData.put( ( byte ) mNameParts[0].length() ); // 1
+        expectedData.put( mNameParts[0].getBytes() ); // + 2
+        expectedData.put( ( byte ) mNameParts[1].length() ); // + 1
+        expectedData.put( mNameParts[1].getBytes() ); // + 9
+        expectedData.put( ( byte ) mNameParts[2].length() ); // + 1
+        expectedData.put( mNameParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 18
+        expectedData.put( ( byte ) rNameParts[0].length() ); // 1
+        expectedData.put( rNameParts[0].getBytes() ); // + 4
+        expectedData.put( ( byte ) rNameParts[1].length() ); // + 1
+        expectedData.put( rNameParts[1].getBytes() ); // + 9
+        expectedData.put( ( byte ) rNameParts[2].length() ); // + 1
+        expectedData.put( rNameParts[2].getBytes() ); // + 3
+        expectedData.put( ( byte ) 0x00 ); // + 1 = 20
         expectedData.putInt( ( int ) Long.parseLong( serial ) );
         expectedData.putInt( Integer.parseInt( refresh ) );
         expectedData.putInt( Integer.parseInt( retry ) );
         expectedData.putInt( Integer.parseInt( expire ) );
         expectedData.putInt( ( int ) Long.parseLong( minimum ) );
     }
-
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java?view=diff&rev=547511&r1=547510&r2=547511
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java
Thu Jun 14 20:31:38 2007
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dns.io.encoder;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,9 +36,9 @@
  */
 public class TextRecordEncoderTest extends AbstractResourceRecordEncoderTest
 {
-
     String characterString = "This is a string";
-    
+
+
     protected Map getAttributes()
     {
         Map map = new HashMap();
@@ -45,10 +46,12 @@
         return map;
     }
 
+
     protected ResourceRecordEncoder getEncoder()
     {
         return new TextRecordEncoder();
     }
+
 
     protected void putExpectedResourceData( ByteBuffer expectedData )
     {



Mime
View raw message