Search in sources :

Example 1 with TestProject

use of org.jboss.tools.hibernate.orm.test.utils.project.TestProject in project jbosstools-hibernate by jbosstools.

the class HBMInfoExtractorTest method setUp.

@Before
public void setUp() throws Exception {
    // $NON-NLS-1$
    testProj = new TestProject("HBMInfoProj" + System.currentTimeMillis());
    IPackageFragmentRoot sourcePackageFragment = testProj.createSourceFolder();
    List<IPath> libs = testProj.copyLibs(testProj.getFolder("lib"));
    testProj.generateClassPath(libs, sourcePackageFragment);
    testProj.fullBuild();
    sourceLocator = new HBMInfoExtractorStub(RuntimeServiceManager.getInstance().getDefaultService());
}
Also used : TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) IPath(org.eclipse.core.runtime.IPath) IPackageFragmentRoot(org.eclipse.jdt.core.IPackageFragmentRoot) Before(org.junit.Before)

Example 2 with TestProject

use of org.jboss.tools.hibernate.orm.test.utils.project.TestProject in project jbosstools-hibernate by jbosstools.

the class MappingTestHelper method setUp.

public void setUp() throws Exception {
    testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
    String consoleConfigName = testProject.getIProject().getName();
    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());
    configureTestProject();
    createCfgXMLFile();
    copyHbmXmlAndJavaFiles();
    IPath cfgFilePath = new Path(testProject.getIProject().getName() + File.separator + TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME);
    ConsoleConfigUtils.createConsoleConfig(consoleConfigName, cfgFilePath, testProject.getIProject().getName());
    ProjectUtils.toggleHibernateOnProject(testProject.getIProject(), true, consoleConfigName);
    testProject.fullBuild();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) IPath(org.eclipse.core.runtime.IPath) PartInitException(org.eclipse.ui.PartInitException)

Example 3 with TestProject

use of org.jboss.tools.hibernate.orm.test.utils.project.TestProject in project jbosstools-hibernate by jbosstools.

the class AnnotationsMappingTestHelper method beforeClass.

public void beforeClass() throws Exception {
    testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
    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());
    IPackageFragmentRoot sourcePackageFragment = testProject.createSourceFolder();
    createCfgXMLFile();
    copyHbmXmlAndJavaFiles();
    List<IPath> libs = testProject.copyLibs(testProject.getFolder("lib"));
    testProject.generateClassPath(libs, sourcePackageFragment);
    testProject.fullBuild();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) IPath(org.eclipse.core.runtime.IPath) PartInitException(org.eclipse.ui.PartInitException) IPackageFragmentRoot(org.eclipse.jdt.core.IPackageFragmentRoot)

Example 4 with TestProject

use of org.jboss.tools.hibernate.orm.test.utils.project.TestProject in project jbosstools-hibernate by jbosstools.

the class CoreMappingTestHelper method beforeClass.

public void beforeClass() throws Exception {
    testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
    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());
    configureTestProject();
    copyHbmXmlAndJavaFiles();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) PartInitException(org.eclipse.ui.PartInitException)

Example 5 with TestProject

use of org.jboss.tools.hibernate.orm.test.utils.project.TestProject in project jbosstools-hibernate by jbosstools.

the class JpaMappingTestHelper method beforeClass.

public void beforeClass() throws Exception {
    testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
    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());
    configureTestProject();
    copyHbmXmlAndJavaFiles();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

TestProject (org.jboss.tools.hibernate.orm.test.utils.project.TestProject)5 IPackagesViewPart (org.eclipse.jdt.ui.IPackagesViewPart)4 PartInitException (org.eclipse.ui.PartInitException)4 IPath (org.eclipse.core.runtime.IPath)3 IPackageFragmentRoot (org.eclipse.jdt.core.IPackageFragmentRoot)2 Path (org.eclipse.core.runtime.Path)1 Before (org.junit.Before)1