protected String getSpringConfigLocation()
{
- return "classpath*:META-INF/spring-context.xml";
+ return "classpath*:spring-context.xml,classpath*:META-INF/spring-context.xml";
}
import org.apache.archiva.redback.role.util.RoleModelUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
extends TestCase
{
+ protected Logger logger = LoggerFactory.getLogger( getClass() );
+
protected RBACManager rbacManager;
protected RoleManager roleManager;
for ( String roleName : assignments )
{
- System.out.println( roleName );
+ logger.info( roleName );
assertTrue( "Test Role".equals( roleName ) || "Foo 2 - frigid".equals( roleName ) || "Test Role 1".equals( roleName ) );
}
}
import org.apache.archiva.redback.tests.utils.RBACDefaults;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
private RBACDefaults rbacDefaults;
+ protected Logger logger = LoggerFactory.getLogger( getClass() );
+
public void setRbacManager( RBACManager store )
{
this.rbacManager = store;
double ratio = (double) elapsed / (double) ONESECOND; // ratio of time to 1 second.
double opsPerSecond = (double) iterations / ratio;
- System.out.println( "Performance " + msg + ": " + opsPerSecond + " operations per second. (effective)" );
+ logger.info( "Performance {}: {} operations per second. (effective)", msg, opsPerSecond );
if ( opsPerSecond < threshold )
{
stats.append( "\nRatio : " ).append( Double.toString( ratio ) );
stats.append( "\nOps per second : " ).append( Double.toString( opsPerSecond ) );
- System.out.println( stats.toString() );
+ logger.info( stats.toString() );
fail( "Performance Error: " + msg + " expecting greater than [" + threshold + "], actual [" + opsPerSecond
+ "]" );
import org.apache.archiva.redback.rbac.Permission;
import org.apache.archiva.redback.rbac.Role;
import org.apache.archiva.redback.rbac.UserAssignment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
public List<String> removedPermissionNames = new ArrayList<String>();
+ protected Logger logger = LoggerFactory.getLogger( getClass() );
+
public void rbacInit( boolean freshdb )
{
log( "Init - freshdb: " + freshdb );
private void log( String msg )
{
- System.out.println( "[RBAC Event Tracker] " + msg );
+ logger.info( "[RBAC Event Tracker] : {}", msg );
}
}
"User Manager Configuration Missing: " + USER_MANAGER_IMPL + " configuration property" );
}
+ log.info( "use userManager impl with key: '{}'", userManagerRole );
+
userManagerImpl = applicationContext.getBean( "userManager#" + userManagerRole, UserManager.class );
- // (UserManager) container.lookup( UserManager.class.getName(), userManagerRole );
}
public User addUser( User user )
assertEquals( "jesse", jesse.getPrincipal().toString() );
assertEquals( "jesse@apache.org", jesse.getEmail() );
assertEquals( "foo", jesse.getFullName() );
- System.out.println( "=====>"+jesse.getEncodedPassword());
- System.out.println( "=====>"+passwordEncoder.encodePassword( "foo" ));
+ log.info( "=====>"+jesse.getEncodedPassword());
+ log.info( "=====>"+passwordEncoder.encodePassword( "foo" ));
assertTrue( passwordEncoder.isPasswordValid( jesse.getEncodedPassword(), "foo" ) );
}