/*
   * Method open project
   *
   */
  public void testOpenProject() throws Exception {
    File projectDir = new File(getDataDir(), "projects/" + Utils.EJB_PROJECT_NAME);
    project = (Project) J2eeProjectSupport.openProject(projectDir);
    assertNotNull("Project is null.", project);
    Thread.sleep(1000);

    EjbJarProject ejbJarProject = (EjbJarProject) project;
    ddFo = ejbJarProject.getAPIEjbJar().getDeploymentDescriptor(); // deployment descriptor
    assertNotNull("ejb-jar.xml FileObject is null.", ddFo);

    ddObj = (EjbJarMultiViewDataObject) DataObject.find(ddFo); // MultiView Editor
    assertNotNull("MultiViewDO is null.", ddObj);

    EditCookie edit = (EditCookie) ddObj.getCookie(EditCookie.class);
    edit.edit();
    Thread.sleep(1000);

    // select CustomerBean
    EnterpriseBeans beans = DDProvider.getDefault().getDDRoot(ddFo).getEnterpriseBeans();
    bean = (Entity) beans.findBeanByName(EnterpriseBeans.ENTITY, Ejb.EJB_NAME, "CustomerBean");

    ddObj.showElement(bean); // open visual editor
    Utils.waitForAWTDispatchThread();
  }
예제 #2
0
 public void closeProjects() {
   EditorOperator.closeDiscardAll();
   J2eeProjectSupport.closeProject(EAR_PROJECT_NAME);
   J2eeProjectSupport.closeProject(EJB_PROJECT_NAME);
   J2eeProjectSupport.closeProject(WEB_PROJECT_NAME);
 }