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

COVERAGE SUMMARY FOR SOURCE FILE [DefaultBuildExecutorManager.java]

nameclass, %method, %block, %line, %
DefaultBuildExecutorManager.java100% (1/1)100% (5/5)71%  (56/79)80%  (12/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DefaultBuildExecutorManager100% (1/1)100% (5/5)71%  (56/79)80%  (12/15)
getBuildExecutor (String): ContinuumBuildExecutor 100% (1/1)42%  (10/24)75%  (3/4)
initialize (): void 100% (1/1)79%  (34/43)75%  (6/8)
<static initializer> 100% (1/1)100% (4/4)100% (1/1)
DefaultBuildExecutorManager (): void 100% (1/1)100% (3/3)100% (1/1)
hasBuildExecutor (String): boolean 100% (1/1)100% (5/5)100% (1/1)

1package org.apache.maven.continuum.execution.manager;
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.HashMap;
23import java.util.Map;
24 
25import org.apache.maven.continuum.ContinuumException;
26import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
27import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
28import org.slf4j.Logger;
29import org.slf4j.LoggerFactory;
30 
31/**
32 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
33 * @version $Id: DefaultBuildExecutorManager.java 764863 2009-04-14 16:28:12Z evenisse $
34 * @plexus.component role="org.apache.maven.continuum.execution.manager.BuildExecutorManager"
35 * role-hint"default"
36 */
37public class DefaultBuildExecutorManager
38    implements BuildExecutorManager, Initializable
39{
40    private static final Logger log = LoggerFactory.getLogger( DefaultBuildExecutorManager.class );
41 
42    /**
43     * @plexus.requirement role="org.apache.maven.continuum.execution.ContinuumBuildExecutor"
44     */
45    private Map<String, ContinuumBuildExecutor> executors;
46 
47    // ----------------------------------------------------------------------
48    // Component Lifecycle
49    // ----------------------------------------------------------------------
50 
51    public void initialize()
52    {
53        if ( executors == null )
54        {
55            executors = new HashMap<String, ContinuumBuildExecutor>();
56        }
57 
58        if ( executors.size() == 0 )
59        {
60            log.warn( "No build executors defined." );
61        }
62        else
63        {
64            log.info( "Build executors:" );
65 
66            for ( String key : executors.keySet() )
67            {
68                log.info( "  " + key );
69            }
70        }
71    }
72 
73    // ----------------------------------------------------------------------
74    // BuildExecutorManager Implementation
75    // ----------------------------------------------------------------------
76 
77    public ContinuumBuildExecutor getBuildExecutor( String builderType )
78        throws ContinuumException
79    {
80        ContinuumBuildExecutor executor = executors.get( builderType );
81 
82        if ( executor == null )
83        {
84            throw new ContinuumException( "No such executor: '" + builderType + "'." );
85        }
86 
87        return executor;
88    }
89 
90    public boolean hasBuildExecutor( String executorId )
91    {
92        return executors.containsKey( executorId );
93    }
94}

[all classes][org.apache.maven.continuum.execution.manager]
EMMA 2.0.5312 (C) Vladimir Roubtsov