|
1 | | -// package checkmarx.ast.eclipse.plugin.tests.ui; |
| 1 | +package checkmarx.ast.eclipse.plugin.tests.ui; |
2 | 2 |
|
3 | | -// import static org.junit.Assert.assertTrue; |
| 3 | +import static org.junit.Assert.assertTrue; |
4 | 4 |
|
5 | | -// import java.util.concurrent.TimeoutException; |
| 5 | +import java.util.concurrent.TimeoutException; |
6 | 6 |
|
7 | | -// import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; |
8 | | -// import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; |
9 | | -// import org.junit.Test; |
10 | | -// import org.junit.runner.RunWith; |
| 7 | +import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; |
| 8 | +import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; |
| 9 | +import org.junit.Test; |
| 10 | +import org.junit.runner.RunWith; |
11 | 11 |
|
12 | | -// import com.checkmarx.eclipse.utils.PluginConstants; |
| 12 | +import com.checkmarx.eclipse.utils.PluginConstants; |
13 | 13 |
|
14 | | -// //@RunWith(SWTBotJunit4ClassRunner.class) |
15 | | -// public class BestFixLocationTest extends BaseUITest{ |
| 14 | +//@RunWith(SWTBotJunit4ClassRunner.class) |
| 15 | +public class BestFixLocationTest extends BaseUITest{ |
16 | 16 |
|
17 | | -// //@Test |
18 | | -// public void testBestFixLocation() throws TimeoutException { |
19 | | -// // setUpCheckmarxPlugin(true); |
20 | | -// // SWTBotTreeItem firstNode = getFirstResultNode(); |
21 | | -// // firstNode.select(); |
22 | | -// // sleep(3000); |
23 | | -// // String BFLText = _bot.textWithId(PluginConstants.BEST_FIX_LOCATION).getText(); |
24 | | -// // assertTrue(BFLText.equals(PluginConstants.BFL_FOUND) || BFLText.equals(PluginConstants.BFL_NOT_FOUND)); |
25 | | -// // _bot.viewByTitle(VIEW_CHECKMARX_AST_SCAN).close(); |
26 | | -// } |
| 17 | + //@Test |
| 18 | + public void testBestFixLocation() throws TimeoutException { |
| 19 | +// setUpCheckmarxPlugin(true); |
| 20 | +// SWTBotTreeItem firstNode = getFirstResultNode(); |
| 21 | +// firstNode.select(); |
| 22 | +// sleep(3000); |
| 23 | +// String BFLText = _bot.textWithId(PluginConstants.BEST_FIX_LOCATION).getText(); |
| 24 | +// assertTrue(BFLText.equals(PluginConstants.BFL_FOUND) || BFLText.equals(PluginConstants.BFL_NOT_FOUND)); |
| 25 | +// _bot.viewByTitle(VIEW_CHECKMARX_AST_SCAN).close(); |
| 26 | + } |
27 | 27 |
|
28 | 28 |
|
29 | | -// private SWTBotTreeItem getFirstResultNode() { |
30 | | -// String firstNodeName = _bot.tree().cell(0, 0); |
31 | | -// SWTBotTreeItem node = _bot.tree().getTreeItem(firstNodeName); |
32 | | -// while(!node.getNodes().isEmpty()) { |
33 | | -// node = node.expand().getNode(0); |
34 | | -// } |
35 | | -// return node; |
36 | | -// } |
37 | | -// } |
| 29 | + private SWTBotTreeItem getFirstResultNode() { |
| 30 | + String firstNodeName = _bot.tree().cell(0, 0); |
| 31 | + SWTBotTreeItem node = _bot.tree().getTreeItem(firstNodeName); |
| 32 | + while(!node.getNodes().isEmpty()) { |
| 33 | + node = node.expand().getNode(0); |
| 34 | + } |
| 35 | + return node; |
| 36 | + } |
| 37 | +} |
0 commit comments