Exemplo n.º 1
0
  @Test
  public void getChild() {
    packageExplorer
        .getProject(ProjectItemTest.PROJECT_NAME)
        .getProjectItem(ProjectItemTest.PROJECT_ITEM_TEXT)
        .select();

    final String javaClassName = "TestClass";
    createJavaClass(javaClassName);

    ProjectItem piDefaultPackage =
        packageExplorer
            .getProject(ProjectItemTest.PROJECT_NAME)
            .getProjectItem(ProjectItemTest.PROJECT_ITEM_TEXT)
            .getChild(ProjectItemTest.DEFAULT_PACKAGE_TEXT);

    assertTrue(
        "Found Project Item has to have text "
            + ProjectItemTest.DEFAULT_PACKAGE_TEXT
            + " but is "
            + piDefaultPackage.getText(),
        piDefaultPackage.getText().equals(ProjectItemTest.DEFAULT_PACKAGE_TEXT));

    /* select default package */
    piDefaultPackage.select();
    assertTrue(
        "Project item " + ProjectItemTest.DEFAULT_PACKAGE_TEXT + " is not selected",
        piDefaultPackage.isSelected());
  }
Exemplo n.º 2
0
 @Test
 public void select() {
   projectItem.select();
   assertTrue(
       "Project item " + ProjectItemTest.PROJECT_ITEM_TEXT + " is not selected",
       projectItem.isSelected());
 }