Author: dgeraskov
Date: 2008-01-10 08:11:06 -0500 (Thu, 10 Jan 2008)
New Revision: 5580
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1594
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
(rev 0)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-01-10
13:11:06 UTC (rev 5580)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import junit.framework.TestCase;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.actions.OpenMappingAction;
+import org.hibernate.eclipse.console.actions.OpenSourceAction;
+import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.mapping.PersistentClass;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class OpenMappingFileTest extends TestCase {
+ public void testOpenMappingFileTest(){
+ KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
+ final ConsoleConfiguration consCFG =
knownConfigurations.find(CreateConsoleConfigTest.ConsoleCFGName);
+ assertNotNull(consCFG);
+ consCFG.reset();
+ Object[] configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
+ assertTrue(configs[0] instanceof Configuration);
+ Object[] persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
+ if (persClasses.length > 0){
+ for (int i = 0; i < persClasses.length; i++) {
+ assertTrue(persClasses[0] instanceof PersistentClass);
+ PersistentClass persClass = (PersistentClass) persClasses[i];
+ OpenMappingAction.run(persClass, consCFG);
+ }
+ }
+ //close all editors
+ }
+}
Property changes on:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
(rev 0)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2008-01-10
13:11:06 UTC (rev 5580)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.execution.ExecutionContext;
+import org.hibernate.eclipse.console.actions.OpenFileActionUtils;
+import org.hibernate.eclipse.console.actions.OpenSourceAction;
+import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.mapping.PersistentClass;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class OpenSourceFileTest extends TestCase {
+
+ public void testOpenSourceFileTest(){
+ //fail("test fail");
+ KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
+ final ConsoleConfiguration consCFG =
knownConfigurations.find(CreateConsoleConfigTest.ConsoleCFGName);
+ assertNotNull(consCFG);
+ consCFG.reset();
+ Object[] configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
+ assertTrue(configs[0] instanceof Configuration);
+ Object[] persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
+ if (persClasses.length > 0){
+ for (int i = 0; i < persClasses.length; i++) {
+ assertTrue(persClasses[0] instanceof PersistentClass);
+ PersistentClass persClass = (PersistentClass) persClasses[i];
+ new OpenSourceAction().run(persClass,
MappingTestProject.getTestProject().getIJavaProject(),
+ ProjectUtil.getPersistentClassName(persClass));
+ }
+ }
+ //close all editors
+ }
+
+
+
+}
Property changes on:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native