JBoss Tools SVN: r5550 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-09 07:09:45 -0500 (Wed, 09 Jan 2008)
New Revision: 5550
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/AutoLayoutAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1413
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/AutoLayoutAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/AutoLayoutAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/AutoLayoutAction.java 2008-01-09 12:09:45 UTC (rev 5550)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.ui.veditor.editors.actions;
+
+import org.eclipse.jface.action.Action;
+import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
+
+public class AutoLayoutAction extends Action {
+
+ public static final String ACTION_ID = "Auto layout";
+
+ private VisualEditor editor;
+
+ public AutoLayoutAction(VisualEditor editor) {
+ this.editor = editor;
+ setId(ACTION_ID);
+ setText(ACTION_ID);
+ //setImageDescriptor(ImageDescriptor.createFromFile(
+ // VisualEditor.class, "icons/export.png"));
+ }
+
+ public void run() {
+ editor.getViewerContents().update();
+ }
+}
17 years
JBoss Tools SVN: r5549 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors: popup and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-09 07:09:14 -0500 (Wed, 09 Jan 2008)
New Revision: 5549
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1413
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2008-01-09 11:15:39 UTC (rev 5548)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2008-01-09 12:09:14 UTC (rev 5549)
@@ -34,6 +34,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.RootClass;
+import org.jboss.tools.hibernate.ui.veditor.editors.actions.AutoLayoutAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.ExportImageAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenMappingAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenSourceAction;
@@ -106,6 +107,9 @@
action = new ExportImageAction(this);
registry.registerAction(action);
+
+ action = new AutoLayoutAction(this);
+ registry.registerAction(action);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java 2008-01-09 11:15:39 UTC (rev 5548)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java 2008-01-09 12:09:14 UTC (rev 5549)
@@ -29,6 +29,7 @@
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Table;
+import org.jboss.tools.hibernate.ui.veditor.editors.actions.AutoLayoutAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.ExportImageAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenMappingAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenSourceAction;
@@ -74,6 +75,10 @@
}
}
+ action = getActionRegistry().getAction(AutoLayoutAction.ACTION_ID);
+ appendToGroup(GEFActionConstants.GROUP_VIEW, action);
+ createMenuItem(getMenu(), action);
+
action = getActionRegistry().getAction(ExportImageAction.ACTION_ID);
appendToGroup(GEFActionConstants.MB_ADDITIONS, action);
createMenuItem(getMenu(), action);
17 years
JBoss Tools SVN: r5548 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ykryvinchanka
Date: 2008-01-09 06:15:39 -0500 (Wed, 09 Jan 2008)
New Revision: 5548
Modified:
trunk/jsf/docs/userguide/en/modules/editors_features.xml
trunk/jsf/docs/userguide/en/modules/struts_support.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-226 Screens retaken in 96 resolution + scale parameter is defined
Modified: trunk/jsf/docs/userguide/en/modules/editors_features.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors_features.xml 2008-01-09 11:13:39 UTC (rev 5547)
+++ trunk/jsf/docs/userguide/en/modules/editors_features.xml 2008-01-09 11:15:39 UTC (rev 5548)
@@ -27,7 +27,7 @@
<title>NameBean Managed Bean</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/editors_features/editors_features_1.png" scalefit="75"/>
+ <imagedata fileref="images/editors_features/editors_features_1.png" />
</imageobject>
</mediaobject>
</figure>
@@ -144,7 +144,7 @@
<title>Content Assist in JSF Configuration File</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/editors_features/editors_features_9.png"/>
+ <imagedata fileref="images/editors_features/editors_features_9.png" />
</imageobject>
</mediaobject>
</figure>
@@ -162,7 +162,7 @@
<title>Content Assist in web.xml File</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/editors_features/editors_features_11.png"/>
+ <imagedata fileref="images/editors_features/editors_features_11.png" />
</imageobject>
</mediaobject>
</figure>
@@ -222,7 +222,7 @@
<title>Content Assist in Tree JSF Configuration Editor</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/editors_features/editors_features_15.png"/>
+ <imagedata fileref="images/editors_features/editors_features_15.png" />
</imageobject>
</mediaobject>
</figure>
Modified: trunk/jsf/docs/userguide/en/modules/struts_support.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/struts_support.xml 2008-01-09 11:13:39 UTC (rev 5547)
+++ trunk/jsf/docs/userguide/en/modules/struts_support.xml 2008-01-09 11:15:39 UTC (rev 5548)
@@ -437,7 +437,7 @@
<title>Errors in Source Mode</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/struts/struts_21.png" scale="75"/>
+ <imagedata fileref="images/struts/struts_21.png" scale="83"/>
</imageobject>
</mediaobject>
</figure>
17 years
JBoss Tools SVN: r5547 - trunk/jsf/docs/userguide/en/images/editors_features.
by jbosstools-commits@lists.jboss.org
Author: ykryvinchanka
Date: 2008-01-09 06:13:39 -0500 (Wed, 09 Jan 2008)
New Revision: 5547
Modified:
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_1.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_10.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_11.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_12.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_13.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_14.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_15.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_18.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_19.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_2.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_3.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_4.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_5.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_6.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_7.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_8.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_9.png
Log:
http://jira.jboss.com/jira/browse/JBDS-226 Screens retaken in 96 resolution + scale parameter is defined
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_1.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_10.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_11.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_12.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_13.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_14.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_15.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_18.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_19.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_2.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_3.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_4.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_5.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_6.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_7.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_8.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_9.png
===================================================================
(Binary files differ)
17 years
JBoss Tools SVN: r5546 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-09 06:10:41 -0500 (Wed, 09 Jan 2008)
New Revision: 5546
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
Log:
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-09 11:10:21 UTC (rev 5545)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-09 11:10:41 UTC (rev 5546)
@@ -24,7 +24,7 @@
private static void addTestsPackSetUp(TestSuite suite){
- //suite.addTestSuite( UpdateConfigurationTest.class );
+ suite.addTestSuite( UpdateConfigurationTest.class );
}
private static void addPackTests(TestSuite suite){
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java 2008-01-09 11:10:41 UTC (rev 5546)
@@ -0,0 +1,26 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaModelException;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class UpdateConfigurationTest extends TestCase {
+
+ public void testUpdateConfiguration() throws JavaModelException{
+ //fail("test fail");
+ IPackageFragment pack = HibernateAllMappingTests.getActivePackage();
+ assertNotNull( pack );
+ try {
+ ProjectUtil.customizeCFGFileForPack(pack);
+ } catch (CoreException e) {
+ fail("Error customising " + ProjectUtil.CFG_FILE_NAME + " file for package "
+ + pack.getPath() + ".\n" + e.getMessage());
+ }
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/UpdateConfigurationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years
JBoss Tools SVN: r5545 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-09 06:10:21 -0500 (Wed, 09 Jan 2008)
New Revision: 5545
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1571
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java 2008-01-09 11:10:21 UTC (rev 5545)
@@ -0,0 +1,81 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import java.util.Iterator;
+
+import org.apache.tools.ant.filters.StringInputStream;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.hibernate.mapping.PersistentClass;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class ProjectUtil {
+
+ private static final StringBuilder XML_HEADER = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+ .append("<!DOCTYPE hibernate-configuration PUBLIC\n")
+ .append("\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n")
+ .append("\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\">\n");
+
+ private static final StringBuilder XML_CFG_START = new StringBuilder("<hibernate-configuration>\n")
+ .append("<session-factory>\n")
+ .append("<property name=\"hibernate.dialect\">\n")
+ .append("org.hibernate.dialect.SQLServerDialect</property>\n");
+
+ private static final StringBuilder XML_CFG_END = new StringBuilder("</session-factory>\n")
+ .append("</hibernate-configuration>\n");
+
+
+ public static final String CFG_FILE_NAME = "hibernate.cfg.xml";
+
+ public static void customizeCFGFileForPack(IPackageFragment pack) throws CoreException{
+ IFolder srcFolder = (IFolder) pack.getParent().getResource();
+ IFile iFile = srcFolder.getFile(CFG_FILE_NAME);
+ if (iFile.exists()) {
+ iFile.delete(true, null);
+ }
+ String file_boby = XML_HEADER.toString() + XML_CFG_START.toString();
+ if (pack.getNonJavaResources().length > 0){
+ Object[] ress = pack.getNonJavaResources();
+ for (int i = 0; i < ress.length; i++) {
+ if (ress[i] instanceof IFile){
+ IFile res = (IFile)ress[i];
+ if (res.getName().endsWith(".hbm.xml")){
+ file_boby += "<mapping resource=\"" + pack.getElementName().replace('.', '/') + '/' + res.getName() + "\"/>\n";
+ }
+ }
+ }
+ }
+ /*if (pack.getCompilationUnits().length > 0){
+ ICompilationUnit[] comps = pack.getCompilationUnits();
+ for (int i = 0; i < comps.length; i++) {
+ ICompilationUnit compilationUnit = comps[i];
+ IType[] types = compilationUnit.getTypes();
+ for (int j = 0; j < types.length; j++) {
+ IType type = types[j];
+ if (type.isAnnotation()){
+ System.out.println(type);
+ }
+ }
+ }
+ }*/
+
+ file_boby += XML_CFG_END.toString();
+ iFile.create(new StringInputStream(file_boby),
+ true, null);
+ }
+
+ public static String getPersistentClassName(PersistentClass persClass) {
+ if (persClass == null) {
+ return "";
+ } else {
+ return persClass.getEntityName() != null ? persClass.getEntityName() : persClass.getClassName();
+ }
+ }
+
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/ProjectUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years
JBoss Tools SVN: r5544 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-09 06:03:11 -0500 (Wed, 09 Jan 2008)
New Revision: 5544
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
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/TestSetAfterSetup.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
Removed:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1571
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateAllMappingTests.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -0,0 +1,182 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import java.util.Enumeration;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestFailure;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.PackageFragmentRoot;
+import org.eclipse.jdt.ui.IPackagesViewPart;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class HibernateAllMappingTests extends TestCase {
+
+ private MappingTestProject project;
+
+ private static IPackageFragment activePackage;
+
+ public HibernateAllMappingTests(String name) {
+ super(name);
+ }
+
+ private TestResult result = null;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ this.project = MappingTestProject.getTestProject();
+
+ //PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllPerspectives(false, true);
+
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
+ 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(project.getIJavaProject());
+
+ waitForJobs();
+ runTestsAfterSetup();
+ }
+
+ private void runTestsAfterSetup() {
+ TestSuite suite = TestSetAfterSetup.getTests();
+ for (int i = 0; i < suite.testCount(); i++) {
+ Test test = suite.testAt(i);
+ test.run(result);
+ /*if (result.failureCount() > 0 || result.errorCount() > 0){
+ // we have failed tests after setup
+ fail(((Throwable)result.failures().nextElement()).getMessage());
+ }*/
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#run(junit.framework.TestResult)
+ */
+ @Override
+ public void run(TestResult result) {
+ this.result = result;
+ super.run(result);
+ }
+
+ public void tearDown() throws Exception {
+ waitForJobs();
+ runTestsBeforeTearDown();
+ waitForJobs();
+ this.project.deleteIProject();
+ waitForJobs();
+ super.tearDown();
+ }
+
+ private void runTestsBeforeTearDown() {
+ TestSuite suite = TestSetBeforeTearDown.getTests();
+ for (int i = 0; i < suite.testCount(); i++) {
+ Test test = suite.testAt(i);
+ test.run(result);
+ }
+ }
+
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ protected void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ /**
+ * Wait until all background tasks are complete.
+ */
+ public void waitForJobs() {
+ while (Platform.getJobManager().currentJob() != null)
+ delay(1000);
+ }
+
+ protected MappingTestProject getProject() {
+ return this.project;
+ }
+
+ public void testEachPackWithTestSet() throws JavaModelException {
+ /*if (result.failureCount() > 0 || result.errorCount() > 0){
+ // we have failed tests after setup
+ fail("One or more setup test failed.");
+ }*/
+ TestSuite suite = TestSet.getTests();
+ IPackageFragmentRoot[] roots = project.getIJavaProject().getAllPackageFragmentRoots();
+ for (int i = 0; i < roots.length; i++) {
+ if (roots[i].getClass() != PackageFragmentRoot.class) continue;
+ PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) roots[i];
+ IJavaElement[] els = packageFragmentRoot.getChildren();//.getCompilationUnits();
+ for (int j = 0; j < els.length; j++) {
+ IJavaElement javaElement = els[j];
+ if (javaElement instanceof IPackageFragment){
+ IPackageFragment pack = (IPackageFragment) javaElement;
+ // use packages only with compilation units
+ if (pack.getCompilationUnits().length == 0) continue;
+
+ activePackage = pack;
+ //==============================
+ //run all tests for package
+ for (int k = 0; k < suite.testCount(); k++) {
+ Test test = suite.testAt(k);
+ test.run(result);
+ waitForJobs();
+ }
+ //==============================
+ }
+ }
+ }
+ waitForJobs();
+ //delay(2000);
+ }
+
+ /**
+ * @return the activePackage
+ */
+ public static IPackageFragment getActivePackage() {
+ return activePackage;
+ }
+}
+
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -0,0 +1,21 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+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;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateNatureRemoveTest extends TestCase {
+ public void testEnableHibernateNature() throws BackingStoreException, CoreException {
+ MappingTestProject project = MappingTestProject.getTestProject();
+ IJavaProject prj = project.getIJavaProject();
+ ProjectUtils.removeProjectNature(prj.getProject(), "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureRemoveTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureTest.java 2008-01-09 09:36:03 UTC (rev 5543)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HibernateNatureTest.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -1,33 +0,0 @@
-package org.hibernate.eclipse.console.test.mappingproject;
-
-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;
-
-import junit.framework.TestCase;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateNatureTest extends TestCase {
- public void testEnableHibernateNature() throws BackingStoreException, CoreException {
- MappingTestProject project = MappingTestProject.getTestProject();
- IJavaProject prj = project.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() );
- }
-}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-09 09:36:03 UTC (rev 5543)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -8,13 +8,31 @@
*/
public class TestSet{
+ /**
+ * use only addTestSuit to prevent errors!!!
+ * @return
+ */
public static TestSuite getTests(){
TestSuite suite = new TestSuite("Test for MappingTestProject" );
- //use only addTestSuit to prevent errors
- suite.addTestSuite( OpenJavaEditors.class );
- suite.addTestSuite( HibernateNatureTest.class );
+
+ addTestsPackSetUp( suite );
+ addPackTests( suite );
+ addTestsPackTearDown( suite );
return suite;
}
+
+
+ private static void addTestsPackSetUp(TestSuite suite){
+ //suite.addTestSuite( UpdateConfigurationTest.class );
+ }
+
+ private static void addPackTests(TestSuite suite){
+
+ }
+
+ private static void addTestsPackTearDown(TestSuite suite){
+ //suite.addTestSuite( CloaseAllEditorsTest.class );
+ }
}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -0,0 +1,16 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import junit.framework.TestSuite;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class TestSetAfterSetup {
+ public static TestSuite getTests(){
+ TestSuite suite = new TestSuite("Test for MappingTestProject" );
+ suite.addTestSuite( HibernateNatureAddTest.class );
+ //suite.addTestSuite( CreateConsoleConfigTest.class );
+ return suite;
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetAfterSetup.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/TestSetBeforeTearDown.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java 2008-01-09 11:03:11 UTC (rev 5544)
@@ -0,0 +1,16 @@
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import junit.framework.TestSuite;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class TestSetBeforeTearDown {
+ public static TestSuite getTests(){
+ TestSuite suite = new TestSuite("Test for MappingTestProject" );
+ suite.addTestSuite( HibernateNatureRemoveTest.class );
+
+ return suite;
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSetBeforeTearDown.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years
JBoss Tools SVN: r5543 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-09 04:36:03 -0500 (Wed, 09 Jan 2008)
New Revision: 5543
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
close editors before removing of project
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-01-09 09:35:07 UTC (rev 5542)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-01-09 09:36:03 UTC (rev 5543)
@@ -98,13 +98,18 @@
protected void tearDown() throws Exception {
super.tearDown();
+
+ closeEditors();
+
TestUtil.removeProject(getImportProjectName());
Platform.removeLogListener(this);
-
- closeEditors();
+
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ILogListener#logging(org.eclipse.core.runtime.IStatus, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.ILogListener#logging(org.eclipse.core.runtime.IStatus,
+ * java.lang.String)
*/
public void logging(IStatus status, String plugin) {
switch (status.getSeverity()) {
17 years
JBoss Tools SVN: r5542 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-09 04:35:07 -0500 (Wed, 09 Jan 2008)
New Revision: 5542
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java
Log:
update junit
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java 2008-01-09 09:34:47 UTC (rev 5541)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfJbideTest.java 2008-01-09 09:35:07 UTC (rev 5542)
@@ -72,7 +72,7 @@
// get test page path
IFile file = (IFile) TestUtil
- .getComponentPath("JBIDE/JBIDE-1467/JBIDE-1467.jsp",getImportProjectName());
+ .getComponentPath("JBIDE/1467/JBIDE-1467.jsp",getImportProjectName());
assertNotNull("Could not open specified file "+file.getFullPath(), file);
17 years
JBoss Tools SVN: r5541 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE: 1467 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-09 04:34:47 -0500 (Wed, 09 Jan 2008)
New Revision: 5541
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1467/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1467/JBIDE-1467.jsp
Log:
update junit
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1467/JBIDE-1467.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1467/JBIDE-1467.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1467/JBIDE-1467.jsp 2008-01-09 09:34:47 UTC (rev 5541)
@@ -0,0 +1,22 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<html>
+<head>
+</head>
+<body>
+
+<f:view>
+
+ <h:selectOneRadio>
+
+ <f:selectItem itemLabel="value1" />
+ <f:selectItem itemLabel="value2" />
+ <f:selectItem itemLabel="value3" />
+ <f:selectItem itemLabel="value4" />
+
+ </h:selectOneRadio>
+
+</f:view>
+</body>
+</html>
\ No newline at end of file
17 years