1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
/*******************************************************************************
* Copyright (c) 2011 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.ats.core.workflow.transition;
import java.util.Collection;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.IBasicUser;
/**
* Allows setting of workingBranchInWork and branchInCommit for testing purposes. If not set, uses default from
* TransitionHelper
*
* @author Donald G. Dunne
*/
public class TestTransitionHelper extends TransitionHelper {
public Boolean workingBranchInWork = null;
public Boolean branchInCommit = null;
public Boolean systemUser = null;
public Boolean systemUserAssigned = null;
public Boolean overrideTransitionValidityCheck = null;
public TestTransitionHelper(String name, Collection<? extends AbstractWorkflowArtifact> awas, String toStateName, Collection<? extends IBasicUser> toAssignees, String cancellationReason, TransitionOption... transitionOption) {
super(name, awas, toStateName, toAssignees, cancellationReason, transitionOption);
}
@Override
public boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
if (workingBranchInWork != null) {
return workingBranchInWork;
}
return super.isWorkingBranchInWork(teamArt);
}
@Override
public boolean isBranchInCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
if (branchInCommit != null) {
return branchInCommit;
}
return super.isBranchInCommit(teamArt);
}
public Boolean getWorkingBranchInWork() {
return workingBranchInWork;
}
public void setWorkingBranchInWork(Boolean workingBranchInWork) {
this.workingBranchInWork = workingBranchInWork;
}
public Boolean getBranchInCommit() {
return branchInCommit;
}
public void setBranchInCommit(Boolean branchInCommit) {
this.branchInCommit = branchInCommit;
}
@Override
public boolean isSystemUser() throws OseeCoreException {
if (systemUser != null) {
return systemUser;
}
return super.isSystemUser();
}
public void setSystemUser(Boolean systemUser) {
this.systemUser = systemUser;
}
@Override
public boolean isSystemUserAssingee(AbstractWorkflowArtifact awa) throws OseeCoreException {
if (systemUserAssigned != null) {
return systemUserAssigned;
}
return super.isSystemUserAssingee(awa);
}
public void setSystemUserAssigned(Boolean systemUserAssigned) {
this.systemUserAssigned = systemUserAssigned;
}
@Override
public boolean isOverrideTransitionValidityCheck() {
if (overrideTransitionValidityCheck != null) {
return overrideTransitionValidityCheck;
}
return super.isOverrideTransitionValidityCheck();
}
public void setOverrideTransitionValidityCheck(Boolean overrideTransitionValidityCheck) {
this.overrideTransitionValidityCheck = overrideTransitionValidityCheck;
}
}
|