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

COVERAGE SUMMARY FOR SOURCE FILE [UpdateProjectFromWorkingDirectoryContinuumAction.java]

nameclass, %method, %block, %line, %
UpdateProjectFromWorkingDirectoryContinuumAction.java100% (1/1)100% (2/2)100% (51/51)100% (9/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UpdateProjectFromWorkingDirectoryContinuumAction100% (1/1)100% (2/2)100% (51/51)100% (9/9)
UpdateProjectFromWorkingDirectoryContinuumAction (): void 100% (1/1)100% (3/3)100% (1/1)
execute (Map): void 100% (1/1)100% (48/48)100% (8/8)

1package org.apache.maven.continuum.core.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.Map;
23 
24import org.apache.continuum.dao.BuildDefinitionDao;
25import org.apache.continuum.dao.ProjectDao;
26import org.apache.maven.continuum.ContinuumException;
27import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
28import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
29import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
30import org.apache.maven.continuum.model.project.BuildDefinition;
31import org.apache.maven.continuum.model.project.Project;
32import org.apache.maven.continuum.store.ContinuumStoreException;
33import org.apache.maven.continuum.utils.WorkingDirectoryService;
34 
35/**
36 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
37 * @version $Id: UpdateProjectFromWorkingDirectoryContinuumAction.java 771177 2009-05-04 05:02:26Z evenisse $
38 * @plexus.component role="org.codehaus.plexus.action.Action"
39 * role-hint="update-project-from-working-directory"
40 */
41public class UpdateProjectFromWorkingDirectoryContinuumAction
42    extends AbstractContinuumAction
43{
44    /**
45     * @plexus.requirement
46     */
47    private WorkingDirectoryService workingDirectoryService;
48 
49    /**
50     * @plexus.requirement
51     */
52    private BuildExecutorManager buildExecutorManager;
53 
54    /**
55     * @plexus.requirement
56     */
57    private BuildDefinitionDao buildDefinitionDao;
58 
59    /**
60     * @plexus.requirement
61     */
62    private ProjectDao projectDao;
63 
64    public void execute( Map context )
65        throws ContinuumStoreException, ContinuumException, ContinuumBuildExecutorException
66    {
67        Project project = getProject( context );
68 
69        project = projectDao.getProjectWithAllDetails( project.getId() );
70 
71        getLogger().info( "Updating project '" + project.getName() + "' from checkout." );
72 
73        BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( getBuildDefinitionId( context ) );
74 
75        // ----------------------------------------------------------------------
76        // Make a new descriptor
77        // ----------------------------------------------------------------------
78 
79        ContinuumBuildExecutor builder = buildExecutorManager.getBuildExecutor( project.getExecutorId() );
80 
81        builder.updateProjectFromCheckOut( workingDirectoryService.getWorkingDirectory( project ), project,
82                                           buildDefinition );
83 
84        // ----------------------------------------------------------------------
85        // Store the new descriptor
86        // ----------------------------------------------------------------------
87 
88        projectDao.updateProject( project );
89    }
90}

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