EMMA Coverage Report (generated Thu May 22 12:08:10 CDT 2014)
[all classes][org.springframework.batch.core.job.flow.support.state]

COVERAGE SUMMARY FOR SOURCE FILE [FlowState.java]

nameclass, %method, %block, %line, %
FlowState.java100% (1/1)75%  (3/4)68%  (13/19)83%  (5/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FlowState100% (1/1)75%  (3/4)68%  (13/19)83%  (5/6)
handle (FlowExecutor): FlowExecutionStatus 0%   (0/1)0%   (0/6)0%   (0/1)
FlowState (Flow, String): void 100% (1/1)100% (7/7)100% (3/3)
getFlows (): Collection 100% (1/1)100% (4/4)100% (1/1)
isEndState (): boolean 100% (1/1)100% (2/2)100% (1/1)

1/*
2 * Copyright 2006-2013 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 */
16 
17package org.springframework.batch.core.job.flow.support.state;
18 
19import java.util.Collection;
20import java.util.Collections;
21 
22import org.springframework.batch.core.job.flow.Flow;
23import org.springframework.batch.core.job.flow.FlowExecutionStatus;
24import org.springframework.batch.core.job.flow.FlowExecutor;
25import org.springframework.batch.core.job.flow.FlowHolder;
26 
27/**
28 * State that delegates to a Flow
29 *
30 * @author Dave Syer
31 * @since 2.0
32 */
33public class FlowState extends AbstractState implements FlowHolder {
34 
35        private final Flow flow;
36 
37        /**
38         * @param name
39         */
40        public FlowState(Flow flow, String name) {
41                super(name);
42                this.flow = flow;
43        }
44 
45        /**
46         * @return the flows
47         */
48        @Override
49        public Collection<Flow> getFlows() {
50                return Collections.singleton(flow);
51        }
52 
53        @Override
54        public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
55                return flow.start(executor).getStatus();
56        }
57 
58        /* (non-Javadoc)
59         * @see org.springframework.batch.core.job.flow.State#isEndState()
60         */
61        @Override
62        public boolean isEndState() {
63                return false;
64        }
65 
66}

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