Skip to content

Commit

Permalink
merge -r 764917:764918 from 1.3.x branch
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/continuum/trunk@765356 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Emmanuel Venisse committed Apr 15, 2009
1 parent 6b75680 commit 0893e2b
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 63 deletions.
Expand Up @@ -43,7 +43,7 @@
public class DefaultContinuumConfiguration
implements ContinuumConfiguration
{
private Logger log = LoggerFactory.getLogger( getClass() );
private static final Logger log = LoggerFactory.getLogger( DefaultContinuumConfiguration.class );

private File configurationFile;

Expand Down
Expand Up @@ -19,15 +19,15 @@
* under the License.
*/

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
* @author <a href="mailto:olamy@apache.org">olamy</a>
* @version $Id$
Expand All @@ -36,9 +36,9 @@
public class TestDefaultContinuumConfiguration
extends PlexusInSpringTestCase
{
private Logger log = LoggerFactory.getLogger( getClass() );
private static final Logger log = LoggerFactory.getLogger( TestDefaultContinuumConfiguration.class );

private String confFile = "target/test-classes/conf/continuum.xml";
private static final String confFile = "target/test-classes/conf/continuum.xml";

@Override
protected void setUp()
Expand Down
Expand Up @@ -20,6 +20,7 @@
*/

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -79,7 +80,7 @@ public class ContinuumBuildConstant
public static final String KEY_PROJECT_GROUP_ID = "project-group-id";

public static final String KEY_PROJECT_GROUP_NAME = "project-group-name";

public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";

public static final String KEY_SCM_ERROR = "scm-error";
Expand Down Expand Up @@ -339,7 +340,7 @@ public static String getChangeFileStatus( Map context )

public static String getGroupId( Map context )
{
return getString( context, KEY_GROUP_ID);
return getString( context, KEY_GROUP_ID );
}

public static String getArtifactId( Map context )
Expand All @@ -350,7 +351,7 @@ public static String getArtifactId( Map context )
public static String getVersion( Map context )
{
return getString( context, KEY_PROJECT_VERSION );

}

public static String getProjectName( Map context )
Expand Down Expand Up @@ -514,33 +515,26 @@ protected static String getString( Map context, String key, String defaultValue
protected static boolean getBoolean( Map context, String key )
{
Object obj = getObject( context, key, null );

if ( obj == null )
{
return false;
}
else
{
return ( (Boolean) obj ).booleanValue();
}

return obj != null && (Boolean) obj;
}

protected static boolean getBoolean( Map context, String key, boolean defaultValue )
{
return ( (Boolean) getObject( context, key, Boolean.valueOf( defaultValue ) ) ).booleanValue();
}
return (Boolean) getObject( context, key, defaultValue );
}

protected static int getInteger( Map context, String key )
{
Object obj = getObject( context, key, null );

if ( obj == null )
{
return 0;
}
else
{
return ( (Integer) obj ).intValue();
return (Integer) obj;
}
}

Expand All @@ -554,7 +548,7 @@ protected static Date getDate( Map context, String key )
}
else
{
return (Date)obj;
return (Date) obj;
}
}

Expand All @@ -568,20 +562,10 @@ protected static List getList( Map context, String key )
}
else
{
List list = new ArrayList();
List<Object> list = new ArrayList<Object>();
Object[] objA = (Object[]) obj;

for ( Object o : objA )
{
if ( o instanceof Map )
{
list.add( (Map) o );
}
else
{
list.add( o );
}
}
list.addAll( Arrays.asList( objA ) );

return list;
}
Expand Down
Expand Up @@ -62,7 +62,7 @@
public class DefaultInstallationService
implements InstallationService, Initializable
{
private Logger log = LoggerFactory.getLogger( DefaultInstallationService.class );
private static final Logger log = LoggerFactory.getLogger( DefaultInstallationService.class );

@Resource
private InstallationDao installationDao;
Expand Down Expand Up @@ -454,8 +454,9 @@ private boolean alreadyExistInstallationName( Installation installation )
List<Installation> all = getAllInstallations();
for ( Installation install : all )
{
if ( org.apache.commons.lang.StringUtils.equals( installation.getName(), install.getName() )
&& ( installation.getInstallationId() == 0 || installation.getInstallationId() != install.getInstallationId() ) )
if ( org.apache.commons.lang.StringUtils.equals( installation.getName(), install.getName() ) &&
( installation.getInstallationId() == 0 ||
installation.getInstallationId() != install.getInstallationId() ) )
{
return true;
}
Expand Down
Expand Up @@ -19,6 +19,13 @@
* under the License.
*/

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.apache.continuum.buildqueue.BuildQueueService;
import org.apache.continuum.buildqueue.BuildQueueServiceException;
import org.apache.continuum.configuration.BuildAgentConfiguration;
Expand All @@ -37,21 +44,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class DefaultConfigurationService
implements ConfigurationService
{
private Logger log = LoggerFactory.getLogger( this.getClass() );
private static final Logger log = LoggerFactory.getLogger( DefaultConfigurationService.class );

// when adding a requirement, the template in spring-context.xml must be updated CONTINUUM-1207

Expand Down
@@ -1,5 +1,7 @@
package org.apache.continuum.profile;

import java.util.List;

import org.apache.continuum.dao.DaoUtils;
import org.apache.maven.continuum.AbstractContinuumTest;
import org.apache.maven.continuum.installation.InstallationService;
Expand All @@ -8,8 +10,6 @@
import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
import org.apache.maven.continuum.profile.ProfileService;

import java.util.List;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -40,35 +40,35 @@ public class DefaultProfileServiceTest

Installation jdk1;

String jdk1Name = "jdk1";
private static final String jdk1Name = "jdk1";

Installation jdk2;
private Installation jdk2;

String jdk2Name = "jdk2";
private static final String jdk2Name = "jdk2";

Installation mvn205;

String mvn205Name = "mvn 2.0.5";
private static final String mvn205Name = "mvn 2.0.5";

Installation mvn206;

String mvn206Name = "mvn 2.0.6";
private static final String mvn206Name = "mvn 2.0.6";

Profile jdk1mvn205;

String jdk1mvn205Name = "jdk1 mvn 2.0.5";
private static final String jdk1mvn205Name = "jdk1 mvn 2.0.5";

Profile jdk2mvn206;

String jdk2mvn206Name = "jdk2 mvn 2.0.6";
private static final String jdk2mvn206Name = "jdk2 mvn 2.0.6";

Installation mvnOpts1;

String mvnOpts1Name = "mvnOpts1";
private static final String mvnOpts1Name = "mvnOpts1";

Installation mvnOpts2;

String mvnOpts2Name = "mvnOpts2";
private static final String mvnOpts2Name = "mvnOpts2";

protected void setUp()
throws Exception
Expand Down
Expand Up @@ -19,25 +19,25 @@
* under the License.
*/

import java.io.File;

import org.apache.continuum.configuration.BuildAgentConfiguration;
import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class ConfigurationServiceTest
extends PlexusInSpringTestCase
{
private Logger log = LoggerFactory.getLogger( getClass() );
private static final Logger log = LoggerFactory.getLogger( ConfigurationServiceTest.class );

private String confFile = "target/test-classes/conf/continuum.xml";
private static final String confFile = "target/test-classes/conf/continuum.xml";

@Override
protected void setUp()
Expand Down

0 comments on commit 0893e2b

Please sign in to comment.