I think for those tests InetAddress.getLocalHost() doesn't make sense
because the IP address is 127.0.0.1 is hardcoded in the encoded stream.

On Jenkins the public IP is returned instead of 127.0.0.1 and the tests
fail. I'll change back to 127.0.0.1.


On 09/17/2015 11:49 AM, [email protected] wrote:
> Author: elecharny
> Date: Thu Sep 17 09:49:57 2015
> New Revision: 1703549
> 
> URL: http://svn.apache.org/r1703549
> Log:
> Used InetAddress.getLocalHost() instead of InetAddress.getByName( "127.0.0.1" 
> )
> 
> Modified:
>     
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbPrivPartDecoderTest.java
>     
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeBodyDecoderTest.java
> 
> Modified: 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbPrivPartDecoderTest.java
> URL: 
> http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbPrivPartDecoderTest.java?rev=1703549&r1=1703548&r2=1703549&view=diff
> ==============================================================================
> --- 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbPrivPartDecoderTest.java
>  (original)
> +++ 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbPrivPartDecoderTest.java
>  Thu Sep 17 09:49:57 2015
> @@ -145,7 +145,7 @@ public class EncKrbPrivPartDecoderTest
>          EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();
>  
>          String time = "20101119080043Z";
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, encKrbPrivPart.getUserData() ) );
> @@ -254,7 +254,7 @@ public class EncKrbPrivPartDecoderTest
>  
>          EncKrbPrivPart enKrbPrivPart = container.getEncKrbPrivPart();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, enKrbPrivPart.getUserData() ) );
> @@ -358,7 +358,7 @@ public class EncKrbPrivPartDecoderTest
>  
>          EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, encKrbPrivPart.getUserData() ) );
> @@ -458,7 +458,7 @@ public class EncKrbPrivPartDecoderTest
>  
>          EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, encKrbPrivPart.getUserData() ) );
> @@ -582,7 +582,7 @@ public class EncKrbPrivPartDecoderTest
>          EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();
>  
>          String time = "20101119080043Z";
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, encKrbPrivPart.getUserData() ) );
> @@ -666,7 +666,7 @@ public class EncKrbPrivPartDecoderTest
>  
>          EncKrbPrivPart encKrbPrivPart = container.getEncKrbPrivPart();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, encKrbPrivPart.getUserData() ) );
> 
> Modified: 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeBodyDecoderTest.java
> URL: 
> http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeBodyDecoderTest.java?rev=1703549&r1=1703548&r2=1703549&view=diff
> ==============================================================================
> --- 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeBodyDecoderTest.java
>  (original)
> +++ 
> directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbSafeBodyDecoderTest.java
>  Thu Sep 17 09:49:57 2015
> @@ -145,7 +145,7 @@ public class KrbSafeBodyDecoderTest
>          KrbSafeBody body = container.getKrbSafeBody();
>  
>          String time = "20101119080043Z";
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> @@ -254,7 +254,7 @@ public class KrbSafeBodyDecoderTest
>  
>          KrbSafeBody body = container.getKrbSafeBody();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> @@ -358,7 +358,7 @@ public class KrbSafeBodyDecoderTest
>  
>          KrbSafeBody body = container.getKrbSafeBody();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> @@ -458,7 +458,7 @@ public class KrbSafeBodyDecoderTest
>  
>          KrbSafeBody body = container.getKrbSafeBody();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> @@ -582,7 +582,7 @@ public class KrbSafeBodyDecoderTest
>          KrbSafeBody body = container.getKrbSafeBody();
>  
>          String time = "20101119080043Z";
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> @@ -666,7 +666,7 @@ public class KrbSafeBodyDecoderTest
>  
>          KrbSafeBody body = container.getKrbSafeBody();
>  
> -        HostAddress ad = new HostAddress( InetAddress.getByName( "127.0.0.1" 
> ) );
> +        HostAddress ad = new HostAddress( InetAddress.getLocalHost() );
>  
>          assertTrue( Arrays.equals( new byte[]
>              { 0, 1 }, body.getUserData() ) );
> 
> 

Reply via email to