JBoss Tools SVN: r14444 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-04-02 06:28:45 -0400 (Thu, 02 Apr 2009)
New Revision: 14444
Modified:
trunk/birt/docs/en/modules/birt_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-689
Links to forum are corrected
Modified: trunk/birt/docs/en/modules/birt_support.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_support.xml 2009-04-02 07:03:04 UTC (rev 14443)
+++ trunk/birt/docs/en/modules/birt_support.xml 2009-04-02 10:28:45 UTC (rev 14444)
@@ -227,7 +227,7 @@
</figure>
- <para>Click on the <emphasis><property>Finish</property></emphasis> button. The Edit Data Set window opens where you can change Data Source, Settings, Parameters and other details for the Data Set created. If switched to the Query page you can check the schemes within this database, you can expand them to see the list of tables with their columns:</para>
+ <para>Click on the <emphasis><property>Finish</property></emphasis> button. The Edit Data Set window opens where you can change Data Source, Settings, Parameters and other details for the Data Set created. If switched to the Query page you can check the schemas within this database, you can expand them to see the list of tables with their columns:</para>
<figure>
15 years, 9 months
JBoss Tools SVN: r14443 - in trunk: jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-04-02 03:03:04 -0400 (Thu, 02 Apr 2009)
New Revision: 14443
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
Log:
JBIDE-3557 Removed duplicate messages
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 2009-04-02 06:00:28 UTC (rev 14442)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-04-02 07:03:04 UTC (rev 14443)
@@ -499,7 +499,6 @@
ExporterSettingsTab_select_all=Select all
ExporterSettingsTab_select_exporter_you_want_to_add=Select the exporter(s) you want to add
ExporterSettingsTab_template_directory_for=Template directory for
-ExporterSettingsTab_use_java5_syntax=Use Java 5 syntax
ExporterSettingsTab_select_dir=Select directory
ExporterSettingsTab_select_dir2=Select directory from filesystem or workspace.
ExporterSettingsTab_select_path=Select path
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2009-04-02 06:00:28 UTC (rev 14442)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2009-04-02 07:03:04 UTC (rev 14443)
@@ -4,7 +4,6 @@
CANNOT_READ_PROJECT_VERSIONS_DESCRIPTORFILE=Cannot read project versions descriptor file
PLEASE_CREATE_A_SERVER_AND_SELECT_IT_ON_TOOLBAR=Please create a server and select it on toolbar.
WARNING=Warning
-WARNING=Warning
CLOSE=Close
ERROR=Error
INCORRECT_URL=Incorrect URL: {0}.
@@ -46,7 +45,6 @@
SERVER_ISNOT_SELECTED=Server is not selected.
ITEM_ISNOT_REFERENCED=This item is not referenced.
CANCEL=Cancel
-CANCEL=Cancel
DELETE_REFERENCE_FROM_WEBDESCRIPTOR=Delete reference from web descriptor
DELETE_REFERENCE_FROM_STRUTS_CONFIGURATION_FILE=Delete reference from struts configuration file
DELETE=Delete
@@ -95,7 +93,6 @@
PATH_TO_TLD_ISNOT_CORRECT=Path to tld is not correct.
PATH_TO_JVM_IS_EMPTY=Path to JVM is empty.
START_TOMCAT_SERVER=Start Tomcat Server
-START_TOMCAT_SERVER=Start Tomcat Server
START_IN_DEBUG_MODE=Start {0} in Debug Mode
ROOT_ISNOT_FOUND=J2EE 1.4 SDK root is not found.\n
EITHER_OR_MUST_BE_SET=Either {0} or {1} must be set
@@ -160,9 +157,7 @@
CONTEXT_IS_ALREADY_REGISTERED_IN_SERVERXML=Context {0} is already registered in server.xml. Do you want to overwrite it?
REGISTERING_WEB_CONTEXT_IN_SERVERXML=Registering Web Context in server.xml
YES=Yes
-YES=Yes
NO=No
-NO=No
ADD_TO_EXISTING_GROUP=Add to Existing Group
CREATE_NEW_GROUP=Create New Group
JAVA_PROJECT_EXISTS=Java project {0} exists. The wizard will make it {1} project
15 years, 9 months
JBoss Tools SVN: r14442 - in trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core: build and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 02:00:28 -0400 (Thu, 02 Apr 2009)
New Revision: 14442
Added:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceChangeListener.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java
Log:
Adding a refresher external
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2009-04-02 05:59:36 UTC (rev 14441)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2009-04-02 06:00:28 UTC (rev 14442)
@@ -12,13 +12,13 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.build.ModelChangeListenerWithRefresh;
+import org.jboss.ide.eclipse.archives.core.build.PostBuildRefresher;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
+import org.jboss.ide.eclipse.archives.core.model.IArchivesVFS;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
-import org.jboss.ide.eclipse.archives.core.model.IArchivesVFS;
import org.jboss.ide.eclipse.archives.core.model.other.internal.ArchivesWorkspaceLogger;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspacePreferenceManager;
@@ -34,6 +34,7 @@
super(WORKSPACE);
ArchivesCore.setInstance(this);
ArchivesModel.instance().addModelListener(new ModelChangeListenerWithRefresh());
+ ArchivesModel.instance().addBuildListener(new PostBuildRefresher());
}
protected IExtensionManager createExtensionManager() {
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceChangeListener.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceChangeListener.java 2009-04-02 05:59:36 UTC (rev 14441)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceChangeListener.java 2009-04-02 06:00:28 UTC (rev 14442)
@@ -41,6 +41,7 @@
public class WorkspaceChangeListener implements IResourceChangeListener {
public void resourceChanged(IResourceChangeEvent event) {
+ // The comparator
Comparator c = new Comparator() {
public int compare(Object o1, Object o2) {
if( o1 instanceof IProject && o2 instanceof IProject)
@@ -49,27 +50,20 @@
return 0;
}
};
+
+ // Unregister a project if a project is being deleted
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
IResource resource = event.getResource();
if (resource instanceof IProject) {
final IProject project = (IProject) resource;
IResource packages = project.findMember(IArchiveModel.DEFAULT_PACKAGES_FILE);
if (ArchivesModel.instance().isProjectRegistered(project.getLocation()) || packages != null) {
- WorkspaceJob job = new WorkspaceJob(ArchivesCoreMessages.UnregisterProject) {
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor)
- throws CoreException {
- ArchivesModel.instance().unregisterProject(project.getLocation(), new NullProgressMonitor());
- return Status.OK_STATUS;
- }
-
- };
- job.schedule();
+ unregister(project);
}
}
}
+ // Recurse delta to find a packages file, add to set
final Set<IProject> projects = new TreeSet<IProject>(c);
IResourceDelta delta = event.getDelta();
try {
@@ -88,11 +82,13 @@
}
} catch( CoreException ce ) {
}
+
+ // If we're deleting the .packages file or closing the project, unregister
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Iterator<IProject> i = projects.iterator();
while(i.hasNext()) {
final IProject p = i.next();
- ArchivesModel.instance().unregisterProject(p.getLocation(), new NullProgressMonitor());
+ unregister(p);
}
} else {
Iterator<IProject> i = projects.iterator();
@@ -125,4 +121,16 @@
}
}
+ protected void unregister(final IProject project) {
+ WorkspaceJob job = new WorkspaceJob(ArchivesCoreMessages.UnregisterProject) {
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ ArchivesModel.instance().unregisterProject(
+ project.getLocation(), new NullProgressMonitor());
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java 2009-04-02 05:59:36 UTC (rev 14441)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java 2009-04-02 06:00:28 UTC (rev 14442)
@@ -80,12 +80,6 @@
}
} catch( CoreException ce ) {
}
-
- try {
- proj.setSessionProperty(new QualifiedName(ArchivesCorePlugin.PLUGIN_ID, "localname"), null); //$NON-NLS-1$
- } catch( CoreException ce ) {
- }
-
}
}
}
Added: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java (rev 0)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/PostBuildRefresher.java 2009-04-02 06:00:28 UTC (rev 14442)
@@ -0,0 +1,96 @@
+package org.jboss.ide.eclipse.archives.core.build;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveBuildListener;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.core.util.PathUtils;
+
+public class PostBuildRefresher implements IArchiveBuildListener {
+
+ public void buildFailed(IArchive pkg, IStatus status) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void cleanArchive(IArchive pkg) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void cleanProject(IPath project) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(IArchiveNode node, IStatus[] multi) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void fileRemoved(IArchive topLevelArchive, IArchiveFileSet fileset,
+ IPath filePath) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void fileUpdated(IArchive topLevelArchive, IArchiveFileSet fileset,
+ IPath filePath) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void finishedBuild(IPath project) {
+
+ // TODO Auto-generated method stub
+
+ }
+
+ public void finishedBuildingArchive(IArchive pkg) {
+ // TODO Auto-generated method stub
+ if( pkg.isDestinationInWorkspace()) {
+ IPath loc = PathUtils.getGlobalLocation(pkg);
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(loc);
+ for( int i = 0; i < files.length; i++ ) {
+ try {
+ files[i].refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ } catch( CoreException ce ) {}
+ }
+ IContainer[] folders = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocation(loc);
+ for( int i = 0; i < folders.length; i++ ) {
+ try {
+ folders[i].refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ } catch( CoreException ce ) {}
+ }
+ }
+ }
+
+ public void finishedCollectingFileSet(IArchiveFileSet fileset) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedBuild(IPath project) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedBuildingArchive(IArchive pkg) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedCollectingFileSet(IArchiveFileSet fileset) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
15 years, 9 months
JBoss Tools SVN: r14441 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:59:36 -0400 (Thu, 02 Apr 2009)
New Revision: 14441
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java
Log:
NPE
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java 2009-04-02 05:59:04 UTC (rev 14440)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java 2009-04-02 05:59:36 UTC (rev 14441)
@@ -164,7 +164,7 @@
public void setDestinationPath(IPath path) {
String destPath = getRawDestinationPath();
attributeChanged(DESTINATION_ATTRIBUTE, destPath == null ? null : destPath.toString(), path == null ? null : path.toString());
- packageDelegate.setToDir(path.toString());
+ packageDelegate.setToDir(path == null ? null : path.toString());
}
/*
15 years, 9 months
JBoss Tools SVN: r14440 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:59:04 -0400 (Thu, 02 Apr 2009)
New Revision: 14440
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
Log:
registration twice should not occur
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2009-04-02 05:32:47 UTC (rev 14439)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2009-04-02 05:59:04 UTC (rev 14440)
@@ -199,11 +199,14 @@
}
public void registerProject(IArchiveModelRootNode model, IProgressMonitor monitor) {
- ArchivesCore.getInstance().preRegisterProject(model.getProjectPath());
- xbPackages.put(model.getProjectPath(), ((ArchiveModelNode)model).getXbPackages());
- archivesRoot.put(model.getProjectPath(), (ArchiveModelNode)model);
- model.setModel(this);
- fireRegisterProjectEvent((ArchiveModelNode)model);
+ // If we're already registered, ignore this
+ if(!isProjectRegistered(model.getProjectPath())) {
+ ArchivesCore.getInstance().preRegisterProject(model.getProjectPath());
+ xbPackages.put(model.getProjectPath(), ((ArchiveModelNode)model).getXbPackages());
+ archivesRoot.put(model.getProjectPath(), (ArchiveModelNode)model);
+ model.setModel(this);
+ fireRegisterProjectEvent((ArchiveModelNode)model);
+ }
}
public void unregisterProject(IPath projectPath, IProgressMonitor monitor) {
15 years, 9 months
JBoss Tools SVN: r14439 - trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:32:47 -0400 (Thu, 02 Apr 2009)
New Revision: 14439
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModuleModelListener.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
Log:
slight changes / cleanup
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModuleModelListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModuleModelListener.java 2009-04-02 05:27:53 UTC (rev 14438)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModuleModelListener.java 2009-04-02 05:32:47 UTC (rev 14439)
@@ -20,11 +20,13 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IPublishListener;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.internal.ModuleFactory;
import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.jboss.ide.eclipse.archives.core.model.AbstractBuildListener;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
@@ -40,7 +42,7 @@
*
* @author rob.stryker(a)jboss.com
*/
-public class ArchivesModuleModelListener implements IArchiveModelListener {
+public class ArchivesModuleModelListener extends AbstractBuildListener implements IArchiveModelListener {
public static ArchivesModuleModelListener instance;
public static final String DEPLOY_SERVERS = "org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployServers";//$NON-NLS-1$
@@ -53,33 +55,49 @@
return instance;
}
+ private IPublishListener publishListener;
+ private ArrayList<IServer> publishing;
public ArchivesModuleModelListener() {
ArchivesModel.instance().addModelListener(this);
+ ArchivesModel.instance().addBuildListener(this);
+ publishing = new ArrayList<IServer>();
+ publishListener = new IPublishListener() {
+ public void publishFinished(IServer server, IStatus status) {
+ publishing.remove(server);
+ }
+ public void publishStarted(IServer server) {
+ publishing.add(server);
+ }
+ };
}
+ // If we're supposed to auto-deploy, get on it
public void finishedBuildingArchive(IArchive pkg) {
if( pkg.isTopLevel() && new Boolean(pkg.getProperty(DEPLOY_AFTER_BUILD)).booleanValue()) {
- publish(pkg);
+ String servers = pkg.getProperty(ArchivesModuleModelListener.DEPLOY_SERVERS);
+ publish(pkg, servers, IServer.PUBLISH_INCREMENTAL);
}
}
- // If we're supposed to auto-deploy, get on it
- protected static void publish(IArchive pkg) {
- String servers = pkg.getProperty(ArchivesModuleModelListener.DEPLOY_SERVERS);
- publish(pkg, servers, IServer.PUBLISH_INCREMENTAL);
- }
- public static void publish(IArchive pkg, String servers, int publishType) {
+ public void publish(IArchive pkg, String servers, int publishType) {
IModule[] module = getModule(pkg);
if( module[0] == null ) return;
DeployableServerBehavior[] serverBehaviors = ArchivesModuleModelListener.getServers(servers);
if( serverBehaviors != null ) {
for( int i = 0; i < serverBehaviors.length; i++ ) {
- publish(serverBehaviors[i].getServer(), publishType, module );
+ if( !publishing.contains(serverBehaviors[i].getServer())) {
+ try {
+ serverBehaviors[i].getServer().addPublishListener(publishListener);
+ publish(serverBehaviors[i].getServer(), publishType, module );
+ } finally {
+ serverBehaviors[i].getServer().removePublishListener(publishListener);
+ }
+ }
}
}
}
- protected static IStatus publish(IServer server, int publishType, IModule[] module ) {
+ protected IStatus publish(IServer server, int publishType, IModule[] module ) {
try {
IServerWorkingCopy copy = server.createWorkingCopy();
copy.modifyModules(module, new IModule[0], new NullProgressMonitor());
@@ -92,12 +110,12 @@
return Status.OK_STATUS;
}
- protected static IModule[] getModule(IArchive node) {
+ protected IModule[] getModule(IArchive node) {
ModuleFactory factory = ServerPlugin.findModuleFactory(PackageModuleFactory.FACTORY_TYPE_ID);
IModule mod = factory.findModule(PackageModuleFactory.getId(node), new NullProgressMonitor());
return new IModule[] { mod };
}
- protected static PackagedModuleDelegate getModuleDelegate(IArchive node) {
+ protected PackagedModuleDelegate getModuleDelegate(IArchive node) {
IModule mod = getModule(node)[0];
return (PackagedModuleDelegate)mod.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2009-04-02 05:27:53 UTC (rev 14438)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2009-04-02 05:32:47 UTC (rev 14439)
@@ -49,7 +49,7 @@
protected IDeployableServer server;
protected IModuleResourceDelta[] delta;
- protected FileUtilListener listener = new FileUtilListener();
+ protected FileUtilListener listener;
public PackagesPublisher() {
}
@@ -67,6 +67,7 @@
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor)
throws CoreException {
+ listener = new FileUtilListener();
this.server = ServerConverter.getDeployableServer(server);
this.delta = delta;
IModule module2 = module[0];
@@ -76,8 +77,6 @@
if( publishType == REMOVE_PUBLISH ) {
removeModule(module2, monitor);
} else if( publishType == FULL_PUBLISH ) {
- IArchive pack = getPackage(module2);
- new ArchiveBuildDelegate().fullArchiveBuild(pack, monitor);
publishModule(module2, false, monitor);
} else if( publishType == INCREMENTAL_PUBLISH ) {
publishModule(module2, true, monitor);
15 years, 9 months
JBoss Tools SVN: r14438 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:27:53 -0400 (Thu, 02 Apr 2009)
New Revision: 14438
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
Log:
Some messaging for runtime wizard
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-04-02 05:24:44 UTC (rev 14437)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-04-02 05:27:53 UTC (rev 14438)
@@ -36,7 +36,8 @@
public static String wf_ConfigLabel;
public static String JBAS_version;
public static String JBEAP_version;
- public static String rwf_Title;
+ public static String rwf_TitleCreate;
+ public static String rwf_TitleEdit;
public static String rwf_Explanation;
public static String rwf_BaseName;
public static String rwf_NameInUse;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-04-02 05:24:44 UTC (rev 14437)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-04-02 05:27:53 UTC (rev 14438)
@@ -6,7 +6,8 @@
wf_HomeDirLabel=Home Directory
wf_JRELabel=JRE
wf_ConfigLabel=Configuration
-rwf_Title=Create a new JBoss Runtime
+rwf_TitleCreate=Create a new JBoss Runtime
+rwf_TitleEdit=Edit a JBoss Runtime
rwf_Explanation=A JBoss Server runtime references a JBoss installation directory.\nIt can be used to set up classpaths for projects which depend on this runtime,\nas well as by a "server" which will be able to start and stop instances of JBoss.
rwf_BaseName=JBoss _VERSION_ Runtime
rwf_NameInUse=Runtime name already in use
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-04-02 05:24:44 UTC (rev 14437)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-04-02 05:27:53 UTC (rev 14438)
@@ -119,7 +119,8 @@
IRuntime r = (IRuntime) getTaskModel()
.getObject(TaskModel.TASK_RUNTIME);
String version = r.getRuntimeType().getVersion();
- handle.setTitle(Messages.rwf_Title);
+ handle.setTitle( getRuntime() == null ?
+ Messages.rwf_TitleCreate : Messages.rwf_TitleEdit);
String description = NLS.bind(
isEAP() ? Messages.JBEAP_version : Messages.JBAS_version,
version);
@@ -156,16 +157,6 @@
private void fillWidgets() {
boolean canEdit = true;
- // STUPID ECLIPSE BUG https://bugs.eclipse.org/bugs/show_bug.cgi?id=263928
- IRuntime r = (IRuntime) getTaskModel()
- .getObject(TaskModel.TASK_RUNTIME);
- String oldName = r.getName();
- if( r.isWorkingCopy() ) {
- String newName = oldName.replace("Enterprise Application Platform", "EAP");
- newName = LocalJBossServerRuntime.getNextRuntimeName(newName);
- ((IRuntimeWorkingCopy)r).setName(newName);
- }
-
IJBossServerRuntime rt = getRuntime();
if (rt != null) {
originalName = rt.getRuntime().getName();
@@ -175,7 +166,7 @@
String value = prefs.getString(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + rt.getRuntime().getRuntimeType().getId());
homeDir = (value != null && value.length() != 0) ? value : rt.getRuntime().getLocation().toOSString();
homeDirText.setText(homeDir);
- ((IRuntimeWorkingCopy)r).setLocation(new Path(homeDir));
+ ((IRuntimeWorkingCopy)rt.getRuntime()).setLocation(new Path(homeDir));
config = rt.getJBossConfiguration();
configurations.setConfiguration(config);
configLabel.setText(Messages.wf_ConfigLabel);
@@ -195,6 +186,16 @@
homeDirText.setEditable(canEdit);
homeDirButton.setEnabled(canEdit);
configurations.getTable().setVisible(canEdit);
+ } else {
+ // STUPID ECLIPSE BUG https://bugs.eclipse.org/bugs/show_bug.cgi?id=263928
+ IRuntime r = (IRuntime) getTaskModel()
+ .getObject(TaskModel.TASK_RUNTIME);
+ String oldName = r.getName();
+ if( r.isWorkingCopy() ) {
+ String newName = oldName.replace("Enterprise Application Platform", "EAP");
+ newName = LocalJBossServerRuntime.getNextRuntimeName(newName);
+ ((IRuntimeWorkingCopy)r).setName(newName);
+ }
}
}
15 years, 9 months
JBoss Tools SVN: r14437 - trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:24:44 -0400 (Thu, 02 Apr 2009)
New Revision: 14437
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java
Log:
Adding to suite
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java 2009-04-02 05:19:55 UTC (rev 14436)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java 2009-04-02 05:24:44 UTC (rev 14437)
@@ -27,6 +27,7 @@
public class ASArchivesIntegrationTestSuite extends TestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("AS Archives Integration Test Suite");
+ suite.addTest(new BuildDeployTest());
return suite;
}
15 years, 9 months
JBoss Tools SVN: r14436 - in trunk/as/tests: org.jboss.ide.eclipse.as.archives.integration.test and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-02 01:19:55 -0400 (Thu, 02 Apr 2009)
New Revision: 14436
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.classpath
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.project
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/build.properties
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/plugin.properties
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
Log:
new test plugin for integrationing
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.classpath
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.classpath (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.classpath 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.project
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.project (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/.project 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.archives.integration.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.archives.integration.test
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.ide.eclipse.as.archives.integration.test.ASArchivesIntegrationTest
+Eclipse-LazyStart: true
+Bundle-ClassPath: jbossasarchivesintegrationtest.jar
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit4,
+ org.eclipse.core.resources;bundle-version="3.4.2",
+ org.eclipse.jdt;bundle-version="3.4.2",
+ org.eclipse.jdt.core;bundle-version="3.4.4",
+ org.eclipse.jdt.launching;bundle-version="3.4.1",
+ org.eclipse.wst.server.core;bundle-version="1.1.3",
+ org.jboss.ide.eclipse.as.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.archives.webtools;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.archives.core;bundle-version="2.0.0",
+ org.jboss.ide.eclipse.archives.ui;bundle-version="1.0.0",
+ org.eclipse.jface;bundle-version="3.4.2",
+ org.jboss.tools.tests;bundle-version="2.0.0"
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/build.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/build.properties (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/build.properties 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,6 @@
+bin.includes = META-INF/,\
+ jbossasarchivesintegrationtest.jar,\
+ plugin.properties
+source.jbossasarchivesintegrationtest.jar = src/
+jars.compile.order = jbossasarchivesintegrationtest.jar
+output.jbossasarchivesintegrationtest.jar = bin/
\ No newline at end of file
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/plugin.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/plugin.properties (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/plugin.properties 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.ide.eclipse.as.test
+Bundle-Vendor.0 = JBoss, a division of Red Hat
+Bundle-Name.0 = AS Archives Integration Test Plug-in
\ No newline at end of file
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTest.java 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,70 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.archives.integration.test;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class ASArchivesIntegrationTest extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.archives.integration.test";
+
+ // The shared instance
+ private static ASArchivesIntegrationTest plugin;
+
+ /**
+ * The constructor
+ */
+ public ASArchivesIntegrationTest() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static ASArchivesIntegrationTest getDefault() {
+ return plugin;
+ }
+}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/ASArchivesIntegrationTestSuite.java 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,33 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.archives.integration.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class ASArchivesIntegrationTestSuite extends TestSuite {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AS Archives Integration Test Suite");
+ return suite;
+ }
+
+}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2009-04-02 05:19:55 UTC (rev 14436)
@@ -0,0 +1,313 @@
+package org.jboss.ide.eclipse.as.archives.integration.test;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.JavaRuntime;
+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.archives.core.model.ArchiveNodeFactory;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelRootNode;
+import org.jboss.ide.eclipse.archives.ui.actions.BuildAction;
+import org.jboss.ide.eclipse.archives.webtools.modules.ArchivesModuleModelListener;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.tools.test.util.JobUtils;
+
+public class BuildDeployTest extends TestCase {
+ private static final String VALUE_PREFIX = "value";
+ private static final String OUT_JAR = "out.jar";
+ private static final String FILE_NAME = "a.txt";
+
+ private int index = 0;
+ private IProject project;
+ private IJavaProject javaProject;
+ private IRuntime runtime;
+ private IServer server;
+ private IPath deploy, tempDeploy;
+ private IPath pluginMetadata;
+ private IFile textFile;
+ private IFile textOutputFile;
+ private IFile textBuildArchiveFile;
+ private File textDeployedFile;
+ private IArchive rootArchive;
+ public void testOne() throws Exception {
+ // Builder is off, auto-deploy is off
+ enableAutomaticBuilder(false);
+ createProject();
+ setupServer();
+ addArchives();
+ buildArchive();
+ assertBuiltArchiveContents(index);
+ changeArchivesDeployPrefs(false, server.getId());
+ deploy();
+ assertDeployContents(index);
+
+ // Builder is on, auto-deploy is off
+ enableAutomaticBuilder(true);
+ int count = ++index;
+ setContents(count);
+ assertSourceContents(count);
+ JobUtils.waitForIdle();
+ assertBinContents(count);
+ assertBuiltArchiveContents(count);
+ try {
+ assertDeployContents(count);
+ assertTrue("Deployed File should not have changed", false);
+ } catch( AssertionError ae) {}
+
+
+ // Builder is on, auto-deploy is on
+ changeArchivesDeployPrefs(true, server.getId());
+ count = ++index;
+ setContents(count);
+ assertSourceContents(count);
+ assertBinContents(count);
+ assertBuiltArchiveContents(count);
+ assertDeployContents(count);
+
+ // Builder is off, autodeploy is on
+ count = ++index;
+ setContents(count);
+ assertSourceContents(count);
+ try {
+ assertBinContents(count);
+ assertTrue("Bin File should not have changed", false);
+ } catch( AssertionError ae ) {}
+ try {
+ assertBuiltArchiveContents(count);
+ assertTrue("Built Archive File should not have changed", false);
+ } catch( AssertionError ae ) {}
+ try {
+ assertDeployContents(count);
+ assertTrue("Deployed File should not have changed", false);
+ } catch( AssertionError ae ) {}
+
+ // Builder is off, autodeploy is on, manually call build!
+ callBuild();
+ assertBinContents(count);
+ assertBuiltArchiveContents(count);
+ assertDeployContents(count);
+
+ }
+
+ protected void enableAutomaticBuilder(boolean enabled) throws CoreException {
+ IWorkspaceDescription desc = ResourcesPlugin.getWorkspace().getDescription();
+ desc.setAutoBuilding(enabled);
+ ResourcesPlugin.getWorkspace().setDescription(desc);
+ }
+
+ protected void createProject() throws CoreException, IOException {
+ javaProject = createJavaProject("P1");
+ project = javaProject.getProject();
+ textFile = project.getFile(new Path(FILE_NAME));
+ textOutputFile = project.getFile(new Path("bin").append(FILE_NAME));
+ String initial = VALUE_PREFIX + index;
+
+ assertFalse(textFile.getLocation().toFile().exists());
+ textFile.create(new ByteArrayInputStream(initial.getBytes()), true, new NullProgressMonitor());
+ assertTrue(textFile.getLocation().toFile().exists());
+
+ assertFalse(textOutputFile.getLocation().toFile().exists());
+ callBuild();
+ assertTrue(textOutputFile.getLocation().toFile().exists());
+
+ assertContents(textOutputFile.getContents(), index);
+
+ setContents(++index);
+ assertContents(textFile.getContents(), index);
+
+ assertContents(textOutputFile.getContents(), 0);
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
+ assertContents(textOutputFile.getContents(), 1);
+ }
+
+ protected String getContents(InputStream is) throws IOException {
+ BufferedInputStream bis = new BufferedInputStream(is);
+ int l = (int)textOutputFile.getLocation().toFile().length();
+ byte[] bs = new byte[l];
+ l = bis.read(bs, 0, l);
+ bis.close();
+ return new String(bs);
+ }
+
+ protected IJavaProject createJavaProject(String name) {
+ try {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(name);
+ project.create(new NullProgressMonitor());
+ project.open(new NullProgressMonitor());
+
+ IProjectDescription description = project.getDescription();
+ String[] natures = description.getNatureIds();
+ String[] newNatures = new String[natures.length + 1];
+ System.arraycopy(natures, 0, newNatures, 0, natures.length);
+ newNatures[natures.length] = JavaCore.NATURE_ID;
+ description.setNatureIds(newNatures);
+ project.setDescription(description, new NullProgressMonitor());
+ IJavaProject javaProject = JavaCore.create(project);
+ Set<IClasspathEntry> entries = new HashSet<IClasspathEntry>();
+ entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
+ entries.add(JavaRuntime.getDefaultJREContainerEntry());
+ IClasspathEntry[] entries2 =
+ entries.toArray(new IClasspathEntry[entries.size()]);
+ javaProject.setRawClasspath(entries2, new NullProgressMonitor());
+ return javaProject;
+ } catch( CoreException ce ) {
+ }
+ return null;
+ }
+
+ protected void setupServer() throws CoreException {
+ pluginMetadata = ASArchivesIntegrationTest.getDefault().getStateLocation();
+ pluginMetadata.toFile().mkdirs();
+ pluginMetadata.append("server1").toFile().mkdirs();
+ deploy = pluginMetadata.append("server1").append("1");
+ deploy.toFile().mkdirs();
+ tempDeploy = pluginMetadata.append("server1").append("2");
+ tempDeploy.toFile().mkdirs();
+
+
+ IRuntimeType[] rtTypes = ServerCore.getRuntimeTypes();
+ IRuntimeType rtType = null;
+ for( int i = 0; i < rtTypes.length; i++ ) {
+ if( rtTypes[i].getId().equals("org.jboss.ide.eclipse.as.runtime.stripped"))
+ rtType = rtTypes[i];
+ }
+ assertNotNull(rtType);
+ IRuntimeWorkingCopy rtwc = rtType.createRuntime("temp.rt.id", new NullProgressMonitor());
+ runtime = rtwc.save(true, new NullProgressMonitor());
+
+ IServerType[] serverTypes = ServerCore.getServerTypes();
+ IServerType serverType = null;
+ for( int i = 0; i < serverTypes.length; i++ ) {
+ if( serverTypes[i].getId().equals("org.jboss.ide.eclipse.as.systemCopyServer"))
+ serverType = serverTypes[i];
+ }
+ assertNotNull(serverType);
+ IServerWorkingCopy wc = serverType.createServer("tmp.server.id", null, new NullProgressMonitor());
+ if( wc instanceof ServerWorkingCopy ) {
+ ServerWorkingCopy swc = (ServerWorkingCopy)wc;
+ swc.setName("server1");
+ swc.setAttribute(DeployableServer.DEPLOY_DIRECTORY, deploy.toOSString());
+ swc.setAttribute(DeployableServer.TEMP_DEPLOY_DIRECTORY, tempDeploy.toOSString());
+ swc.setRuntime(runtime);
+ }
+ server = wc.save(true, new NullProgressMonitor());
+
+ // some asserts
+ assertTrue(ServerCore.getRuntimes().length == 1);
+ assertTrue(ServerCore.getServers().length == 1);
+
+ textDeployedFile = deploy.append(OUT_JAR).append(FILE_NAME).toFile();
+ }
+
+ protected void addArchives() {
+ ArchivesModel.instance().registerProject(project.getLocation(), new NullProgressMonitor());
+ IArchiveModelRootNode root = ArchivesModel.instance().getRoot(project.getLocation());
+ rootArchive = ArchiveNodeFactory.createArchive();
+ rootArchive.setExploded(true);
+ rootArchive.setInWorkspace(true);
+ rootArchive.setName(OUT_JAR);
+ rootArchive.setDestinationPath(null);
+ root.addChild(rootArchive);
+
+ IArchiveFileSet fs = ArchiveNodeFactory.createFileset();
+ fs.setIncludesPattern("**/*txt");
+ fs.setExcludesPattern("**/bin/**, **/*jar*");
+ fs.setInWorkspace(true);
+ fs.setRawSourcePath("/P1");
+ rootArchive.addChild(fs);
+ root.save(new NullProgressMonitor());
+
+ textBuildArchiveFile = project.getFolder(OUT_JAR).getFile(FILE_NAME);
+ }
+
+ protected void changeArchivesDeployPrefs(boolean alwaysPublish, String servers) {
+ rootArchive.setProperty(ArchivesModuleModelListener.DEPLOY_SERVERS, servers);
+ rootArchive.setProperty(ArchivesModuleModelListener.DEPLOY_AFTER_BUILD, new Boolean(alwaysPublish).toString());
+ final IPath projectPath = rootArchive.getProjectPath();
+ ArchivesModel.instance().save(projectPath, new NullProgressMonitor());
+ }
+
+ protected void buildArchive() {
+ Job j = new BuildAction().run(rootArchive);
+ while(j.getResult() == null ) {
+ try {
+ Thread.sleep(100);
+ } catch( InterruptedException ie) {}
+ }
+ assertTrue(j.getResult().isOK());
+ }
+
+ protected void deploy() {
+ ArchivesModuleModelListener.getInstance().publish(rootArchive, server.getId(), IServer.PUBLISH_FULL);
+ }
+
+
+ protected void setContents(int val) throws IOException , CoreException{
+ textFile.setContents(new ByteArrayInputStream(new String(VALUE_PREFIX + (val)).getBytes()), false, false, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ System.out.println("finish setContents");
+ }
+
+ protected void assertContents(InputStream is, int val) throws IOException {
+ String contents = getContents(is);
+ assertEquals(VALUE_PREFIX + val, contents);
+ }
+
+ protected void assertSourceContents(int val) throws IOException, CoreException {
+ assertContents(textFile.getContents(), val);
+ }
+
+ protected void assertBinContents(int val) throws IOException, CoreException {
+ try {
+ Thread.sleep(20000);
+ } catch( InterruptedException ie) {}
+ assertContents(textOutputFile.getContents(), val);
+ }
+
+ protected void assertBuiltArchiveContents(int val) throws IOException, CoreException {
+ assertContents(textBuildArchiveFile.getContents(), val);
+ }
+ protected void assertDeployContents(int val) throws IOException, CoreException {
+ assertContents(new FileInputStream(textDeployedFile), val);
+ }
+
+ protected void callBuild() throws CoreException {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ }
+}
15 years, 9 months