1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.model.tree.nodes;
14
15 import com.eviware.soapui.model.testsuite.TestCase;
16 import com.eviware.soapui.model.tree.AbstractTreeNode;
17 import com.eviware.soapui.model.tree.SoapUITreeNode;
18
19 /***
20 * SoapUITreeNode for TestCase implementations
21 *
22 * @author Ole.Matzura
23 */
24
25 public class TestCaseTreeNode extends AbstractTreeNode
26 {
27 public TestCaseTreeNode(TestCase testCase )
28 {
29 super( testCase, testCase.getTestSuite() );
30 }
31
32 public TestCase getTestCase()
33 {
34 return (TestCase) getModelItem();
35 }
36
37 public int getChildCount()
38 {
39 return getTestCase().getTestStepCount();
40 }
41
42 public int getIndexOfChild(Object child)
43 {
44 for( int c = 0; c < getTestCase().getTestStepCount(); c++ )
45 {
46 if( getTestCase().getTestStepAt( c ).getTreeNode() == child ) return c;
47 }
48
49 return -1;
50 }
51
52 public SoapUITreeNode getChildNode(int index)
53 {
54 return getTestCase().getTestStepAt(index ).getTreeNode();
55 }
56
57
58 }