JBoss Tools SVN: r8864 - in trunk/esb/plugins/org.jboss.tools.esb.core/resources: meta and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-20 06:58:15 -0400 (Fri, 20 Jun 2008)
New Revision: 8864
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
JBIDE-2022
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2008-06-20 10:27:13 UTC (rev 8863)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb.properties 2008-06-20 10:58:15 UTC (rev 8864)
@@ -386,3 +386,91 @@
ESBActivationConfig101_AddProperty.Title=ESB Property
ESBActivationConfig101_Properties.Title=ESB Activation Config
+
+# Actions extension
+
+ESBPreActionContentBasedRouter101_AddRouteTo.WindowTitle=Add Route To
+ESBPreActionContentBasedRouter101_AddRouteTo.Title=ESB Route To
+
+ESBPreActionNotifier101_AddNotificationList.WindowTitle=Add Notification List
+ESBPreActionNotifier101_AddNotificationList.Title=ESB Notification List
+
+ESBPreActionSOAPClient101_AddProperty.WindowTitle=Add Property
+ESBPreActionSOAPClient101_AddProperty.Title=ESB Property
+
+ESBPreActionStaticRouter101_AddRouteTo.WindowTitle=Add Route To
+ESBPreActionStaticRouter101_AddRouteTo.Title=ESB Route To
+
+ESBPreActionStaticWiretap101_AddRouteTo.WindowTitle=Add Route To
+ESBPreActionStaticWiretap101_AddRouteTo.Title=ESB Route To
+
+ESBPreActionXStreamToObject101_AddAlias.WindowTitle=Add Alias
+ESBPreActionXStreamToObject101_AddAlias.Title=ESB Alias
+
+ESBPreAlias_Properties.Title=ESB Alias
+
+ESBPreNotificationList_CreateTarget.WindowTitle=Add Target
+ESBPreNotificationList_CreateTarget.Title=ESB Target
+
+ESBPreNotificationList_Properties.Title=ESB Notification List
+
+ESBPreRouteTo_Properties.Title=ESB Route To
+ESBPreTarget_CreateTag.WindowTitle=Add Tag
+
+ESBPreTarget_CreateTag.Title=XML Element
+
+ESBPreTarget_Properties.Title=ESB Target
+
+ESBActions101_AddByteArrayToString.WindowTitle=Add Byte Array To String
+ESBActions101_AddByteArrayToString.Title=ESB Byte Array To String Converter
+
+ESBActions101_AddLongToDate.WindowTitle=Add Long To Date
+ESBActions101_AddLongToDate.Title=ESB Long To Date Converter
+
+ESBActions101_AddObjectToCSVString.WindowTitle=Add Object To CSV String
+ESBActions101_AddObjectToCSVString.Title=ESB Action Object To CSVString Converter
+
+ESBActions101_AddObjectToXStream.WindowTitle=Add Object To XStream
+ESBActions101_AddObjectToXStream.Title=ESB Object To XStream Converter
+
+ESBActions101_AddSmooksTransformer.WindowTitle=Add Smooks Transformer
+ESBActions101_AddSmooksTransformer.Title=ESB Smooks Transformer
+
+ESBActions101_AddMessagePersister.WindowTitle=Add Message Persister
+ESBActions101_AddMessagePersister.Title=ESB Message Persister
+
+ESBActions101_AddXStreamToObject.WindowTitle=Add XStream To Object
+ESBActions101_AddXStreamToObject.Title=ESB XStream To Object Converter
+
+ESBActions101_AddAggregator.WindowTitle=Add Aggregator
+ESBActions101_AddAggregator.Title=ESB Aggregator
+
+ESBActions101_AddContentBasedRouter.WindowTitle=Add Content Based Router
+ESBActions101_AddContentBasedRouter.Title=ESB Content Based Router
+
+ESBActions101_AddStaticRouter.WindowTitle=Add Static Router
+ESBActions101_AddStaticRouter.Title=ESB Static Router
+
+ESBActions101_AddStaticWiretap.WindowTitle=Add Static Wiretap
+ESBActions101_AddStaticWiretap.Title=ESB Static Wiretap
+
+ESBActions101_AddNotifier.WindowTitle=Add Notifier
+ESBActions101_AddNotifier.Title=ESB Notifier
+
+ESBActions101_SOAPProcessor.WindowTitle=Add SOAP Processor
+ESBActions101_SOAPProcessor.Title=SOAP Processor
+
+ESBActions101_SOAPClient.WindowTitle=Add SOAP Client
+ESBActions101_SOAPClient.Title=SOAP Client
+
+ESBActions101_AddObjectInvoke.WindowTitle=Add Object Invoke
+ESBActions101_AddObjectInvoke.Title=ESB Object Invoke
+
+ESBActions101_AddCommandInterpreter.WindowTitle=Add Command Interpreter
+ESBActions101_AddCommandInterpreter.Title=ESB Command Interpreter
+
+ESBActions101_AddGroovyProcessor.WindowTitle=Add Groovy Action Processor
+ESBActions101_AddGroovyProcessor.Title=ESB Groovy Action Processor
+
+ESBActions101_AddSystemPrintln.WindowTitle=Add System Println
+ESBActions101_AddSystemPrintln.Title=ESB System Println
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2008-06-20 10:27:13 UTC (rev 8863)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2008-06-20 10:58:15 UTC (rev 8864)
@@ -1265,7 +1265,7 @@
<XActionItem displayName="SOAP" kind="list" name="SOAP">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="SOAP Processor..." kind="action" name="SOAPProcessor">
+ displayName="SOAP Processor..." kind="action" name="AddSOAPProcessor">
<EntityData EntityName="ESBPreActionSOAPProcessor101">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="jbossws endpoint"/>
@@ -1273,7 +1273,7 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="SOAP Client..." kind="action" name="SOAPClient">
+ displayName="SOAP Client..." kind="action" name="AddSOAPClient">
<EntityData EntityName="ESBPreActionSOAPClient101">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="wsdl"/>
15 years, 11 months
JBoss Tools SVN: r8863 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-20 06:27:13 -0400 (Fri, 20 Jun 2008)
New Revision: 8863
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2227 CA shows useless proposals when we editing style for h:output text in seam project
The constants to be used in the tests are moved to the aprepriate testcase.
The changes related to the issue are rolled back
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-06-20 10:18:00 UTC (rev 8862)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-06-20 10:27:13 UTC (rev 8863)
@@ -71,9 +71,6 @@
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
private static final IContextInformation[] NO_CONTEXTS= new IContextInformation[0];
- public static final String EL_END_EXPRESSION = "}";
- public static final String EL_START_EXPRESSION = "#{";
-
public static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4 {
private final String fString;
15 years, 11 months
JBoss Tools SVN: r8862 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-20 06:18:00 -0400 (Fri, 20 Jun 2008)
New Revision: 8862
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2277 CA proposals for jsf variables and seam variables is different
TestCase is fixed
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java 2008-06-20 10:16:24 UTC (rev 8861)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java 2008-06-20 10:18:00 UTC (rev 8862)
@@ -24,6 +24,10 @@
public class JBide2277Test extends CommonContentAssistantTestCase {
protected static final String JBIDE_2277_PAGE="/WebContent/jbide2277/jbide2277.xhtml";
+ public static final String EL_END_EXPRESSION = "}";
+ public static final String EL_START_EXPRESSION = "#{";
+
+
public static Test suite() {
return new TestSuite(JBide2277Test.class);
}
@@ -51,7 +55,7 @@
String prevDisplay = "";
for (ICompletionProposal p : rst) {
//Check stars with #{
- assertTrue(p.getDisplayString().startsWith(SeamELProposalProcessor.EL_START_EXPRESSION));
+ assertTrue(p.getDisplayString().startsWith(EL_START_EXPRESSION));
//Check alphabetical order
15 years, 11 months
JBoss Tools SVN: r8861 - branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-20 06:16:24 -0400 (Fri, 20 Jun 2008)
New Revision: 8861
Modified:
branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2277 CA proposals for jsf variables and seam variables is different
TestCase is fixed
Modified: branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java
===================================================================
--- branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java 2008-06-20 09:23:02 UTC (rev 8860)
+++ branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/jbide/JBide2277Test.java 2008-06-20 10:16:24 UTC (rev 8861)
@@ -24,6 +24,10 @@
public class JBide2277Test extends CommonContentAssistantTestCase {
protected static final String JBIDE_2277_PAGE="/WebContent/jbide2277/jbide2277.xhtml";
+ public static final String EL_END_EXPRESSION = "}";
+ public static final String EL_START_EXPRESSION = "#{";
+
+
public static Test suite() {
return new TestSuite(JBide2277Test.class);
}
@@ -51,7 +55,7 @@
String prevDisplay = "";
for (ICompletionProposal p : rst) {
//Check stars with #{
- assertTrue(p.getDisplayString().startsWith(SeamELProposalProcessor.EL_START_EXPRESSION));
+ assertTrue(p.getDisplayString().startsWith(EL_START_EXPRESSION));
//Check alphabetical order
15 years, 11 months
JBoss Tools SVN: r8860 - branches/jbosstools-2.1.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-06-20 05:23:02 -0400 (Fri, 20 Jun 2008)
New Revision: 8860
Modified:
branches/jbosstools-2.1.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2250
Modified: branches/jbosstools-2.1.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
===================================================================
--- branches/jbosstools-2.1.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2008-06-20 08:33:37 UTC (rev 8859)
+++ branches/jbosstools-2.1.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2008-06-20 09:23:02 UTC (rev 8860)
@@ -10,10 +10,15 @@
******************************************************************************/
package org.hibernate.eclipse.launch.core.refactoring;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
@@ -71,7 +76,25 @@
* @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
*/
public Change perform(IProgressMonitor pm) throws CoreException {
- fLaunchConfiguration = HibernateRefactoringUtil.updateLaunchConfig(fLaunchConfiguration, fOldPath, fNewPath);
+ if (!fLaunchConfiguration.exists()){
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IWorkspaceRoot root = workspace.getRoot();
+ IPath rootLoacation = root.getLocation();
+ IPath oldConfigLocation = fLaunchConfiguration.getLocation();
+ int matchSegment = oldConfigLocation.matchingFirstSegments(rootLoacation);
+ IPath relativePath = oldConfigLocation.removeFirstSegments(matchSegment);
+ relativePath = relativePath.setDevice(null).makeAbsolute();
+
+ if (HibernateRefactoringUtil.isAttributeChanged(relativePath.toOSString(), fOldPath)){
+ matchSegment = relativePath.matchingFirstSegments(fOldPath);
+ IPath newLaunchPath = fNewPath.append(relativePath.removeFirstSegments(matchSegment));
+ IFile[] files = root.findFilesForLocation(rootLoacation.append(newLaunchPath));
+ if (files.length > 0){
+ fLaunchConfiguration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(files[0]);
+ }
+ }
+ }
+ fLaunchConfiguration = HibernateRefactoringUtil.updateLaunchConfig(fLaunchConfiguration, fOldPath, fNewPath);
return new LaunchConfigurationResourceNameChange(fLaunchConfiguration, fNewPath, fOldPath);
}
}
15 years, 11 months
JBoss Tools SVN: r8859 - trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-20 04:33:37 -0400 (Fri, 20 Jun 2008)
New Revision: 8859
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
Log:
JBIDE-2387: code refactor
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2008-06-20 06:34:33 UTC (rev 8858)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2008-06-20 08:33:37 UTC (rev 8859)
@@ -66,18 +66,10 @@
command += " -k " + args + " " + model.getWsdlURI();
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(command, null, new File(commandLocation));
- InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
- LineNumberReader input = new LineNumberReader(ir);
- String str = input.readLine();
- StringBuffer result = new StringBuffer();
- while(str != null){
- result.append(str).append("\t\r");
- str = input.readLine();
-
- }
int exitValue = proc.waitFor();
+
if(exitValue != 0){
- return StatusUtils.errorStatus(result.toString());
+ return StatusUtils.errorStatus(convertInputStreamToString(proc.getErrorStream()));
}
// log the result of the command execution
15 years, 11 months
JBoss Tools SVN: r8858 - in trunk/ws: plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-06-20 02:34:33 -0400 (Fri, 20 Jun 2008)
New Revision: 8858
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/preferences/JbossWSRuntimePreferencePageTest.java
Log:
JBIDE-2323: add test for preference page
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java 2008-06-20 04:36:13 UTC (rev 8857)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeManager.java 2008-06-20 06:34:33 UTC (rev 8858)
@@ -43,13 +43,7 @@
* Private constructor
*/
private JbossWSRuntimeManager() {
- IPreferenceStore ps = JbossWSCorePlugin.getDefault()
- .getPreferenceStore();
-
- String runtimeListString = ps
- .getString(JbossWSCoreMessages.WS_Location);
-
- runtimes = converter.getMap(runtimeListString);
+ load();
}
/**
@@ -111,7 +105,8 @@
* @param defaultRt
* boolean - default flag
*/
- public void addRuntime(String name, String path, String version, boolean defaultRt) {
+ public void addRuntime(String name, String path, String version,
+ boolean defaultRt) {
JbossWSRuntime jbossWSRt = new JbossWSRuntime();
jbossWSRt.setHomeDir(path);
jbossWSRt.setName(name);
@@ -277,7 +272,8 @@
for (IFacetedProject facetedProject : facetedProjects) {
QualifiedName qRuntimeName = IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME;
try {
- if(name.equals(facetedProject.getProject().getPersistentProperty(qRuntimeName))){
+ if (name.equals(facetedProject.getProject()
+ .getPersistentProperty(qRuntimeName))) {
return true;
}
} catch (CoreException e) {
@@ -287,4 +283,14 @@
return false;
}
+ public void load() {
+ IPreferenceStore ps = JbossWSCorePlugin.getDefault()
+ .getPreferenceStore();
+
+ String runtimeListString = ps
+ .getString(JbossWSCoreMessages.WS_Location);
+
+ runtimes = converter.getMap(runtimeListString);
+ }
+
}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-20 04:36:13 UTC (rev 8857)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-20 06:34:33 UTC (rev 8858)
@@ -200,10 +200,11 @@
TableColumn tc2 = new TableColumn(tableView.getTable(), SWT.LEFT);
tc2.setWidth(TC_NAME_WIDTH);
tc2.setText(JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Name);
-
+
TableColumn tc3 = new TableColumn(tableView.getTable(), SWT.LEFT);
tc3.setWidth(TC_VERSION_WIDTH);
- tc3.setText(JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Version);
+ tc3
+ .setText(JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Version);
TableColumn tc4 = new TableColumn(tableView.getTable(), SWT.LEFT);
tc4.setWidth(TC_PATH_WIDTH);
@@ -345,7 +346,7 @@
break;
}
}
- if (!checked) {
+ if (!checked && runtimes.size() > 0) {
if (tableView.getCheckedElements() == null
|| tableView.getCheckedElements().length == 0) {
tableView.setChecked(runtimes.get(0), true);
@@ -409,7 +410,7 @@
private static final String SRT_NAME = "name";
private static final String SRT_VERSION = "version";
private static final String SRT_HOMEDIR = "homeDir";
-
+
private static final int GL_PARENT_COLUMNS = 1;
private static final int GL_CONTENT_COLUMNS = 3;
@@ -421,14 +422,13 @@
IFieldEditor version = createTextEditor(SRT_VERSION,
JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Version, ""); //$NON-NLS-1$
-
IFieldEditor homeDir = createBrowseFolderEditor(
SRT_HOMEDIR,
JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Home_Folder,
""); //$NON-NLS-1$
JbossWSRuntime current = null;
-
+
IFieldEditor jars = null;
public JbossWSRuntimeWizardPage(List<JbossWSRuntime> editedList) {
@@ -461,15 +461,13 @@
version.addPropertyChangeListener(this);
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
-
- jars = new JbwsLibraryListFieldEditor("", "",
- current);
+
+ jars = new JbwsLibraryListFieldEditor("", "", current);
jars.doFillIntoGrid(root);
jars.addPropertyChangeListener(this);
setPageComplete(false);
setControl(root);
}
-
/**
* Process evt: setup default values based on JbossWS Home folder and
@@ -518,22 +516,23 @@
}
}
- JbossWSRuntime jarJbws = (JbossWSRuntime)jars.getValue();
+ JbossWSRuntime jarJbws = (JbossWSRuntime) jars.getValue();
if (current != null
&& current.getName().equals(name.getValueAsString())
&& current.getHomeDir().equals(homeDir.getValueAsString())
&& current.getVersion().equals(version.getValueAsString())
- && current.isUserConfigClasspath() == jarJbws.isUserConfigClasspath()
- && (!jarJbws.isUserConfigClasspath()
- || hasSameLibraies(current.getLibraries(), jarJbws.getLibraries()))) {
-
+ && current.isUserConfigClasspath() == jarJbws
+ .isUserConfigClasspath()
+ && (!jarJbws.isUserConfigClasspath() || hasSameLibraies(
+ current.getLibraries(), jarJbws.getLibraries()))) {
+
setErrorMessage(null);
setPageComplete(false);
return;
}
-
- if(jarJbws.isUserConfigClasspath()
- && jarJbws.getLibraries().size() == 0){
+
+ if (jarJbws.isUserConfigClasspath()
+ && jarJbws.getLibraries().size() == 0) {
setErrorMessage("The library must contian at least one jar.");
setPageComplete(false);
return;
@@ -556,14 +555,17 @@
setPageComplete(true);
}
- private boolean hasSameLibraies(List<String> lib1, List<String> lib2){
- if(lib1.size() != lib2.size()) return false;
- for(String jar: lib1){
- if(!lib2.contains(jar)) return false;
+ private boolean hasSameLibraies(List<String> lib1, List<String> lib2) {
+ if (lib1.size() != lib2.size())
+ return false;
+ for (String jar : lib1) {
+ if (!lib2.contains(jar))
+ return false;
}
-
+
return true;
}
+
/**
* Return JbossWS Runtime instance initialized by user input
*
@@ -574,7 +576,7 @@
newRt.setName(name.getValueAsString());
newRt.setVersion(version.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
- JbossWSRuntime rt = (JbossWSRuntime)jars.getValue();
+ JbossWSRuntime rt = (JbossWSRuntime) jars.getValue();
newRt.setLibraries(rt.getLibraries());
newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
return newRt;
@@ -605,8 +607,6 @@
return editor;
}
-
-
public ButtonFieldEditor.ButtonPressedAction createSelectFolderAction(
String buttonName) {
return new ButtonFieldEditor.ButtonPressedAction(buttonName) {
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2008-06-20 04:36:13 UTC (rev 8857)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/META-INF/MANIFEST.MF 2008-06-20 06:34:33 UTC (rev 8858)
@@ -8,5 +8,6 @@
org.eclipse.core.runtime,
org.junit,
org.jboss.tools.tests,
- org.jboss.tools.ws.ui
+ org.jboss.tools.ws.ui,
+ org.jboss.tools.ws.core
Eclipse-LazyStart: true
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/preferences/JbossWSRuntimePreferencePageTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/preferences/JbossWSRuntimePreferencePageTest.java 2008-06-20 04:36:13 UTC (rev 8857)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.test/src/org/jboss/tools/ws/ui/test/preferences/JbossWSRuntimePreferencePageTest.java 2008-06-20 06:34:33 UTC (rev 8858)
@@ -7,12 +7,24 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.ui.test.preferences;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceDialog;
import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntimeListConverter;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntimeManager;
+import org.jboss.tools.ws.core.messages.JbossWSCoreMessages;
+import org.jboss.tools.ws.ui.preferences.JbossRuntimeListFieldEditor;
import org.jboss.tools.ws.ui.preferences.JbossWSRuntimePreferencePage;
import junit.framework.TestCase;
@@ -21,23 +33,121 @@
* @author Grid Qian
*/
public class JbossWSRuntimePreferencePageTest extends TestCase {
-
+
/**
* Test that preference page is showed up without errors
*/
- public void testShowSeamPreferencePage() {
-
- PreferenceDialog prefDialog =
- WorkbenchUtils.createPreferenceDialog("org.jboss.tools.ws.ui.preferences.JbossWSRuntimePreferencePage");
+ public void testShowJbossWSRuntimePreferencePage() {
+ PreferenceDialog prefDialog = WorkbenchUtils
+ .createPreferenceDialog("org.jboss.tools.ws.ui.preferences.JbossWSRuntimePreferencePage");
try {
- prefDialog.setBlockOnOpen(false);
- prefDialog.open();
-
- Object selectedPage = prefDialog.getSelectedPage();
- assertTrue("Selected page is not an instance of JbossWSRuntimePreferencePage", selectedPage instanceof JbossWSRuntimePreferencePage);
+ Object object = openPreferencepage(prefDialog);
+ assertTrue(
+ "Selected page is not an instance of JbossWSRuntimePreferencePage",
+ object instanceof JbossWSRuntimePreferencePage);
} finally {
prefDialog.close();
}
}
+
+ private Object openPreferencepage(PreferenceDialog prefDialog) {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+ return prefDialog.getSelectedPage();
+ }
+
+ /**
+ * Test correct contents in that preference page
+ */
+ @SuppressWarnings("unchecked")
+ public void testDisplayJbossWSRuntimePreferencePage() {
+ PreferenceDialog prefDialog = WorkbenchUtils
+ .createPreferenceDialog("org.jboss.tools.ws.ui.preferences.JbossWSRuntimePreferencePage");
+ JbossWSRuntimePreferencePage selectedPage = null;
+ try {
+ Object object = openPreferencepage(prefDialog);
+ String runtime = getRuntimeList();
+ selectedPage = (JbossWSRuntimePreferencePage) object;
+ JbossRuntimeListFieldEditor jbossWSRuntimes = selectedPage
+ .getJbossWSRuntimes();
+ if (runtime.equals("")) {
+ assertTrue(
+ "The JBoss Ws Runtime locations are not displayed",
+ ((ArrayList<JbossWSRuntime>) jbossWSRuntimes.getValue())
+ .size() == 0);
+ } else {
+ JbossWSRuntimeListConverter converter = new JbossWSRuntimeListConverter();
+ Map<String, JbossWSRuntime> runtimes = converter
+ .getMap(runtime);
+ assertTrue(
+ "The JBoss Ws Runtime locations are not displayed",
+ runtimes.values().size() == ((ArrayList<JbossWSRuntime>) jbossWSRuntimes
+ .getValue()).size());
+ }
+ } finally {
+ prefDialog.close();
+ }
+
+ }
+
+ /**
+ * Set and Test correct contents in that preference page
+ */
+ @SuppressWarnings("unchecked")
+ public void testSetAndDisplayJbossWSRuntimePreferencePage() {
+ setRuntimeList();
+ PreferenceDialog prefDialog = WorkbenchUtils
+ .createPreferenceDialog("org.jboss.tools.ws.ui.preferences.JbossWSRuntimePreferencePage");
+ JbossWSRuntimePreferencePage selectedPage = null;
+ try {
+ Object object = openPreferencepage(prefDialog);
+ String runtime = getRuntimeList();
+ selectedPage = (JbossWSRuntimePreferencePage) object;
+ JbossRuntimeListFieldEditor jbossWSRuntimes = selectedPage
+ .getJbossWSRuntimes();
+ assertTrue("The preference store for jboss ws runtime is wrong",
+ !runtime.equals(""));
+ JbossWSRuntimeListConverter converter = new JbossWSRuntimeListConverter();
+ Map<String, JbossWSRuntime> runtimes = converter.getMap(runtime);
+ assertTrue(
+ "The JBoss Ws Runtime locations are not displayed correctly",
+ runtimes.values().size() == ((ArrayList<JbossWSRuntime>) jbossWSRuntimes
+ .getValue()).size());
+ } finally {
+ prefDialog.close();
+ }
+
+ }
+
+ private void setRuntimeList() {
+ String jbosshome = System.getProperty("jbosstools.test.jboss.home.4.2",
+ "/home/grid/Software/jboss-4.2.2.GA");
+ String runtime = "name|jboss-4.2.2.GA|version|2.0|homeDir|" + jbosshome
+ + "|default|false|userConfig|true|libraries|" + jbosshome
+ + "/lib/commons-codec.jar,name|jboss|version|2.0|homeDir|"
+ + jbosshome + "|default|true|userConfig|false|libraries|";
+ JbossWSCorePlugin.getDefault().getPreferenceStore().setValue(
+ JbossWSCoreMessages.WS_Location, runtime);
+ IPreferenceStore store = JbossWSCorePlugin.getDefault()
+ .getPreferenceStore();
+ if (store instanceof IPersistentPreferenceStore) {
+ try {
+ ((IPersistentPreferenceStore) store).save();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ JbossWSRuntimeManager.getInstance().load();
+
+ }
+
+ private String getRuntimeList() {
+ IPreferenceStore ps = JbossWSCorePlugin.getDefault()
+ .getPreferenceStore();
+ String runtimeListString = ps
+ .getString(JbossWSCoreMessages.WS_Location);
+ return runtimeListString;
+ }
+
}
15 years, 11 months
JBoss Tools SVN: r8857 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-06-20 00:36:13 -0400 (Fri, 20 Jun 2008)
New Revision: 8857
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java
Log:
JBIDE-2388: save the changed version of jboss ws runtime
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-20 02:51:06 UTC (rev 8856)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-20 04:36:13 UTC (rev 8857)
@@ -458,6 +458,7 @@
name.doFillIntoGrid(root);
name.addPropertyChangeListener(this);
version.doFillIntoGrid(root);
+ version.addPropertyChangeListener(this);
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
@@ -521,6 +522,7 @@
if (current != null
&& current.getName().equals(name.getValueAsString())
&& current.getHomeDir().equals(homeDir.getValueAsString())
+ && current.getVersion().equals(version.getValueAsString())
&& current.isUserConfigClasspath() == jarJbws.isUserConfigClasspath()
&& (!jarJbws.isUserConfigClasspath()
|| hasSameLibraies(current.getLibraries(), jarJbws.getLibraries()))) {
@@ -729,6 +731,7 @@
this.changed = changed;
this.source = source;
page1.name.setValue(source.getName());
+ page1.version.setValue(source.getVersion());
page1.homeDir.setValue(source.getHomeDir());
page1.current = source;
}
@@ -745,6 +748,7 @@
if (added.contains(source) || changed.containsKey(source)) {
source.setName(rt.getName());
source.setHomeDir(rt.getHomeDir());
+ source.setVersion(rt.getVersion());
source.setUserConfigClasspath(rt.isUserConfigClasspath());
source.setLibraries(rt.getLibraries());
} else {
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java 2008-06-20 02:51:06 UTC (rev 8856)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java 2008-06-20 04:36:13 UTC (rev 8857)
@@ -86,7 +86,7 @@
// reset default runtime
for (JbossWSRuntime jbossWSRuntime : JbossWSRuntimeManager
.getInstance().getRuntimes()) {
- jbossWSRuntime.setDefault(false);
+ jbossWSRuntime.setDefault(false);
}
// set deafult runtime
if (defaultRuntime != null) {
@@ -98,6 +98,7 @@
for (JbossWSRuntime c : changed.keySet()) {
JbossWSRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
+ o.setVersion(c.getVersion());
String oldName = o.getName();
String newName = c.getName();
if (!oldName.equals(newName)) {
@@ -133,4 +134,8 @@
performApply();
return super.performOk();
}
+
+ public JbossRuntimeListFieldEditor getJbossWSRuntimes() {
+ return jbossWSRuntimes;
+ }
}
15 years, 11 months
JBoss Tools SVN: r8856 - trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-19 22:51:06 -0400 (Thu, 19 Jun 2008)
New Revision: 8856
Added:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
Log:
JBIDE-2387: code refactor
Added: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/AbstractGenerateCodeCommand.java 2008-06-20 02:51:06 UTC (rev 8856)
@@ -0,0 +1,139 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.core.utils.StatusUtils;
+import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+abstract class AbstractGenerateCodeCommand extends AbstractDataModelOperation{
+
+ protected ServiceModel model;
+ private String cmdFileName_linux;
+ private String cmdFileName_win;
+
+ public AbstractGenerateCodeCommand(ServiceModel model){
+ this.model = model;
+ cmdFileName_linux = getCommandLineFileName_linux();
+ cmdFileName_win = getCommandLineFileName_win();
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ IStatus status = Status.OK_STATUS;
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(model
+ .getWebProjectName());
+
+ try {
+ String runtimeLocation = JBossWSCreationUtils.getJbossWSRuntimeLocation(project);
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ IPath path = new Path(commandLocation);
+ String command = "sh " + cmdFileName_linux;
+ if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0){
+ command = "cmd.exe /c " + cmdFileName_win;
+ path = path.append(cmdFileName_win);
+ }else{
+ path = path.append(cmdFileName_linux);
+ }
+
+ if(!path.toFile().getAbsoluteFile().exists()){
+ return StatusUtils.errorStatus(
+ NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
+ new String[] {path.toOSString()}));
+ }
+
+ String args = getCommandlineArgs();
+ command += " -k " + args + " " + model.getWsdlURI();
+ Runtime rt = Runtime.getRuntime();
+ Process proc = rt.exec(command, null, new File(commandLocation));
+ InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
+ LineNumberReader input = new LineNumberReader(ir);
+ String str = input.readLine();
+ StringBuffer result = new StringBuffer();
+ while(str != null){
+ result.append(str).append("\t\r");
+ str = input.readLine();
+
+ }
+ int exitValue = proc.waitFor();
+ if(exitValue != 0){
+ return StatusUtils.errorStatus(result.toString());
+ }
+
+ // log the result of the command execution
+ String resultOutput = convertInputStreamToString(proc.getInputStream());
+ if(resultOutput != null && resultOutput.indexOf("[ERROR]") >= 0){
+ JBossWSCreationCore.getDefault().logError(resultOutput);
+ IStatus errorStatus = StatusUtils.errorStatus(resultOutput);
+ status = StatusUtils
+ .errorStatus(
+ JBossWSCreationCoreMessages.Error_Message_Failed_To_Generate_Code,
+ new CoreException(errorStatus));
+ }else{
+ JBossWSCreationCore.getDefault().logInfo(resultOutput);
+ }
+ } catch (IOException e) {
+ JBossWSCreationCore.getDefault().logError(e);
+
+ } catch (InterruptedException e) {
+ // ignore
+ } catch (CoreException e) {
+ JBossWSCreationCore.getDefault().logError(e);
+ //unable to get runtime location
+ return e.getStatus();
+ }
+
+ refreshProject(model.getWebProjectName(), monitor);
+
+
+ return status;
+ }
+
+ private String convertInputStreamToString(InputStream input) throws IOException{
+ InputStreamReader ir = new InputStreamReader(input);
+ LineNumberReader reader = new LineNumberReader(ir);
+ String str = reader.readLine();
+ StringBuffer result = new StringBuffer();
+ while(str != null){
+ result.append(str).append("\t\r");
+ str = reader.readLine();
+
+ }
+ return result.toString();
+ }
+ private void refreshProject(String project, IProgressMonitor monitor){
+ try {
+ JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ JBossWSCreationCore.getDefault().logError(e);
+ }
+ }
+
+ abstract protected String getCommandlineArgs();
+
+ abstract protected String getCommandLineFileName_linux();
+ abstract protected String getCommandLineFileName_win();
+
+
+}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-19 23:45:51 UTC (rev 8855)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-20 02:51:06 UTC (rev 8856)
@@ -1,135 +1,34 @@
package org.jboss.tools.ws.creation.core.commands;
import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
import java.util.List;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.utils.StatusUtils;
-import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
-public class WSDL2JavaCommand extends AbstractDataModelOperation{
+public class WSDL2JavaCommand extends AbstractGenerateCodeCommand{
- private ServiceModel model;
private static String WSCONSUEM_FILE_NAME_LINUX = "wsconsume.sh";
private static String WSCONSUEM_FILE_NAME_WIN = "wsconsume.bat";
public WSDL2JavaCommand(ServiceModel model){
- this.model = model;
+ super(model);
}
+
@Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- IStatus status = Status.OK_STATUS;
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(model
- .getWebProjectName());
-
- try {
- String runtimeLocation = JBossWSCreationUtils.getJbossWSRuntimeLocation(project);
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
- IPath path = new Path(commandLocation);
- String command = "sh " + WSCONSUEM_FILE_NAME_LINUX;
- if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0){
- command = "cmd.exe /c " + WSCONSUEM_FILE_NAME_WIN;
- path = path.append(WSCONSUEM_FILE_NAME_WIN);
- }else{
- path = path.append(WSCONSUEM_FILE_NAME_LINUX);
- }
-
- if(!path.toFile().getAbsoluteFile().exists()){
- return StatusUtils.errorStatus(
- NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
- new String[] {path.toOSString()}));
- }
-
- String args = getCommandlineArgs();
- command += " -k " + args + " " + model.getWsdlURI();
- Runtime rt = Runtime.getRuntime();
- Process proc = rt.exec(command, null, new File(commandLocation));
- InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
- LineNumberReader input = new LineNumberReader(ir);
- String str = input.readLine();
- StringBuffer result = new StringBuffer();
- while(str != null){
- result.append(str).append("\t\r");
- str = input.readLine();
-
- }
- int exitValue = proc.waitFor();
- if(exitValue != 0){
- return StatusUtils.errorStatus(result.toString());
- }
-
- // log the result of the command execution
- String resultOutput = convertInputStreamToString(proc.getInputStream());
- if(resultOutput != null && resultOutput.indexOf("[ERROR]") >= 0){
- JBossWSCreationCore.getDefault().logError(resultOutput);
- IStatus errorStatus = StatusUtils.errorStatus(resultOutput);
- status = StatusUtils
- .errorStatus(
- JBossWSCreationCoreMessages.Error_Message_Failed_To_Generate_Code,
- new CoreException(errorStatus));
- }else{
- JBossWSCreationCore.getDefault().logInfo(resultOutput);
- }
- } catch (IOException e) {
- JBossWSCreationCore.getDefault().logError(e);
-
- } catch (InterruptedException e) {
- // ignore
- } catch (CoreException e) {
- JBossWSCreationCore.getDefault().logError(e);
- //unable to get runtime location
- return e.getStatus();
- }
-
- refreshProject(model.getWebProjectName(), monitor);
-
-
- return status;
+ protected String getCommandLineFileName_linux() {
+ return WSCONSUEM_FILE_NAME_LINUX;
}
-
- private String convertInputStreamToString(InputStream input) throws IOException{
- InputStreamReader ir = new InputStreamReader(input);
- LineNumberReader reader = new LineNumberReader(ir);
- String str = reader.readLine();
- StringBuffer result = new StringBuffer();
- while(str != null){
- result.append(str).append("\t\r");
- str = reader.readLine();
-
- }
- return result.toString();
+
+ @Override
+ protected String getCommandLineFileName_win() {
+ return WSCONSUEM_FILE_NAME_WIN;
}
- private void refreshProject(String project, IProgressMonitor monitor){
- try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
- } catch (CoreException e) {
- e.printStackTrace();
- JBossWSCreationCore.getDefault().logError(e);
- }
- }
-
- private String getCommandlineArgs(){
+
+ @Override
+ protected String getCommandlineArgs() {
String commandLine;
String project = model.getWebProjectName();
String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
@@ -160,7 +59,6 @@
return commandLine;
-
}
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-06-19 23:45:51 UTC (rev 8855)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-06-20 02:51:06 UTC (rev 8856)
@@ -11,95 +11,35 @@
package org.jboss.tools.ws.creation.core.commands;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.utils.StatusUtils;
-import org.jboss.tools.ws.creation.core.JBossWSCreationCore;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
/**
* @author Grid Qian
*/
-public class WSProviderInvokeCommand extends AbstractDataModelOperation {
+public class WSProviderInvokeCommand extends AbstractGenerateCodeCommand {
- private ServiceModel model;
-
+ private static String WSPROVIDER_FILE_NAME_LINUX = "wsprovide.sh";
+ private static String WSPROVIDER_FILE_NAME_WIN = "wsprovide.bat";
+
public WSProviderInvokeCommand(ServiceModel model) {
- this.model = model;
+ super(model);
}
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- String runtimeLocation;
- try {
- runtimeLocation = JBossWSCreationUtils.getJbossWSRuntimeLocation(ResourcesPlugin.getWorkspace().getRoot().getProject(model
- .getWebProjectName()));
- } catch (CoreException e1) {
- JBossWSCreationCore.getDefault().logError(e1);
- //unable to get runtime location
- return e1.getStatus();
- }
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
- String command = "sh wsprovide.sh ";
- if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
- command = "cmd.exe /C wsprovide.bat";
- }
- String args = getCommandlineArgs();
- command += " -k " + args;
-
- try {
- Runtime rt = Runtime.getRuntime();
- Process proc = rt.exec(command, null, new File(commandLocation));
- InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
- LineNumberReader input = new LineNumberReader(ir);
- String str = input.readLine();
- StringBuffer result = new StringBuffer();
- while (str != null) {
- result.append(str).append("\t\r");
- str = input.readLine();
-
- }
- int exitValue = proc.waitFor();
- if (exitValue != 0) {
- return StatusUtils.errorStatus(result.toString());
- }
-
- } catch (IOException e) {
- JBossWSCreationCore.getDefault().logError(e);
- } catch (InterruptedException e) {
- JBossWSCreationCore.getDefault().logError(e);
- }
-
- refreshProject(model.getWebProjectName(), monitor);
-
- return Status.OK_STATUS;
+ @Override
+ protected String getCommandLineFileName_linux() {
+ return WSPROVIDER_FILE_NAME_LINUX;
}
- private void refreshProject(String project, IProgressMonitor monitor) {
- try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2,
- monitor);
- } catch (CoreException e) {
- JBossWSCreationCore.getDefault().logError(e);
- }
+ @Override
+ protected String getCommandLineFileName_win() {
+ return WSPROVIDER_FILE_NAME_WIN;
}
- private String getCommandlineArgs() {
+ @Override
+ protected String getCommandlineArgs() {
String commandLine;
String project = model.getWebProjectName();
String projectRoot = JBossWSCreationUtils.getProjectRoot(project)
15 years, 11 months
JBoss Tools SVN: r8855 - in trunk/as/tests/org.jboss.ide.eclipse.as.test: projectPieces and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-19 19:45:51 -0400 (Thu, 19 Jun 2008)
New Revision: 8855
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-application.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-jboss-app.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104.properties
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/EJB3WithDescriptor.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/Ejb3NoDescriptor.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/WebArchive.war
trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/directory-monitor.sar
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.project
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.component
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/EarContent/
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/EarContent/META-INF/
trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/TempProject/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/JBIDE1104Test.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/testOutputs/
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java
Log:
JBIDE-1104 and others will use this
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-application.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-application.xml (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-application.xml 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<application xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+ version="1.4">
+
+ <display-name>Simple example of application</display-name>
+
+ <module>
+ <ejb>EJB3WithDescriptor.jar</ejb>
+ </module>
+</application>
\ No newline at end of file
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-jboss-app.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-jboss-app.xml (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104-jboss-app.xml 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,5 @@
+<jboss-app>
+ <module>
+ <service>directory-monitor.sar</service>
+ </module>
+</jboss-app>
\ No newline at end of file
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104.properties (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/1104.properties 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,8 @@
+copy1src=directory-monitor.sar
+copy1dest=EarContent/directory-monitor.sar
+copy2src=EJB3WithDescriptor.jar
+copy2dest=EarContent/EJB3WithDescriptor.jar
+copy3src=1104-application.xml
+copy3dest=EarContent/META-INF/application.xml
+copy4src=1104-jboss-app.xml
+copy4dest=EarContent/META-INF/jboss-app.xml
\ No newline at end of file
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/EJB3WithDescriptor.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/EJB3WithDescriptor.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/Ejb3NoDescriptor.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/Ejb3NoDescriptor.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/WebArchive.war
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/WebArchive.war
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/directory-monitor.sar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/projectPieces/directory-monitor.sar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.project
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.project (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.project 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SimpleEar</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.component 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="SimpleEar">
+ <wb-resource deploy-path="/" source-path="/EarContent"/>
+ </wb-module>
+</project-modules>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/projects/SimpleEar/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 4.2 Runtime"/>
+ <fixed facet="jst.ear"/>
+ <installed facet="jst.ear" version="5.0"/>
+</faceted-project>
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java 2008-06-19 16:42:58 UTC (rev 8854)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java 2008-06-19 23:45:51 UTC (rev 8855)
@@ -59,7 +59,7 @@
return new IRuntime[] { savedRuntime, secondSavedRuntime };
}
- public void testCreateBrokenServer() throws CoreException {
+ public void testCreateBrokenRuntime() throws CoreException {
IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
IRuntimeType runtimeType = runtimeTypes[0];
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,157 @@
+package org.jboss.ide.eclipse.as.test.publishing;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.osgi.framework.Bundle;
+
+public abstract class AbstractDeploymentTest extends TestCase {
+ protected String BUNDLE_NAME = "org.jboss.ide.eclipse.as.test";
+ private TestProjectProvider provider;
+ protected IProject workspaceProject;
+ protected String sourceProjectName;
+ protected String testProperties;
+ protected IRuntime runtime;
+ protected IServer server;
+
+ public AbstractDeploymentTest(String projectName, String testProperties) {
+ this.sourceProjectName = projectName;
+ this.testProperties = testProperties;
+ }
+
+ protected void setUp() throws Exception {
+ cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
+ assembleInTempProject();
+ createServer();
+ String path = "/projects/TempProject/" + sourceProjectName;
+ provider = new TestProjectProvider(BUNDLE_NAME, path, sourceProjectName, true);
+ workspaceProject = provider.getProject();
+ workspaceProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void cleanFolder(String folder) throws CoreException {
+ cleanFolder(new File(folder));
+ }
+ protected void cleanFolder(File folder) throws CoreException {
+ if( folder != null && folder.exists() ) {
+ File[] children = folder.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ FileUtil.safeDelete(children[i]);
+ }
+ }
+
+ protected File getProjectLocation(String name) throws CoreException {
+ return getFileLocation("/projects/" + name);
+ }
+
+ protected File getFileLocation(String path) throws CoreException {
+ Bundle bundle = Platform.getBundle(BUNDLE_NAME);
+ URL url = null;
+ try {
+ url = FileLocator.resolve(bundle.getEntry(path));
+ } catch (IOException e) {
+ String msg = "Cannot find file " + path + " in " + BUNDLE_NAME;
+ IStatus status = new Status(IStatus.ERROR, ASTest.PLUGIN_ID, msg, e);
+ throw new CoreException(status);
+ }
+ String location = url.getFile();
+ return new File(location);
+ }
+
+ protected void assembleInTempProject() throws CoreException {
+ File tempProject = getProjectLocation("TempProject");
+ File srcProject = getProjectLocation(sourceProjectName);
+ File destProject = new File(tempProject, sourceProjectName);
+ FileUtil.fileSafeCopy(srcProject, destProject);
+
+ // now copy files over from the properties file
+ File propertiesFile = getFileLocation("projectPieces/" + testProperties);
+ Properties props = new Properties();
+ try {
+ props.load(new FileInputStream(propertiesFile));
+ boolean done = false;
+ String srcKey, destKey;
+ int i = 1;
+ while( !done ) {
+ srcKey = "copy" + i + "src";
+ destKey = "copy" + i + "dest";
+ done = copy(props.getProperty(srcKey), props.getProperty(destKey));
+ i++;
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected boolean copy(String src, String dest) throws CoreException {
+ if( src == null || dest == null )
+ return true;
+
+ // do the copy
+ File srcFile, destFile, tmp;
+ srcFile = getFileLocation("projectPieces/" + src);
+ tmp = getFileLocation("projects/TempProject/" + sourceProjectName);
+ destFile = new File(tmp, dest);
+ FileUtil.fileSafeCopy(srcFile, destFile);
+
+ return false;
+ }
+
+
+ protected void createServer() throws CoreException {
+ IRuntimeType rt = ServerCore.findRuntimeType("org.jboss.ide.eclipse.as.runtime.stripped");
+ IRuntimeWorkingCopy wc = rt.createRuntime("testRuntime", null);
+ runtime = wc.save(true, null);
+ IServerType st = ServerCore.findServerType("org.jboss.ide.eclipse.as.systemCopyServer");
+ ServerWorkingCopy swc = (ServerWorkingCopy) st.createServer("testServer", null, null);
+ swc.setServerConfiguration(null);
+ swc.setName("testServer");
+ swc.setAttribute(DeployableServer.DEPLOY_DIRECTORY, getFileLocation("/testOutputs").getAbsolutePath());
+ server = swc.save(true, null);
+ }
+
+ protected IStatus publish(IModule module) throws CoreException {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ copy.modifyModules(new IModule[]{module}, new IModule[0], new NullProgressMonitor());
+ server = copy.save(false, new NullProgressMonitor());
+ return server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ cleanFolder(getProjectLocation("TempProject").getAbsolutePath());
+ cleanFolder(getFileLocation("testOutputs"));
+ runtime.delete();
+ server.delete();
+ }
+
+}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/JBIDE1104Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/JBIDE1104Test.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/JBIDE1104Test.java 2008-06-19 23:45:51 UTC (rev 8855)
@@ -0,0 +1,29 @@
+package org.jboss.ide.eclipse.as.test.publishing;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+
+public class JBIDE1104Test extends AbstractDeploymentTest {
+
+ public JBIDE1104Test() {
+ super("SimpleEar", "1104.properties");
+ }
+
+ public void testJBIDE1104() throws Exception {
+ IModuleArtifact[] artifacts = ServerPlugin.getModuleArtifacts(workspaceProject);
+ assertNotNull(artifacts);
+ assertEquals(1, artifacts.length);
+ assertNotNull(artifacts[0]);
+ IModule module = artifacts[0].getModule();
+ assertNotNull(module);
+ IStatus result = publish(module);
+ assertEquals(IStatus.OK, result.getSeverity());
+
+ // now do my asserts regarding the output structure
+ // TODO
+
+ }
+
+}
15 years, 11 months