EMMA Coverage Report (generated Sun Sep 18 11:34:27 PHT 2011)
[all classes][org.apache.continuum.web.action]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractReleaseAction.java]

nameclass, %method, %block, %line, %
AbstractReleaseAction.java0%   (0/1)0%   (0/3)0%   (0/75)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractReleaseAction0%   (0/1)0%   (0/3)0%   (0/75)0%   (0/18)
AbstractReleaseAction (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getEnvironments (Profile): Map 0%   (0/1)0%   (0/62)0%   (0/13)
getJavaHomeValue (Profile): String 0%   (0/1)0%   (0/10)0%   (0/4)

1package org.apache.continuum.web.action;
2 
3/*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21 
22import java.util.Collections;
23import java.util.HashMap;
24import java.util.List;
25import java.util.Map;
26 
27import org.apache.maven.continuum.installation.InstallationService;
28import org.apache.maven.continuum.model.system.Installation;
29import org.apache.maven.continuum.model.system.Profile;
30import org.apache.maven.continuum.web.action.ContinuumActionSupport;
31import org.codehaus.plexus.util.StringUtils;
32 
33public class AbstractReleaseAction
34    extends ContinuumActionSupport
35{
36    protected Map<String, String> getEnvironments( Profile profile )
37    {
38        if ( profile == null )
39        {
40            return Collections.EMPTY_MAP;
41        }
42 
43        Map<String, String> envVars = new HashMap<String, String>();
44 
45        String javaHome = getJavaHomeValue( profile );
46        if ( !StringUtils.isEmpty( javaHome ) )
47        {
48            envVars.put( getContinuum().getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
49        }
50 
51        Installation builder = profile.getBuilder();
52        if ( builder != null )
53        {
54            envVars.put( getContinuum().getInstallationService().getEnvVar( InstallationService.MAVEN2_TYPE ), builder.getVarValue() );
55        }
56 
57        List<Installation> installations = profile.getEnvironmentVariables();
58        for ( Installation installation : installations )
59        {
60            envVars.put( installation.getVarName(), installation.getVarValue() );
61        }
62        return envVars;
63    }
64 
65    private String getJavaHomeValue( Profile profile )
66    {
67        Installation jdk = profile.getJdk();
68        if ( jdk == null )
69        {
70            return null;
71        }
72        return jdk.getVarValue();
73    }
74}

[all classes][org.apache.continuum.web.action]
EMMA 2.0.5312 (C) Vladimir Roubtsov