From: <max...@us...> - 2006-02-13 15:55:46
|
Update of /cvsroot/hibernate/HibernateExt/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9525/src/org/hibernate/eclipse/console/test Modified Files: ConsolePluginAllTests.java HibernateProjectTests.java SimpleTestProject.java Added Files: ContentAssistTest.java Removed Files: PluginTest.java Log Message: fix license issues --- NEW FILE: ContentAssistTest.java --- package org.hibernate.eclipse.console.test; import org.eclipse.core.resources.ProjectScope; 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; public class ContentAssistTest extends HibernateConsoleTest { public ContentAssistTest(String name) { super( name ); } public void testEnableHibernateNature() throws BackingStoreException, CoreException { IJavaProject prj = getProject().getIJavaProject(); IScopeContext scope = new ProjectScope(prj.getProject() ); 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() ); } } Index: ConsolePluginAllTests.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ConsolePluginAllTests.java 8 Feb 2006 08:02:02 -0000 1.3 +++ ConsolePluginAllTests.java 13 Feb 2006 15:55:37 -0000 1.4 @@ -16,7 +16,6 @@ //$JUnit-BEGIN$ suite.addTestSuite( KnownConfigurationsTest.class ); suite.addTestSuite( QueryParametersTest.class ); - suite.addTestSuite( PluginTest.class ); suite.addTestSuite( PerspectiveTest.class ); suite.addTestSuite( ConsoleConfigurationTest.class ); suite.addTestSuite( JavaFormattingTest.class ); Index: HibernateProjectTests.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateProjectTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- HibernateProjectTests.java 25 Jan 2006 10:09:54 -0000 1.1 +++ HibernateProjectTests.java 13 Feb 2006 15:55:37 -0000 1.2 @@ -5,7 +5,12 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.preferences.IScopeContext; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.ide.IDE; import org.hibernate.eclipse.console.utils.ProjectUtils; +import org.hibernate.eclipse.mapper.editors.HBMXMLContentAssistProcessor; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -15,20 +20,13 @@ super( name ); } - public void testEnableHibernateNature() throws BackingStoreException, CoreException { - - IJavaProject prj = getProject().getIJavaProject(); - IScopeContext scope = new ProjectScope(prj.getProject() ); - - - Preferences node = scope.getNode("org.hibernate.eclipse.console"); + public void testContentAssist() throws BackingStoreException, CoreException { - node.putBoolean("hibernate3.enabled", true ); - node.put("default.configuration", "testcfg" ); - node.flush(); + HBMXMLContentAssistProcessor processor = new HBMXMLContentAssistProcessor(); + //IEditorPart iep = IDE.openEditor(getPage(), getProject().openFile("gpd.xml")); + ITextViewer viewer = null; - ProjectUtils.addProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); - ProjectUtils.removeProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); + ICompletionProposal[] proposals = processor.computeCompletionProposals(viewer, 0); } } \ No newline at end of file Index: SimpleTestProject.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SimpleTestProject.java 25 Jan 2006 10:09:54 -0000 1.2 +++ SimpleTestProject.java 13 Feb 2006 15:55:37 -0000 1.3 @@ -80,12 +80,8 @@ project = buildNewProject(PROJECT_NAME); javaProject = buildJavaProject(project); - IType primaryType = buildType( - buildPackage(PACKAGE_NAME, project, javaProject), FILE_NAME); - - // v2 IFile file = buildTestClass(project); - // v2 ICompilationUnit cu = (ICompilationUnit) JavaCore.create(file); - + buildType(buildPackage(PACKAGE_NAME, project, javaProject), FILE_NAME); + } private IProject buildNewProject(String projectName) { --- PluginTest.java DELETED --- |