blob: fcb1e19cbab40ea4a7f2e25cd1de6b73509034ab (
plain) (
blame)
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
|
/*******************************************************************************
* 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.config.copy;
import junit.framework.Assert;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.util.DemoTestUtil;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.support.test.util.DemoActionableItems;
import org.eclipse.osee.support.test.util.DemoTeam;
/**
* Test case for {@link ConfigData}
*
* @author Donald G. Dunne
*/
public class ConfigDataTest {
@org.junit.Test
public void testValidateData() throws Exception {
ConfigData data = new ConfigData();
XResultData results = new XResultData(false);
data.validateData(results);
Assert.assertTrue(results.isErrors());
Assert.assertEquals(4, results.getNumErrors());
data.setReplaceStr("ReplStr");
data.setSearchStr("SrchStr");
IAtsTeamDefinition tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_SW);
data.setTeamDef(tda);
IAtsActionableItem aia = DemoTestUtil.getActionableItem(DemoActionableItems.CIS_Code);
data.setActionableItem(aia);
results.clear();
data.validateData(results);
Assert.assertFalse(results.isErrors());
}
@org.junit.Test
public void testGetSetTeamDefinition() throws Exception {
ConfigData data = new ConfigData();
IAtsTeamDefinition tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_SW);
data.setTeamDef(tda);
Assert.assertEquals(tda, data.getTeamDef());
}
@org.junit.Test
public void testGetAiArts() throws Exception {
ConfigData data = new ConfigData();
IAtsActionableItem aia = DemoTestUtil.getActionableItem(DemoActionableItems.CIS_Code);
data.setActionableItem(aia);
Assert.assertEquals(aia, data.getActionableItem());
}
@org.junit.Test
public void testParentTeamDefinition() throws Exception {
ConfigData data = new ConfigData();
IAtsTeamDefinition tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_Code);
data.setTeamDef(tda);
Assert.assertEquals(DemoTestUtil.getTeamDef(DemoTeam.CIS_SW), data.getParentTeamDef());
tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_SW);
data.setTeamDef(tda);
Assert.assertEquals(TeamDefinitions.getTopTeamDefinition(), data.getParentTeamDef());
}
@org.junit.Test
public void testParentActionableItem() throws Exception {
ConfigData data = new ConfigData();
IAtsTeamDefinition tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_Code);
data.setTeamDef(tda);
Assert.assertEquals(DemoTestUtil.getActionableItem(DemoActionableItems.CIS_CSCI), data.getParentActionableItem());
tda = DemoTestUtil.getTeamDef(DemoTeam.CIS_SW);
data.setTeamDef(tda);
Assert.assertEquals(ActionableItems.getTopActionableItem(), data.getParentActionableItem());
}
}
|