Author: dgeraskov
Date: 2008-01-21 06:24:57 -0500 (Mon, 21 Jan 2008)
New Revision: 5823
Removed:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
Log:
Removed OpenMappingTest class and package org.hibernate.eclipse.console.test.mapping as
unnessesary.
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-01-21
11:21:08 UTC (rev 5822)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-01-21
11:24:57 UTC (rev 5823)
@@ -10,7 +10,6 @@
Bundle-Vendor: Hibernate Team
Bundle-Localization: plugin
Export-Package: org.hibernate.eclipse.console.test,
- org.hibernate.eclipse.console.test.mapping,
org.hibernate.eclipse.console.test.mappingproject,
org.hibernate.eclipse.console.test.xpl
Require-Bundle: org.junit,
@@ -30,7 +29,8 @@
org.eclipse.wst.xml.ui,
org.apache.ant,
org.eclipse.ui.views,
- org.jboss.tools.hibernate.ui.view
+ org.jboss.tools.hibernate.ui.view,
+ org.eclipse.ui.editors
Eclipse-LazyStart: true
Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
Eclipse-RegisterBuddy: org.hibernate.eclipse
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-01-21
11:21:08 UTC (rev 5822)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-01-21
11:24:57 UTC (rev 5823)
@@ -18,7 +18,6 @@
suite.addTestSuite( PerspectiveTest.class );
suite.addTestSuite( ConsoleConfigurationTest.class );
suite.addTestSuite( JavaFormattingTest.class );
- suite.addTestSuite( OpenMappingTests.class );
suite.addTestSuite( HibernateAllMappingTests.class );
Deleted:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java 2008-01-21
11:21:08 UTC (rev 5822)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java 2008-01-21
11:24:57 UTC (rev 5823)
@@ -1,75 +0,0 @@
-package org.hibernate.eclipse.console.test;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.eclipse.console.actions.OpenMappingAction;
-import org.hibernate.mapping.PersistentClass;
-import org.hibernate.mapping.Property;
-
-/**
- * @author Dmitry Geraskov
- */
-
-public class OpenMappingTests extends TestCase{
-
- public static final String MAPPING_PACKAGE =
"src/org/hibernate/eclipse/console/test/mapping/";
- public static final String HIBERATE_CFG_FILE = "hibernate.cfg.xml";
- public static final String PERSON_CFG_FILE = "Person.hbm.xml";
-
- public void testParceComplexProcess() {
- IPath path_hib = new Path(MAPPING_PACKAGE+HIBERATE_CFG_FILE);
- IPath path_pers = new Path(MAPPING_PACKAGE+PERSON_CFG_FILE);
- File file_hib = path_hib.toFile();
- File file_pers = path_pers.toFile();
- if (!file_hib.exists()) {
- fail("File "+HIBERATE_CFG_FILE+" not found!");
- }
- if (!file_pers.exists()) {
- fail("File "+PERSON_CFG_FILE+" not found!");
- }
- try {
- Configuration config = new Configuration();
- config.configure(file_hib);
-
- FileReader reader = new FileReader(file_pers);
- BufferedReader in = new BufferedReader(reader);
- String s, text = "";
- while ((s = in.readLine()) != null) {
- text += s + '\n';
- }
- Document document = new Document(text);
- FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
-
- Iterator classMappings = config.getClassMappings();
- while (classMappings.hasNext()) {
- Object element = classMappings.next();
- if (element instanceof PersistentClass) {
- PersistentClass type = (PersistentClass)element;
- assertNotNull(OpenMappingAction.findSelection(type, findAdapter));
- Iterator properties = type.getPropertyIterator();
- while (properties.hasNext()) {
- Property prop = (Property) properties.next();
- if (prop.getClass() != Property.class) continue;
- assertNotNull(OpenMappingAction.findSelection(prop, findAdapter));
- }
- }
- }
- } catch (FileNotFoundException e) {
- fail("FileNotFoundException: "+ e.getMessage());
- } catch (IOException e) {
- fail("IOException: "+ e.getMessage());
- }
- }
-}
Show replies by date