EMMA Coverage Report (generated Fri Aug 21 15:59:46 BST 2009)
[all classes][org.springframework.batch.core.job.flow.support.state]

COVERAGE SUMMARY FOR SOURCE FILE [MaxValueFlowExecutionAggregator.java]

nameclass, %method, %block, %line, %
MaxValueFlowExecutionAggregator.java100% (1/1)100% (2/2)100% (15/15)100% (4/4)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MaxValueFlowExecutionAggregator100% (1/1)100% (2/2)100% (15/15)100% (4/4)
MaxValueFlowExecutionAggregator (): void 100% (1/1)100% (3/3)100% (1/1)
aggregate (Collection): FlowExecutionStatus 100% (1/1)100% (12/12)100% (3/3)

1/*
2 * Copyright 2006-2007 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.springframework.batch.core.job.flow.support.state;
17 
18import java.util.Collection;
19import java.util.Collections;
20 
21import org.springframework.batch.core.job.flow.FlowExecution;
22import org.springframework.batch.core.job.flow.FlowExecutionStatus;
23 
24/**
25 * Implementation of the {@link FlowExecutionAggregator} interface that aggregates
26 * {@link FlowExecutionStatus}', using the status with the high precedence as the
27 * aggregate status.  See {@link FlowExecutionStatus} for details on status
28 * precedence.
29 * 
30 * @author Dave Syer
31 * @since 2.0
32 */
33public class MaxValueFlowExecutionAggregator implements FlowExecutionAggregator {
34 
35        /**
36         * Aggregate all of the {@link FlowExecutionStatus}es of the
37         * {@link FlowExecution}s into one status. The aggregate status will be the
38         * status with the highest precedence.
39         * 
40         * @see FlowExecutionAggregator#aggregate(Collection)
41         */
42        public FlowExecutionStatus aggregate(Collection<FlowExecution> executions) {
43                if (executions == null || executions.size() == 0) {
44                        return FlowExecutionStatus.UNKNOWN;
45                }
46                return Collections.max(executions).getStatus();
47        }
48 
49}

[all classes][org.springframework.batch.core.job.flow.support.state]
EMMA 2.0.5312 (C) Vladimir Roubtsov