Search in sources :

Example 1 with ConfigurableTestProject

use of org.hibernate.eclipse.console.test.project.ConfigurableTestProject in project jbosstools-hibernate by jbosstools.

the class MappingTestsBase method setUp.

protected void setUp() throws Exception {
    super.setUp();
    // $NON-NLS-1$
    testProject = new ConfigurableTestProject("JUnitTestProj" + System.currentTimeMillis());
    consoleConfigName = testProject.getIProject().getName();
    testPackage = null;
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(// $NON-NLS-1$
    PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective"));
    IPackagesViewPart packageExplorer = null;
    try {
        packageExplorer = (IPackagesViewPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(JavaUI.ID_PACKAGES);
    } catch (PartInitException e) {
        throw new RuntimeException(e);
    }
    packageExplorer.selectAndReveal(testProject.getIJavaProject());
    // PlatformUI.getWorkbench()
    // .getActiveWorkbenchWindow().getActivePage().setPerspective(
    // PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(HibernateConsolePerspectiveFactory.ID_CONSOLE_PERSPECTIVE));
    setUpConsoleConfig();
    ProjectUtils.toggleHibernateOnProject(testProject.getIProject(), true, consoleConfigName);
    testProject.fullBuild();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) PartInitException(org.eclipse.ui.PartInitException) ConfigurableTestProject(org.hibernate.eclipse.console.test.project.ConfigurableTestProject)

Aggregations

IPackagesViewPart (org.eclipse.jdt.ui.IPackagesViewPart)1 PartInitException (org.eclipse.ui.PartInitException)1 ConfigurableTestProject (org.hibernate.eclipse.console.test.project.ConfigurableTestProject)1