package ecctest.console.smi;
import ecctest.console.AbstractConsoleTestCase;
import org.netbeans.jemmy.operators.*;
import java.util.ResourceBundle;
import java.util.Properties;
import java.io.FileInputStream;
/**
* Created by IntelliJ IDEA.
* User: tippim
* Date: Aug 29, 2006
* Time: 2:26:47 AM
* To change this template use File | Settings | File Templates.
*/
public class TestSystemDialog extends AbstractConsoleTestCase {
private JFrameOperator _testConsole=null;
private JDialogOperator systemDetails = null;
public TestSystemDialog()
{
}
public void testTreeItems()
{
try{
String sql="select hostid from host";
// start the application and login
startApplication();
_testConsole=logIn();
// get the tree
JTreeOperator tree=new JTreeOperator(_testConsole);
// check that the tree is not empty
int numNodes=tree.getChildCount(tree.getRoot());
assertTrue("There should be at least one node in tree",numNodes>0);
// select hosts from the tree.
String treeNode="Hosts";
tree.clickOnPath(tree.findPath(treeNode));
// expand and select the hosts branch of the tree
tree.expandPath(tree.findPath(treeNode));
tree.selectPath(tree.findPath(treeNode));
//pause so tht we can get the data from the database and render it.
tree.getQueueTool().waitEmpty(5000);
tree.selectPath(tree.findPath("Hosts|Windows Hosts|INENRAPOLSL1C","|"));
tree.expandPath(tree.findPath("Hosts|Windows Hosts|INENRAPOLSL1C","|"));
tree.clickOnPath(tree.findPath("Hosts|Windows Hosts|INENRAPOLSL1C"));
tree.callPopupOnPath(tree.findPath("Hosts|Windows Hosts|INENRAPOLSL1C"));
JPopupMenuOperator popup = new JPopupMenuOperator();
popup.pushMenuNoBlock("Host|Show System Details...","|");
JDialogOperator systemDetails = new JDialogOperator(_testConsole, "System Details");
systemDetails.getQueueTool().waitEmpty(1000);
assertNotNull("system details for host......",systemDetails);
//systemDetails.close();
JButtonOperator okButt = new JButtonOperator(systemDetails,"Close");
okButt.pushNoBlock();
//systemDetails.getQueueTool().waitEmpty(1000);
}
catch(Exception e) {
e.printStackTrace();
}
}
}
i want to generalize the code.
instead of finding a single window machine in path, i want to generalize it with any windows machine?
what code to change??