Author: max.andersen(a)jboss.com
Date: 2008-01-17 14:21:30 -0500 (Thu, 17 Jan 2008)
New Revision: 5776
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
Log:
use standard methods for enabling hibernate
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2008-01-17
18:22:34 UTC (rev 5775)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureAddTest.java 2008-01-17
19:21:30 UTC (rev 5776)
@@ -10,17 +10,13 @@
******************************************************************************/
package org.hibernate.eclipse.console.test.mappingproject;
-import org.eclipse.core.resources.ProjectScope;
+import junit.framework.TestCase;
+
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jdt.core.IJavaProject;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-import junit.framework.TestCase;
-
/**
* @author Dmitry Geraskov
*
@@ -29,15 +25,7 @@
public void testHibernateNatureAdd() throws BackingStoreException, CoreException {
MappingTestProject project = MappingTestProject.getTestProject();
IJavaProject prj = project.getIJavaProject();
- IScopeContext scope = new ProjectScope(prj.getProject() );
- //fail("HibernateNatureAdd testfail");
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
-
- node.putBoolean("hibernate3.enabled", true );
- node.put("default.configuration", "testcfg" );
- node.flush();
-
- ProjectUtils.addProjectNature(prj.getProject(),
"org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
- //ProjectUtils.removeProjectNature(prj.getProject(),
"org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), true,
"testcfg");
}
}
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2008-01-17
18:22:34 UTC (rev 5775)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2008-01-17
19:21:30 UTC (rev 5776)
@@ -13,8 +13,6 @@
import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IJavaProject;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.osgi.service.prefs.BackingStoreException;
@@ -25,7 +23,6 @@
public class HibernateNatureRemoveTest extends TestCase {
public void testHibernateNatureRemove() throws BackingStoreException, CoreException {
MappingTestProject project = MappingTestProject.getTestProject();
- IJavaProject prj = project.getIJavaProject();
- ProjectUtils.removeProjectNature(prj.getProject(),
"org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+ ProjectUtils.toggleHibernateOnProject(project.getIProject(), true,
"testcfg");
}
}
Show replies by date