JBoss Tools SVN: r26667 - trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-11-17 09:47:59 -0500 (Wed, 17 Nov 2010)
New Revision: 26667
Added:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-api-4.0.0.20101110-M4.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-ui-4.0.0.20101110-M4.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-api-4.0.0.20101110-M4.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-impl-4.0.0.20101110-M4.jar
Removed:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-api-4.0.0.20101004-M3.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-ui-4.0.0.20101004-M3.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-api-4.0.0.20101004-M3.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-impl-4.0.0.20101004-M3.jar
Log:
https://jira.jboss.org/browse/JBIDE-7624 Updated RIchFaces 4 libs
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-api-4.0.0.20101004-M3.jar
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-api-4.0.0.20101110-M4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-api-4.0.0.20101110-M4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-ui-4.0.0.20101004-M3.jar
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-ui-4.0.0.20101110-M4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-components-ui-4.0.0.20101110-M4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-api-4.0.0.20101004-M3.jar
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-api-4.0.0.20101110-M4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-api-4.0.0.20101110-M4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-impl-4.0.0.20101004-M3.jar
===================================================================
(Binary files differ)
Added: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-impl-4.0.0.20101110-M4.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/RichFaces4.0/richfaces-core-impl-4.0.0.20101110-M4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 5 months
JBoss Tools SVN: r26666 - trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-11-17 08:00:07 -0500 (Wed, 17 Nov 2010)
New Revision: 26666
Modified:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
Log:
Fix compile error
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2010-11-17 12:10:13 UTC (rev 26665)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2010-11-17 13:00:07 UTC (rev 26666)
@@ -318,7 +318,7 @@
return null;
}
- public String getQueryString() {
+ public String getEditorText() {
return null;
}
15 years, 5 months
JBoss Tools SVN: r26665 - trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-11-17 07:10:13 -0500 (Wed, 17 Nov 2010)
New Revision: 26665
Modified:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
Log:
Fix compile error
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2010-11-17 11:43:15 UTC (rev 26664)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2010-11-17 12:10:13 UTC (rev 26665)
@@ -318,6 +318,10 @@
return null;
}
+ public String getQueryString() {
+ return null;
+ }
+
public void setConsoleConfigurationName(String text) {
}
15 years, 5 months
JBoss Tools SVN: r26664 - in trunk/vpe: plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-11-17 06:43:15 -0500 (Wed, 17 Nov 2010)
New Revision: 26664
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
Log:
junit for https://jira.jboss.org/browse/JBIDE-7475, page design options handler has been fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2010-11-17 10:48:13 UTC (rev 26663)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/META-INF/MANIFEST.MF 2010-11-17 11:43:15 UTC (rev 26664)
@@ -34,6 +34,7 @@
org.jboss.tools.vpe.editor.util,
org.jboss.tools.vpe.editor.wizards,
org.jboss.tools.vpe.editor.xpl,
+ org.jboss.tools.vpe.handlers,
org.jboss.tools.vpe.messages
Require-Bundle: org.eclipse.jface.text,
org.jboss.tools.jst.jsp,
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2010-11-17 10:48:13 UTC (rev 26663)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2010-11-17 11:43:15 UTC (rev 26664)
@@ -13,11 +13,13 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.ISources;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -66,31 +68,38 @@
@Override
public void setEnabled(Object evaluationContext) {
- IEditorPart activeEditor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (activeEditor == null) {
- return;
- }
- IEditorInput input = activeEditor.getEditorInput();
- IFile file = null;
- if (input instanceof IFileEditorInput) {
- file = ((IFileEditorInput) input).getFile();
- } else if (input instanceof ILocationProvider) {
- ILocationProvider provider = (ILocationProvider) input;
- IPath path = provider.getPath(input);
- if (path != null) {
- file = FileUtil.getFile(input, path.lastSegment());
+ IEditorPart activeEditor = null;
+ if (evaluationContext instanceof IEvaluationContext) {
+ IEvaluationContext context = (IEvaluationContext) evaluationContext;
+ Object editor = context.getVariable(ISources.ACTIVE_EDITOR_NAME);
+ if(editor instanceof IEditorPart){
+ activeEditor = (IEditorPart) editor;
}
}
boolean isVisualPartVisible=false;
+ boolean isFileExists=false;
+ if (activeEditor != null) {
+
+ IEditorInput input = activeEditor.getEditorInput();
+ IFile file = null;
+ if (input instanceof IFileEditorInput) {
+ file = ((IFileEditorInput) input).getFile();
+ } else if (input instanceof ILocationProvider) {
+ ILocationProvider provider = (ILocationProvider) input;
+ IPath path = provider.getPath(input);
+ if (path != null) {
+ file = FileUtil.getFile(input, path.lastSegment());
+ isFileExists = file != null && file.exists();
+ }
+ }
+ isFileExists = file != null && file.exists();
+
if(activeEditor instanceof JSPMultiPageEditor){
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
- if(jspEditor.getVisualEditor().getController()!=null)
- isVisualPartVisible=((VpeController)(jspEditor.getVisualEditor().getController())).isVisualEditorVisible();
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ if(jspEditor.getVisualEditor().getController()!=null)
+ isVisualPartVisible=((VpeController)(jspEditor.getVisualEditor().getController())).isVisualEditorVisible();
}
-
-
- boolean isFileExists = file != null && file.exists();
+ }
boolean enabled=isFileExists&&isVisualPartVisible;
if (isEnabled() != enabled) {
setBaseEnabled(enabled);
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2010-11-17 10:48:13 UTC (rev 26663)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2010-11-17 11:43:15 UTC (rev 26664)
@@ -185,7 +185,7 @@
// TestUtil.waitForJobs();
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
- IWorkbenchPart part = page.getViewReferences()[0].getPart(false);
+ IWorkbenchPart part = page.getActivePart();
page.activate(part);
// close
page.closeAllEditors(false);
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-11-17 10:48:13 UTC (rev 26663)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-11-17 11:43:15 UTC (rev 26664)
@@ -12,11 +12,10 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-
-import org.jboss.tools.vpe.editor.menu.VpePopupMenuTest;
import org.jboss.tools.vpe.ui.test.dialog.VpeEditAnyDialogTest;
import org.jboss.tools.vpe.ui.test.dialog.VpeResourcesDialogTest;
import org.jboss.tools.vpe.ui.test.editor.CustomSashFormTest;
+import org.jboss.tools.vpe.ui.test.handlers.VpeCommandsTests;
import org.jboss.tools.vpe.ui.test.preferences.VpeEditorPreferencesPageTest;
/**
@@ -32,6 +31,7 @@
suite.addTestSuite(CustomSashFormTest.class);
//suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
+ suite.addTestSuite(VpeCommandsTests.class);
return new VpeTestSetup(suite);
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-17 11:43:15 UTC (rev 26664)
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jboss.tools.vpe.ui.test.handlers;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
+import org.jboss.tools.vpe.handlers.PageDesignOptionsHandler;
+import org.jboss.tools.vpe.handlers.PreferencesHandler;
+import org.jboss.tools.vpe.handlers.RefreshHandler;
+import org.jboss.tools.vpe.handlers.RotateEditorsHandler;
+import org.jboss.tools.vpe.handlers.ShowBorderHandler;
+import org.jboss.tools.vpe.handlers.ShowBundleAsELHandler;
+import org.jboss.tools.vpe.handlers.ShowNonVisualTagsHandler;
+import org.jboss.tools.vpe.handlers.ShowTextFormattingHandler;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.jboss.tools.vpe.ui.test.VpeUiTests;
+
+/**
+ * Class which created for testing VPE commands behavior,
+ * see https://jira.jboss.org/browse/JBIDE-7383
+ *
+ * @author mareshkau
+ *
+ */
+public class VpeCommandsTests extends VpeTest{
+
+ private static String[] VPE_COMMAND_ID;
+ private Command[] commands;
+
+ static {
+ VPE_COMMAND_ID = new String[]{
+ PageDesignOptionsHandler.COMMAND_ID,
+ PreferencesHandler.COMMAND_ID,
+ RefreshHandler.COMMAND_ID,
+ RotateEditorsHandler.COMMAND_ID,
+ ShowBorderHandler.COMMAND_ID,
+ ShowBundleAsELHandler.COMMAND_ID,
+ ShowNonVisualTagsHandler.COMMAND_ID,
+ ShowTextFormattingHandler.COMMAND_ID
+ };
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ ICommandService commandService =
+ (ICommandService) PlatformUI.getWorkbench()
+ .getService(ICommandService.class);
+ commands = new Command[VPE_COMMAND_ID.length];
+ for(int i=0;i<commands.length;i++){
+ commands[i] = commandService.getCommand(VPE_COMMAND_ID[i]);
+ }
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IViewReference[] views = page.getViewReferences();
+ for (IViewReference iViewReference : views) {
+ page.hideView(iViewReference);
+ }
+ }
+
+ public VpeCommandsTests(String name) {
+ super(name);
+ }
+
+ /**
+ * Test VPE command state
+ * @throws Throwable
+ */
+ public void testCommandState() throws Throwable {
+ //initially all commands should be disabled
+ checkCommadState(false);
+
+ IFile vpeFile = (IFile) TestUtil.getComponentPath("inputUserName.jsp",
+ VpeUiTests.IMPORT_PROJECT_NAME);
+
+ /*
+ * Open file in the VPE
+ */
+ IEditorInput input = new FileEditorInput(vpeFile);
+ JSPMultiPageEditor multiPageEditor = openEditor(input);
+ TestUtil.delay(500);
+ pageChange(multiPageEditor, 0);
+ checkCommadState(true);
+ pageChange(multiPageEditor, 1);
+ checkCommadState(false);
+ pageChange(multiPageEditor, multiPageEditor.getPreviewIndex());
+ checkCommadState(false);
+ pageChange(multiPageEditor,0);
+ checkCommadState(true);
+ }
+
+ private void pageChange(JSPMultiPageEditor multiPageEditor, int index) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+ Method pageChange;
+ pageChange = JSPMultiPageEditorPart.class.getDeclaredMethod("setActivePage", new Class[]{int.class});
+ pageChange.setAccessible(true);
+ pageChange.invoke(multiPageEditor, index);
+ multiPageEditor.pageChange(index);
+ }
+ //checks command state
+ private void checkCommadState(boolean expected){
+ for (Command vpeCommand : commands) {
+ assertEquals("Command "+vpeCommand.getId()+" should be active",expected,vpeCommand.isEnabled());
+ }
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r26663 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: model/impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-11-17 05:48:13 -0500 (Wed, 17 Nov 2010)
New Revision: 26663
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java
Log:
https://jira.jboss.org/browse/JBIDE-7623
Space added to the message
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-11-17 10:07:01 UTC (rev 26662)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-11-17 10:48:13 UTC (rev 26663)
@@ -77,7 +77,7 @@
OpenSourceAction_source_file_for_class_not_found=Source file for class ''{0}'' not found.
RefreshAction_refresh=Refresh
-ExporterDefinition_problem_creating_exporter_class=Problem while creating exporter class
+ExporterDefinition_problem_creating_exporter_class=Problem while creating exporter class {0}
ExporterFactory_output_dir_in_does_not_exist=Output directory ''{0}'' in {1} does not exist.
ExporterFactory_template_dir_in_does_not_exist=Template directory ''{0}'' in {1} does not exist.
ExporterProperty_generate_ejb3_annotations=Generate EJB3 annotations
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2010-11-17 10:07:01 UTC (rev 26662)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2010-11-17 10:48:13 UTC (rev 26663)
@@ -47,6 +47,7 @@
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -123,12 +124,15 @@
exporter = (Exporter) ReflectHelper.classForName( classname ).newInstance();
}
catch (InstantiationException e) {
- throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname);
+ throw new HibernateConsoleRuntimeException(NLS.bind(
+ HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class, classname));
}
catch (IllegalAccessException e) {
- throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname); }
+ throw new HibernateConsoleRuntimeException(NLS.bind(
+ HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class, classname)); }
catch (ClassNotFoundException e) {
- throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname);
+ throw new HibernateConsoleRuntimeException(NLS.bind(
+ HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class, classname));
}
return exporter;
15 years, 5 months
JBoss Tools SVN: r26662 - in trunk/hibernatetools: plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-11-17 05:07:01 -0500 (Wed, 17 Nov 2010)
New Revision: 26662
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
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:
https://jira.jboss.org/browse/JBIDE-7609
Fix hql-comment problems
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -111,7 +111,7 @@
public void setSession(Session s) {
super.setSession(s);
try {
- query = this.getSession().createQuery(getHQLQueryString());
+ query = this.getSession().createQuery(getQueryString());
} catch (HibernateException e) {
addException(e);
} catch (Exception e) {
@@ -126,57 +126,6 @@
return queryString; // cannot use query since it might be null because of an error!
}
- /**
- * The method removes SQL comments from <code>queryString</code>
- * as HSL doesn't support comments.
- * @return
- */
- public String getHQLQueryString(){
- StringBuilder clearHQL = new StringBuilder();
- int state = 0;
-
- for (int j = 0; j < queryString.length(); j++) {
- if ((queryString.charAt(j) == '\n')
- || ((queryString.charAt(j) == '\r')
- && (j + 1 < queryString.length())
- && (queryString.charAt(j + 1) == '\r'))) {
- state = 0;
- }
-
- switch (state) {
- case -1:// skip all till the end of the line
- break;
- case 0:// initial state
- switch (queryString.charAt(j)) {
- case '-':
- if (queryString.length() > j + 1 && queryString.charAt(j + 1) == '-') {
- state = -1;
- }
- break;
- case '\'':
- state = 1;
- break;
- }
- break;
- case 1:// quoted string
- /*
- * Escape character for the quote is doubled quote:
- * Example: 'This is escaped quote ('') inside 1 string'.
- * Our parser switches to state 0 and back to state 1, hence works correct
- * without additional efforts.
- */
- if (queryString.charAt(j) == '\'') {/*there is no way to escape it in HQL string*/
- state = 0;
- }
- break;
- }
- if (state != -1) {
- clearHQL.append(queryString.charAt(j));
- }
- }
- return clearHQL.toString();
- }
-
public void setQueryString(String queryString) {
this.queryString = queryString;
list = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -114,7 +114,7 @@
if(getEditorInput() instanceof QueryEditorInput) {
QueryEditorInput hei = (QueryEditorInput) getEditorInput();
hei.setConsoleConfigurationName( name );
- hei.setQuery( getQueryString() );
+ hei.setQuery( getEditorText() );
hei.resetName();
}
this.consoleConfigurationName = name;
@@ -150,7 +150,7 @@
QueryEditorInput hei = null;
if (getEditorInput() instanceof QueryEditorInput) {
hei = (QueryEditorInput) getEditorInput();
- hei.setQuery( getQueryString() );
+ hei.setQuery( getEditorText() );
}
IDocumentProvider p = getDocumentProvider();
if (p != null && p.isDeleted(getEditorInput())) {
@@ -175,12 +175,16 @@
super.doSetInput(input);
}
- final public String getQueryString() {
+ final public String getEditorText() {
IEditorInput editorInput = getEditorInput();
IDocumentProvider docProvider = getDocumentProvider();
IDocument doc = docProvider.getDocument( editorInput );
return doc.get();
}
+
+ public String getQueryString() {
+ return getEditorText();
+ }
/**
* Dispose of resources held by this editor.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -31,6 +31,16 @@
boolean askUserForConfiguration(String name);
+ /**
+ *
+ * @return the text typed in the editor
+ */
+ String getEditorText();
+
+ /**
+ * @return the text typed in the editor which should be executed ( without comments ).
+ * Compare with {@link #getEditorString}
+ */
String getQueryString();
QueryInputModel getQueryInputModel();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -60,7 +60,7 @@
}
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- QueryParametersPage qppage = (QueryParametersPage)pageRecord.page;
+ IQueryParametersPage qppage = (IQueryParametersPage)pageRecord.page;
qppage.dispose();
pageRecord.dispose();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -473,4 +473,55 @@
protected String getSaveAsFileExtension() {
return "*.hql"; //$NON-NLS-1$
}
+
+ /**
+ * @return the query without single line comments
+ */
+ @Override
+ public String getQueryString() {
+ String queryString = getEditorText();
+ StringBuilder clearHQL = new StringBuilder();
+ int state = 0;
+
+ for (int j = 0; j < queryString.length(); j++) {
+ if ((queryString.charAt(j) == '\n')
+ || ((queryString.charAt(j) == '\r')
+ && (j + 1 < queryString.length())
+ && (queryString.charAt(j + 1) == '\r'))) {
+ state = 0;
+ }
+
+ switch (state) {
+ case -1:// skip all till the end of the line
+ break;
+ case 0:// initial state
+ switch (queryString.charAt(j)) {
+ case '-':
+ if (queryString.length() > j + 1 && queryString.charAt(j + 1) == '-') {
+ state = -1;
+ }
+ break;
+ case '\'':
+ state = 1;
+ break;
+ }
+ break;
+ case 1:// quoted string
+ /*
+ * Escape character for the quote is doubled quote:
+ * Example: 'This is escaped quote ('') inside 1 string'.
+ * Our parser switches to state 0 and back to state 1, hence works correct
+ * without additional efforts.
+ */
+ if (queryString.charAt(j) == '\'') {/*there is no way to escape it in HQL string*/
+ state = 0;
+ }
+ break;
+ }
+ if (state != -1) {
+ clearHQL.append(queryString.charAt(j));
+ }
+ }
+ return clearHQL.toString();
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -137,7 +137,7 @@
return;
}
- final String newQuery = editor.getQueryString();
+ final String newQuery = editor.getEditorText();
final String wizard_title = NLS.bind(JdtUiMessages.SaveQueryEditorListener_refactoringtitle, editor_name);
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 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-11-17 10:07:01 UTC (rev 26662)
@@ -57,7 +57,8 @@
org.eclipse.debug.ui,
org.eclipse.datatools.connectivity.ui,
org.eclipse.datatools.connectivity,
- org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0"
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.editors
Bundle-ActivationPolicy: lazy
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 2010-11-17 09:45:49 UTC (rev 26661)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -2,15 +2,16 @@
import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsCore;
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsJpa;
import org.hibernate.eclipse.console.views.test.QueryPageViewerTest;
+import org.hibernate.eclipse.hqleditor.HQLEditorTest;
import org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePageTest;
import org.hibernate.eclipse.mapper.HBMInfoExtractorTest;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
public class ConsolePluginAllTests {
public static Test suite() throws IOException {
@@ -23,6 +24,7 @@
suite.addTestSuite(ConsoleConfigurationTest.class);
suite.addTestSuite(JavaFormattingTest.class);
suite.addTestSuite(RefactoringTest.class);
+ suite.addTestSuite(HQLEditorTest.class);
suite.addTestSuite(MappingTestsCore.class);
suite.addTestSuite(MappingTestsJpa.class);
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/HQLEditorTest.java 2010-11-17 10:07:01 UTC (rev 26662)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.hqleditor;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.IPage;
+import org.hibernate.console.QueryInputModel;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.views.QueryParametersPage;
+import org.hibernate.eclipse.console.views.QueryParametersView;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HQLEditorTest extends TestCase {
+
+ public void testHQLEditorOpen(){
+ IEditorPart editorPart = HibernateConsolePlugin.getDefault()
+ .openScratchHQLEditor(null, "");
+ assertNotNull("Editor was not opened", editorPart);
+ assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor);
+
+ HQLEditor editor = (HQLEditor)editorPart;
+ QueryInputModel model = editor.getQueryInputModel();
+ assertNotNull("Model is NULL", model);
+ }
+
+ public void testSingleLineCommentsCutOff() throws PartInitException{
+ String query = "from pack.Article a\n" +
+ "where a.articleid in (:a, :b) --or a.articleid = :c";
+ IEditorPart editorPart = HibernateConsolePlugin.getDefault()
+ .openScratchHQLEditor(null, query);
+ assertTrue("Opened editor is not HQLEditor", editorPart instanceof HQLEditor);
+
+ HQLEditor editor = (HQLEditor)editorPart;
+ assertEquals(editor.getEditorText(), query);
+ assertFalse("Comments were not cut off", editor.getQueryString().contains("--"));
+
+ QueryInputModel model = editor.getQueryInputModel();
+ assertTrue(model.getParameterCount() == 0);
+
+ IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().showView("org.hibernate.eclipse.console.views.QueryParametersView");
+ assertNotNull("View was not opened", view);
+ assertTrue("Opened view is not QueryParametersView", view instanceof QueryParametersView);
+
+ QueryParametersView paramView = (QueryParametersView)view;
+ IPage ipage = paramView.getCurrentPage();
+ assertNotNull("Current Page is NULL", ipage);
+ assertTrue("Page is not Query Parameters Page", ipage instanceof QueryParametersPage);
+
+ QueryParametersPage page = (QueryParametersPage)ipage;
+ IToolBarManager manager = page.getSite().getActionBars().getToolBarManager();
+ IContributionItem[] items = manager.getItems();
+ ActionContributionItem addParamItem = null;
+ for (int i = 0; i < items.length; i++) {
+ ActionContributionItem item = (ActionContributionItem) items[i];
+ if (item.getAction().getClass().getName().endsWith("NewRowAction")){
+ addParamItem = item;
+ break;
+ }
+ }
+ assertNotNull(HibernateConsoleMessages.QueryParametersPage_add_query_parameter_tooltip
+ + " item not found", addParamItem);
+
+ addParamItem.getAction().run();//add query parameters automatically
+ assertTrue(model.getParameterCount() == 2);//a and b
+
+ }
+
+}
15 years, 5 months
JBoss Tools SVN: r26661 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 04:45:49 -0500 (Wed, 17 Nov 2010)
New Revision: 26661
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AdaptableToDeltaCloudInstancePropertyTester.java
Log:
[JBIDE-7597] removed since not used
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AdaptableToDeltaCloudInstancePropertyTester.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AdaptableToDeltaCloudInstancePropertyTester.java 2010-11-17 09:27:41 UTC (rev 26660)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AdaptableToDeltaCloudInstancePropertyTester.java 2010-11-17 09:45:49 UTC (rev 26661)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.deltacloud.ui.commands;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
-
-/**
- * A property tester for the command framework that answers if the given
- * instance is stopped
- *
- * @author Andre Dietisheim
- */
-public class AdaptableToDeltaCloudInstancePropertyTester extends PropertyTester {
-
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- DeltaCloudInstance instance = UIUtils.adapt(receiver, DeltaCloudInstance.class);
- Boolean isAdaptableExpectedValue = (Boolean) expectedValue;
- return isAdaptableExpectedValue.equals(instance != null);
- }
-}
15 years, 5 months
JBoss Tools SVN: r26660 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 04:27:41 -0500 (Wed, 17 Nov 2010)
New Revision: 26660
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
Log:
[JBIDE-7597] corrected NPE when cloud could not be loaded
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-17 09:15:00 UTC (rev 26659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-17 09:27:41 UTC (rev 26660)
@@ -88,10 +88,10 @@
try {
instances = filter(cloud.getCurrInstances());
} catch (Exception e) {
- ErrorUtils.openErrorDialog(
- "Error",
- "Could not get instances for cloud " + cloud.getName(),
+ // TODO internationalize strings
+ ErrorUtils.openErrorDialog("Instance View Error", "Could not display instances for cloud " + cloud.getName(),
e, Display.getDefault().getActiveShell());
+ instances = new DeltaCloudInstance[]{};
}
}
}
15 years, 5 months
JBoss Tools SVN: r26659 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 04:15:00 -0500 (Wed, 17 Nov 2010)
New Revision: 26659
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
Log:
[JBIDE-7597] corrected error reporting: removed dialogs since command framework shows dialogs, corrected error messages
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -54,16 +53,9 @@
return Status.OK_STATUS;
} catch (Exception e) {
- String message = getInstanceNames(selection);
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- ErrorDialog.openError(HandlerUtil.getActiveShell(event),
- CVMessages.getString("DestroyInstancesDialogError.title"),
- CVMessages.getFormattedString("DestroyInstancesDialogError.msg", message), status);
- return status;
+ String errorMessage = CVMessages.getFormattedString("DestroyInstancesDialogError.msg",
+ getInstanceNames(selection));
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage, e);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -53,16 +52,8 @@
return Status.OK_STATUS;
} catch (Exception e) {
- String message = getInstanceNames(selection);
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- ErrorDialog.openError(HandlerUtil.getActiveShell(event),
- CVMessages.getString("RebootInstancesDialogError.title"),
- CVMessages.getFormattedString("RebootInstancesDialogError.msg", message), status);
- return status;
+ String errorMessage = CVMessages.getFormattedString("RebootInstancesDialogError.msg", getInstanceNames(selection));
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage, e);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -56,9 +56,8 @@
try {
cloud.loadChildren();
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
- e.getMessage(), e);
- return status;
+ // TODO internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load children of cloud " + cloud.getName(), e);
}
return Status.OK_STATUS;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -57,14 +57,8 @@
return Status.OK_STATUS;
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- return status;
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
}
-
}
}.schedule();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -56,9 +56,7 @@
cloud.loadChildren();
return Status.OK_STATUS;
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
- e.getMessage(), e);
- return status;
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -16,11 +16,9 @@
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.model.IHost;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
@@ -38,18 +36,14 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
DeltaCloudInstance instance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
- Shell shell = HandlerUtil.getActiveShell(event);
try {
String connectionName = RSEUtils.createConnectionName(instance);
IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance));
RSEUtils.launchRemoteSystemExplorer(instance.getName(), connectionName, host);
} catch (Exception e) {
- IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- // TODO: internationalize strings
- ErrorDialog.openError(shell, "Error",
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
"Could not launch remote system explorer for instance \"" + instance.getName() + "\"",
- status);
- return status;
+ e);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -18,7 +18,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -53,16 +52,9 @@
return Status.OK_STATUS;
} catch (Exception e) {
- String message = getInstanceNames(selection);
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- ErrorDialog.openError(HandlerUtil.getActiveShell(event),
- CVMessages.getString("StartInstancesDialogError.title"),
- CVMessages.getFormattedString("StartInstancesDialogError.msg", message), status);
- return status;
+ String errorMessage = CVMessages.getFormattedString("StartInstancesDialogError.msg",
+ getInstanceNames(selection));
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage, e);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-17 08:25:05 UTC (rev 26658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-17 09:15:00 UTC (rev 26659)
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -51,16 +50,9 @@
}
return Status.OK_STATUS;
} catch (Exception e) {
- String message = getInstanceNames(selection);
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- ErrorDialog.openError(HandlerUtil.getActiveShell(event),
- CVMessages.getString("StopInstancesDialogError.title"),
- CVMessages.getFormattedString("StopInstancesDialogError.msg", message), status);
- return status;
+ String errorMessage = CVMessages.getFormattedString("StopInstancesDialogError.msg",
+ getInstanceNames(selection));
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage, e);
}
}
15 years, 5 months
JBoss Tools SVN: r26658 - in trunk/as: plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-11-17 03:25:05 -0500 (Wed, 17 Nov 2010)
New Revision: 26658
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
Log:
JBIDE-7585 - some tests proving it does respond ;)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2010-11-17 03:43:10 UTC (rev 26657)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2010-11-17 08:25:05 UTC (rev 26658)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.as.core.util;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -24,9 +25,11 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.Server;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.tools.jmx.core.IMemento;
import org.jboss.tools.jmx.core.util.XMLMemento;
@@ -108,6 +111,11 @@
return children.get(deploymentType);
}
+ // prefs are all in "local" now, even for rse stuff.
+ public DeploymentTypePrefs getOrCreatePreferences() {
+ return getOrCreatePreferences(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ }
+
public DeploymentTypePrefs getOrCreatePreferences(String deploymentType) {
if( children.get(deploymentType) == null ) {
children.put(deploymentType,
@@ -242,4 +250,12 @@
child.putString("value", val);//$NON-NLS-1$
}
}
+
+ public static void savePreferencesToServerWorkingCopy(ServerAttributeHelper helper, DeploymentPreferences prefs) {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ DeploymentPreferenceLoader.savePreferences(bos, prefs);
+ String asXML = new String(bos.toByteArray());
+ helper.setAttribute(DeploymentPreferenceLoader.DEPLOYMENT_PREFERENCES_KEY, asXML);
+ }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2010-11-17 03:43:10 UTC (rev 26657)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2010-11-17 08:25:05 UTC (rev 26658)
@@ -12,6 +12,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.HashMap;
@@ -66,6 +67,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -772,4 +774,5 @@
}
}
}
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2010-11-17 03:43:10 UTC (rev 26657)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleDeploymentPage.java 2010-11-17 08:25:05 UTC (rev 26658)
@@ -171,10 +171,7 @@
}
public void savePreferencesToWorkingCopy() {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- DeploymentPreferenceLoader.savePreferences(bos, preferences);
- String asXML = new String(bos.toByteArray());
- getHelper().setAttribute(DeploymentPreferenceLoader.DEPLOYMENT_PREFERENCES_KEY, asXML);
+ DeploymentPreferenceLoader.savePreferencesToServerWorkingCopy(helper, preferences);
}
public String makeGlobal(String path) {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2010-11-17 03:43:10 UTC (rev 26657)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2010-11-17 08:25:05 UTC (rev 26658)
@@ -15,6 +15,12 @@
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentTypePrefs;
import org.jboss.ide.eclipse.as.test.ASTest;
import org.jboss.ide.eclipse.as.test.util.IOUtil;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
@@ -68,7 +74,47 @@
}
public void testSingleFolder() throws CoreException, IOException {
+ IPath moduleDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
final String folderName = "test";
+ moduleDeployRoot.toFile().mkdirs();
+ IModule[] mods = singleFolderCreateModules(folderName);
+ singleFolderPublishAndVerify(moduleDeployRoot, folderName, mods);
+ }
+
+ public void testSingleFolderCustomDeployFolderRelative() throws CoreException, IOException {
+ IPath serverDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
+ final String folderName = "test";
+ String relativeFolder = "something.foo";
+ IPath moduleDeployRoot = serverDeployRoot.append(relativeFolder);
+ moduleDeployRoot.toFile().mkdirs();
+ IModule[] mods = singleFolderCreateModules(folderName);
+ DeploymentPreferences prefs = DeploymentPreferenceLoader.loadPreferencesFromServer(server);
+ DeploymentModulePrefs p = prefs.getOrCreatePreferences().getOrCreateModulePrefs(mods[0]);
+ p.setProperty(IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC, relativeFolder);
+ ServerAttributeHelper helper = new ServerAttributeHelper(server, server.createWorkingCopy());
+ DeploymentPreferenceLoader.savePreferencesToServerWorkingCopy(helper, prefs);
+ server = helper.save(true, new NullProgressMonitor());
+ singleFolderPublishAndVerify(moduleDeployRoot, folderName, mods);
+ }
+
+ public void testSingleFolderCustomDeployFolderAbsolute() throws CoreException, IOException {
+ IPath serverDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
+ final String folderName = "test";
+ IPath state = ASTest.getDefault().getStateLocation();
+ IPath moduleDeployRoot = state.append("testDeployments").append("absoluteFolder.place");
+ moduleDeployRoot.toFile().mkdirs();
+ IModule[] mods = singleFolderCreateModules(folderName);
+ DeploymentPreferences prefs = DeploymentPreferenceLoader.loadPreferencesFromServer(server);
+ DeploymentModulePrefs p = prefs.getOrCreatePreferences().getOrCreateModulePrefs(mods[0]);
+ p.setProperty(IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC, moduleDeployRoot.toOSString());
+ ServerAttributeHelper helper = new ServerAttributeHelper(server, server.createWorkingCopy());
+ DeploymentPreferenceLoader.savePreferencesToServerWorkingCopy(helper, prefs);
+ server = helper.save(true, new NullProgressMonitor());
+ singleFolderPublishAndVerify(moduleDeployRoot, folderName, mods);
+ }
+
+
+ private IModule[] singleFolderCreateModules(String folderName) throws CoreException, IOException {
IFolder folder = project.getFolder(folderName);
folder.create(true, true, new NullProgressMonitor());
IOUtil.setContents(folder.getFile("1.txt"), "1");
@@ -80,25 +126,28 @@
mods = SingleDeployableFactory.getFactory().getModules();
assertEquals(mods.length, 1);
verifyPublisher(mods[0], SingleFilePublisher.class);
+ return mods;
+ }
+
+ private void singleFolderPublishAndVerify(IPath moduleDeployRoot, String folderName, IModule[] mods) throws CoreException, IOException {
server = ServerRuntimeUtils.addModule(server, mods[0]);
- IPath deployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
- deployRoot.toFile().mkdirs();
- assertEquals(IOUtil.countFiles(deployRoot.toFile()), 0);
- assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 1);
+ assertEquals(IOUtil.countFiles(moduleDeployRoot.toFile()), 0);
+ assertEquals(IOUtil.countAllResources(moduleDeployRoot.toFile()), 1);
ServerRuntimeUtils.publish(server);
- assertEquals(IOUtil.countFiles(deployRoot.toFile()), 3);
- assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 4);
- File folder2 = deployRoot.toFile().listFiles()[0];
+ assertEquals(IOUtil.countFiles(moduleDeployRoot.toFile()), 3);
+ assertEquals(IOUtil.countAllResources(moduleDeployRoot.toFile()), 4);
+ File folder2 = moduleDeployRoot.toFile().listFiles()[0];
assertTrue(folder2.getName().equals(folderName));
File[] folderChildren = folder2.listFiles();
assertTrue(folderChildren.length == 3);
File three = new File(folder2, "3.txt");
assertEquals(IOUtil.getContents(three), "3");
+ IFolder folder = project.getFolder(folderName);
IOUtil.setContents(folder.getFile("3.txt"), "3a");
ServerRuntimeUtils.publish(server);
- assertEquals(IOUtil.countFiles(deployRoot.toFile()), 3);
- assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 4);
- folder2 = deployRoot.toFile().listFiles()[0];
+ assertEquals(IOUtil.countFiles(moduleDeployRoot.toFile()), 3);
+ assertEquals(IOUtil.countAllResources(moduleDeployRoot.toFile()), 4);
+ folder2 = moduleDeployRoot.toFile().listFiles()[0];
assertTrue(folder2.getName().equals(folderName));
folderChildren = folder2.listFiles();
assertTrue(folderChildren.length == 3);
@@ -171,4 +220,5 @@
assertEquals("3a", deploy3txt2);
}
+
}
15 years, 5 months