directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r376611 - in /directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp: ./ src/test/java/org/apache/directory/server/dhcp/ src/test/resources/
Date Fri, 10 Feb 2006 09:49:47 GMT
Author: akarasulu
Date: Fri Feb 10 01:49:45 2006
New Revision: 376611

URL: http://svn.apache.org/viewcvs?rev=376611&view=rev
Log:
quiet down dhcp tests; use logging instead of System.out

Added:
    directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/resources/log4j.properties
      - copied unchanged from r376608, directory/sandbox/akarasulu/rc1/apacheds/protocol-dns/src/test/resources/log4j.properties
Modified:
    directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/pom.xml
    directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/AbstractDhcpTestCase.java
    directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/pom.xml
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/pom.xml?rev=376611&r1=376610&r2=376611&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/pom.xml (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/pom.xml Fri Feb 10 01:49:45 2006
@@ -17,6 +17,12 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <version>1.2.19</version>
       <scope>provided</scope>
     </dependency>
     <dependency>

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/AbstractDhcpTestCase.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/AbstractDhcpTestCase.java?rev=376611&r1=376610&r2=376611&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/AbstractDhcpTestCase.java
(original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/AbstractDhcpTestCase.java
Fri Feb 10 01:49:45 2006
@@ -24,28 +24,44 @@
 import junit.framework.TestCase;
 
 import org.apache.directory.server.dhcp.messages.DhcpMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public abstract class AbstractDhcpTestCase extends TestCase
 {
 	protected static final int MINIMUM_DHCP_DATAGRAM_SIZE = 576;
-	
+	protected final Logger log;
+    
+    
+    public AbstractDhcpTestCase()
+    {
+        log = LoggerFactory.getLogger( AbstractDhcpTestCase.class );
+    }
+    
+    
+    public AbstractDhcpTestCase( Class subclass )
+    {
+        log = LoggerFactory.getLogger( subclass );
+    }
+    
+    
 	protected void print( DhcpMessage message )
 	{
-		System.out.println( message.getMessageType() );
-		System.out.println( message.getHardwareAddressType() );
-		System.out.println( message.getHardwareAddressLength() );
-		System.out.println( message.getHardwareOptions() );
-		System.out.println( message.getTransactionId() );
-		System.out.println( message.getSeconds() );
-		System.out.println( message.getFlags() );
-		System.out.println( message.getActualClientAddress() );
-		System.out.println( message.getAssignedClientAddress() );
-		System.out.println( message.getNextServerAddress() );
-		System.out.println( message.getRelayAgentAddress() );
-		System.out.println( message.getClientHardwareAddress() );
-		System.out.println( message.getServerHostname() );
-		System.out.println( message.getBootFileName() );
+		log.debug( String.valueOf( message.getMessageType() ) );
+		log.debug( String.valueOf( message.getHardwareAddressType() ) );
+		log.debug( String.valueOf( message.getHardwareAddressLength() ) );
+		log.debug( String.valueOf( message.getHardwareOptions() ) );
+		log.debug( String.valueOf( message.getTransactionId() ) );
+		log.debug( String.valueOf( message.getSeconds() ) );
+		log.debug( String.valueOf( message.getFlags() ) );
+		log.debug( String.valueOf( message.getActualClientAddress() ) );
+		log.debug( String.valueOf( message.getAssignedClientAddress() ) );
+		log.debug( String.valueOf( message.getNextServerAddress() ) );
+		log.debug( String.valueOf( message.getRelayAgentAddress() ) );
+		log.debug( String.valueOf( message.getClientHardwareAddress() ) );
+		log.debug( String.valueOf( message.getServerHostname() ) );
+		log.debug( String.valueOf( message.getBootFileName() ) );
 	}
 	
     protected ByteBuffer getByteBufferFromFile( String file ) throws IOException

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java?rev=376611&r1=376610&r2=376611&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java
(original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java
Fri Feb 10 01:49:45 2006
@@ -17,6 +17,7 @@
 
 package org.apache.directory.server.dhcp;
 
+
 import java.nio.ByteBuffer;
 
 import org.apache.directory.server.dhcp.io.DhcpMessageDecoder;
@@ -25,26 +26,33 @@
 
 public class DhcpMessageDecoderTest extends AbstractDhcpTestCase
 {
-	private ByteBuffer requestByteBuffer;
-	
-	public void testParseDiscover() throws Exception
-	{
-		requestByteBuffer = getByteBufferFromFile( "DHCPDISCOVER.pdu" );
-		
-		DhcpMessageDecoder decoder = new DhcpMessageDecoder();
-		DhcpMessage dhcpRequest = decoder.decode( requestByteBuffer );
-		
-		print( dhcpRequest );
-	}
-	
-	public void testParseOffer() throws Exception
-	{
-		requestByteBuffer = getByteBufferFromFile( "DHCPOFFER.pdu" );
-		
-		DhcpMessageDecoder decoder = new DhcpMessageDecoder();
-		DhcpMessage dhcpRequest = decoder.decode( requestByteBuffer );
-		
-		print( dhcpRequest );
-	}
-}
+    private ByteBuffer requestByteBuffer;
+
+
+    public DhcpMessageDecoderTest()
+    {
+        super( DhcpMessageDecoderTest.class );
+    }
+
+
+    public void testParseDiscover() throws Exception
+    {
+        requestByteBuffer = getByteBufferFromFile( "DHCPDISCOVER.pdu" );
 
+        DhcpMessageDecoder decoder = new DhcpMessageDecoder();
+        DhcpMessage dhcpRequest = decoder.decode( requestByteBuffer );
+
+        print( dhcpRequest );
+    }
+
+
+    public void testParseOffer() throws Exception
+    {
+        requestByteBuffer = getByteBufferFromFile( "DHCPOFFER.pdu" );
+
+        DhcpMessageDecoder decoder = new DhcpMessageDecoder();
+        DhcpMessage dhcpRequest = decoder.decode( requestByteBuffer );
+
+        print( dhcpRequest );
+    }
+}



Mime
View raw message