You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/05/24 08:39:04 UTC
svn commit: r178108 - in
/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec:
BindRequestTest.java BindResponseTest.java LdapDecoderTest.java
Author: elecharny
Date: Mon May 23 23:39:04 2005
New Revision: 178108
URL: http://svn.apache.org/viewcvs?rev=178108&view=rev
Log:
Suppressed the pooling mechanism
Modified:
directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java?rev=178108&r1=178107&r2=178108&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java Mon May 23 23:39:04 2005
@@ -25,7 +25,6 @@
import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
import org.apache.asn1.ldap.pojo.SaslAuthenticationPOJO;
import org.apache.asn1.ldap.pojo.SimpleAuthenticationPOJO;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
@@ -72,19 +71,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -104,10 +91,6 @@
Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthenticationPOJO ) );
Assert.assertEquals( "password", new String(( ( SimpleAuthenticationPOJO ) br.getAuthentication() ).getSimple()) );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
/**
@@ -135,19 +118,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -193,19 +164,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -225,10 +184,6 @@
Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
Assert.assertEquals( true, ( br.getAuthentication() instanceof SaslAuthenticationPOJO ) );
Assert.assertEquals( "KERBEROS_V4", ( ( SaslAuthenticationPOJO ) br.getAuthentication() ).getMechanism() );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
/**
@@ -267,19 +222,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -300,9 +243,5 @@
Assert.assertEquals( true, ( br.getAuthentication() instanceof SaslAuthenticationPOJO ) );
Assert.assertEquals( "KERBEROS_V4", ( ( SaslAuthenticationPOJO ) br.getAuthentication() ).getMechanism() );
Assert.assertEquals( "abcdef", new String( ( ( SaslAuthenticationPOJO ) br.getAuthentication() ).getCredentials() ) );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
}
Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java?rev=178108&r1=178107&r2=178108&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java Mon May 23 23:39:04 2005
@@ -23,7 +23,6 @@
import org.apache.asn1.ber.containers.IAsn1Container;
import org.apache.asn1.ldap.pojo.BindResponsePOJO;
import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
@@ -74,19 +73,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -105,9 +92,5 @@
Assert.assertEquals( 0, br.getLdapResult().getResultCode() );
Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getLdapResult().getMatchedDN() );
Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
}
Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java?rev=178108&r1=178107&r2=178108&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java Mon May 23 23:39:04 2005
@@ -24,7 +24,6 @@
import org.apache.asn1.ldap.pojo.BindRequestPOJO;
import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
import org.apache.asn1.ldap.pojo.SimpleAuthenticationPOJO;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
@@ -71,19 +70,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocate a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -103,10 +90,6 @@
Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthenticationPOJO ) );
Assert.assertEquals( "password", ( ( SimpleAuthenticationPOJO ) br.getAuthentication() ).getSimple() );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
/**
@@ -132,19 +115,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -163,10 +134,6 @@
Assert.assertEquals( 3, br.getVersion() );
Assert.assertEquals( null, br.getName() );
Assert.assertEquals( false, ( br.getAuthentication() instanceof SimpleAuthenticationPOJO ) );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
/**
@@ -192,19 +159,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
// First block of data
try
@@ -249,10 +204,6 @@
Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthenticationPOJO ) );
Assert.assertEquals( "password", ( ( SimpleAuthenticationPOJO ) br.getAuthentication() ).getSimple() );
-
- // Free the BindRequest Container. It will be put back in the IPool
- // after being reset.
- ldapMessageContainer.free();
}
/**
@@ -284,19 +235,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -340,19 +279,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{
@@ -396,19 +323,7 @@
stream.flip();
// Allocate a BindRequest Container
- IAsn1Container ldapMessageContainer = null;
-
- try
- {
- ldapMessageContainer = ( IAsn1Container ) ldapDecoder.allocate(
- LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL );
- }
- catch ( PoolException pe )
- {
- Assert.fail("Cannot allocat a LdapMessageContainer : " + pe.getMessage());
- }
-
- ldapMessageContainer.setPoolManager( ldapDecoder.getPoolManager() );
+ IAsn1Container ldapMessageContainer = new LdapMessageContainer();
try
{