JBoss Tools SVN: r38509 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:47:47 -0500 (Wed, 08 Feb 2012)
New Revision: 38509
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
Log:
Removing waiting for non ignored jobs
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java 2012-02-08 14:46:08 UTC (rev 38508)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java 2012-02-08 14:47:47 UTC (rev 38509)
@@ -45,7 +45,6 @@
public void waitForJobs() {
editResourceUtil.deletePackage(getProjectName(), getPackageName());
editResourceUtil.deleteWebFolder(getProjectName(), WEB_FOLDER);
- util.waitForNonIgnoredJobs();
}
@Test
14 years, 2 months
JBoss Tools SVN: r38508 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:46:08 -0500 (Wed, 08 Feb 2012)
New Revision: 38508
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
Log:
Modifying to not use sleep + use labels from ui.bot.ext
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2012-02-08 14:45:13 UTC (rev 38507)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2012-02-08 14:46:08 UTC (rev 38508)
@@ -23,11 +23,11 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIBase;
import org.jboss.tools.cdi.bot.test.editor.BeansEditorTest;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.TreeHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
public class EditorResourceHelper extends CDIBase {
@@ -134,17 +134,16 @@
*/
public void moveFileInProjectExplorer(String file, String sourceFolder, String destFolder) {
SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = projectExplorer.selectTreeItem(file, sourceFolder.split("/"));
+
+ bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.MOVE).click();
+ bot.waitForShell(IDELabel.Shell.MOVE_RESOURCES);
- NodeContextUtil.nodeContextMenu(tree, item, "Move...").click();
-
- bot.sleep(Timing.time2S());
tree = bot.tree();
tree.collapseNode(destFolder.split("/")[0]);
TreeHelper.expandNode(bot, destFolder.split("/")).select();
- bot.button("OK").click();
+ bot.button(IDELabel.Button.OK).click();
}
/**
@@ -181,32 +180,12 @@
*/
public void deleteFolderInProjectExplorer(String folderName, String... path) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = projectExplorer.selectTreeItem(folderName, path);
+ projectExplorer.selectTreeItem(folderName, path);
- NodeContextUtil.nodeContextMenu(tree, item, "Delete").click();
- bot.sleep(Timing.time3S());
- bot.shell("Confirm Delete").bot().button("OK").click();
+ bot.menu(IDELabel.Menu.EDIT).menu(IDELabel.Menu.DELETE).click();
+ bot.waitForShell(IDELabel.Shell.CONFIRM_DELETE);
+ bot.shell(IDELabel.Shell.CONFIRM_DELETE).bot().button(IDELabel.Button.OK).click();
}
-
- /**
- * Method removes the object which is located in "sourceFolder"
- * is deleted
- * @param object
- * @param sourceFolder
- */
- public void removeObjectInProjectExplorer(String object, String sourceFolder) {
- SWTBotTree tree = projectExplorer.bot().tree();
- SWTBotTreeItem item = projectExplorer.selectTreeItem(object, sourceFolder.split("/"));
-
- NodeContextUtil.nodeContextMenu(tree, item, "Delete").click();
-
- assertTrue(bot.button("OK").isEnabled());
-
- bot.button("OK").click();
-
- bot.sleep(Timing.time3S());
- }
/**
* Methods converts input stream to string component
14 years, 2 months
JBoss Tools SVN: r38507 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:45:13 -0500 (Wed, 08 Feb 2012)
New Revision: 38507
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java
Log:
Modifying to use labels from ui.bot.ext
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java 2012-02-08 14:44:11 UTC (rev 38506)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java 2012-02-08 14:45:13 UTC (rev 38507)
@@ -16,14 +16,10 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
public class SpecifyBeanDialogWizard extends Wizard {
- private static final String ADD = "Add >";
- private static final String ADD_ALL = "Add All >>";
- private static final String REMOVE = "< Remove";
- private static final String REMOVE_ALL = "<< Remove All";
- private static final String EDIT_VALUE = "Edit Value...";
private static final String CREATE_NEW_QUALIFIER = "Create New Qualifier...";
private List<String> availableQualifiers = null;
private List<String> inBeanQualifiers = null;
@@ -36,27 +32,27 @@
}
public SpecifyBeanDialogWizard add() {
- clickButton(ADD);
+ clickButton(IDELabel.Button.ADD_WITH_ARROW);
return this;
}
public SpecifyBeanDialogWizard addAll() {
- clickButton(ADD_ALL);
+ clickButton(IDELabel.Button.ADD_ALL);
return this;
}
public SpecifyBeanDialogWizard remove() {
- clickButton(REMOVE);
+ clickButton(IDELabel.Button.REMOVE_WITH_ARROW);
return this;
}
public SpecifyBeanDialogWizard removeAll() {
- clickButton(REMOVE_ALL);
+ clickButton(IDELabel.Button.REMOVE_ALL);
return this;
}
public SpecifyBeanDialogWizard edit() {
- clickButton(EDIT_VALUE);
+ clickButton(IDELabel.Button.EDIT_VALUE_WITH_DOTS);
return this;
}
@@ -66,27 +62,27 @@
}
public boolean canAdd() {
- return canClick(ADD);
+ return canClickButton(IDELabel.Button.ADD_WITH_ARROW);
}
public boolean canAddAll() {
- return canClick(ADD_ALL);
+ return canClickButton(IDELabel.Button.ADD_ALL);
}
public boolean canRemove() {
- return canClick(REMOVE);
+ return canClickButton(IDELabel.Button.REMOVE_WITH_ARROW);
}
public boolean canRemoveAll() {
- return canClick(REMOVE_ALL);
+ return canClickButton(IDELabel.Button.REMOVE_ALL);
}
public boolean canEdit() {
- return canClick(EDIT_VALUE);
+ return canClickButton(IDELabel.Button.EDIT_VALUE_WITH_DOTS);
}
public boolean canCreateNewQualifier() {
- return canClick(CREATE_NEW_QUALIFIER);
+ return canClickButton(CREATE_NEW_QUALIFIER);
}
public List<String> getAvailableQualifiers() {
14 years, 2 months
JBoss Tools SVN: r38506 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:44:11 -0500 (Wed, 08 Feb 2012)
New Revision: 38506
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java
Log:
Added method to check if button can be clicked + logging for wait conditions in method finishWithWait
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java 2012-02-08 14:42:08 UTC (rev 38505)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/wizards/SWTBotWizard.java 2012-02-08 14:44:11 UTC (rev 38506)
@@ -52,7 +52,7 @@
bot().waitUntil(new ShellIsActiveCondition(activeShell));
return this;
}
-
+
public void cancel() {
clickButton(IDELabel.Button.CANCEL);
}
@@ -64,8 +64,11 @@
public void finishWithWait() {
SWTBotShell activeShell = getActiveShell();
finish();
+ log.info("Waiting until active shell is active");
bot().waitWhile(new ShellIsActiveCondition(activeShell), TaskDuration.LONG.getTimeout());
+ log.info("Waiting until Progress Information Shell is active");
bot().waitWhile(new ProgressInformationShellIsActiveCondition(), TaskDuration.LONG.getTimeout());
+ log.info("Waiting until Non System Jobs run");
bot().waitWhile(new NonSystemJobRunsCondition(), TaskDuration.LONG.getTimeout());
}
@@ -79,6 +82,18 @@
t.setFocus();
t.setText(text);
}
+
+ public boolean canFinish() {
+ return canClickButton(IDELabel.Button.FINISH);
+ }
+
+ public boolean canNext() {
+ return canClickButton(IDELabel.Button.NEXT);
+ }
+
+ protected boolean canClickButton(String buttonText) {
+ return bot().button(buttonText).isEnabled();
+ }
private SWTBotShell getActiveShell(){
for (SWTBotShell shell : bot().shells()){
14 years, 2 months
JBoss Tools SVN: r38505 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:42:08 -0500 (Wed, 08 Feb 2012)
New Revision: 38505
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Added some labels
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2012-02-08 14:34:35 UTC (rev 38504)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2012-02-08 14:42:08 UTC (rev 38505)
@@ -22,6 +22,7 @@
public static final String FILE = "File";
public static final String NEW = "New";
public static final String PROJECT = "Project";
+ public static final String MOVE = "Move...";
public static final String OTHER = "Other...";
public static final String WINDOW = "Window";
public static final String SHOW_VIEW = "Show View";
@@ -111,10 +112,15 @@
public static final String NEW = "New...";
public static final String CONTINUE = "Continue";
public static final String REMOVE = "Remove";
+ public static final String REMOVE_WITH_ARROW = "< Remove";
+ public static final String REMOVE_ALL = "<< Remove All";
public static final String REMOVE_WITH_DOTS = "Remove...";
public static final String EDIT = "Edit...";
public static final String ADD_WITHOUT_DOTS = "Add";
+ public static final String ADD_WITH_ARROW = "Add >";
+ public static final String ADD_ALL = "Add All >>";
public static final String EDIT_WITHOUT_DOTS = "Edit";
+ public static final String EDIT_VALUE_WITH_DOTS = "Edit Value...";
public static final String DROOLS_WORKBENCH = "Drools workbench";
public static final String REFRESH = "Refresh";
public static final String TEST = "Test";
@@ -181,6 +187,7 @@
public static final String NEW_HTML_FILE = "New HTML File";
public static final String ADD_SVN_REPOSITORY = "Add SVN Repository";
public static final String REPOSITORY_LOCATION_PROPERTIES = "Repository Location Properties";
+ public static final String MOVE_RESOURCES = "Move Resources";
public static final String SECURE_STORAGE = "Secure Storage";
public static final String ADD_JSF_PROJECT_TEMPLATE = "Add JSF Project Template";
public static final String NEW_MANAGED_BEAN = "New Managed Bean";
14 years, 2 months
JBoss Tools SVN: r38504 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-08 09:34:35 -0500 (Wed, 08 Feb 2012)
New Revision: 38504
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
Log:
Modifying Wizard to extend SWTBotWizard
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java 2012-02-08 14:15:57 UTC (rev 38503)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java 2012-02-08 14:34:35 UTC (rev 38504)
@@ -12,94 +12,25 @@
package org.jboss.tools.cdi.bot.test.uiutils.wizards;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.wizards.SWTBotWizard;
-public class Wizard extends SWTBotShell {
+public class Wizard extends SWTBotWizard {
- protected static final String NEXT = "Next >";
- protected static final String BACK = "< Back";
- protected static final String CANCEL = "Cancel";
- protected static final String FINISH = "Finish";
-
public Wizard(Shell shell) {
super(shell);
- assert getText().contains("New ");
}
- public Wizard selectTemplate(String... item) {
- assert item.length > 0;
- SWTBotTree tree = bot().tree();
- SWTBotTreeItem ti = null;
- for (int i = 0; i < item.length - 1; i++) {
- ti = ti != null ? ti.expandNode(item[i]).select() : tree.expandNode(item[i]).select();
- }
- if (ti != null) {
- ti.select(item[item.length - 1]);
- } else {
- tree.select(item[item.length - 1]);
- }
- return this;
- }
-
- public Wizard back() {
- clickButton(BACK);
- return this;
- }
-
- public Wizard next() {
- clickButton(NEXT);
- return this;
- }
-
- public void cancel() {
- clickButton(CANCEL);
- }
-
- public void finish() {
- clickButton(FINISH);
- }
-
- public boolean canFinish() {
- return canClick(FINISH);
- }
-
- public boolean canNext() {
- return canClick(NEXT);
- }
-
protected void checkCheckbox(String text) {
bot().checkBoxWithLabel(text).select();
- bot().sleep(Timing.time500MS());
}
protected void uncheckCheckbox(String text) {
bot().checkBoxWithLabel(text).deselect();
- bot().sleep(Timing.time500MS());
}
-
- protected void clickButton(String text) {
- bot().button(text).click();
- bot().sleep(Timing.time500MS());
- }
- protected void setText(String label, String text) {
- SWTBotText t = bot().textWithLabel(label);
- t.setFocus();
- t.setText(text);
- }
-
protected void setTextInCombobox(String combobox, String text) {
- bot().comboBoxWithLabel(combobox).setSelection(text);
- bot().sleep(Timing.time500MS());
+ bot().comboBoxWithLabel(combobox).setSelection(text);
}
-
- protected boolean canClick(String button) {
- return bot().button(button).isEnabled();
- }
protected boolean canCheckInCombobox(String combobox, String text) {
for (int i = 0; i < bot().comboBoxWithLabel(combobox).itemCount(); i++) {
14 years, 2 months
JBoss Tools SVN: r38503 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-08 09:15:57 -0500 (Wed, 08 Feb 2012)
New Revision: 38503
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/ModuleRestartDetectionTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
Log:
JBIDE-10464 - max patch unmodified
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-02-08 14:11:46 UTC (rev 38502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -10,9 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal;
-import java.io.File;
import java.util.HashMap;
import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -23,6 +24,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerListener;
import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
@@ -39,8 +41,31 @@
*/
public class DeployableServerBehavior extends ServerBehaviourDelegate {
+ public static final String ORG_JBOSS_TOOLS_AS_RESTART_FILE_PATTERN = "org.jboss.tools.as.restartFilePattern"; //$NON-NLS-1$
+
+ // kept static to avoid overhead of pattern compilation
+ final private static Pattern defaultFilePattern = Pattern.compile("\\.jar$", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+
+ // contains the pattern to use to recognize if files deployed needs to result in restart
+ // can be set via system property "org.jboss.tools.as.restartFilePattern" but should eventually be made
+ // available via server settings.
+ private Pattern restartFilePattern = null;
+
public DeployableServerBehavior() {
+ String systemPattern = System.getProperty(ORG_JBOSS_TOOLS_AS_RESTART_FILE_PATTERN,null);
+
+ if(systemPattern == null) {
+ restartFilePattern = defaultFilePattern;
+ } else {
+ try {
+ setRestartFilePattern(systemPattern);
+ } catch(PatternSyntaxException pse) {
+ JBossServerCorePlugin.getDefault();
+ JBossServerCorePlugin.log("Could not set restart file pattern to: " + systemPattern, pse); //$NON-NLS-1$
+ }
+ }
}
+
public void stop(boolean force) {
setServerStopped(); // simple enough
@@ -178,6 +203,7 @@
* Much of this can be changed once eclipse bug 231956 is fixed
*/
protected int serverStateVal;
+
protected int getServerStateVal() {
return serverStateVal;
}
@@ -216,11 +242,21 @@
} );
}
- public boolean changedFileRequiresModuleRestart(File file) {
- if( file.getName().toLowerCase().endsWith(".jar")) //$NON-NLS-1$
- return true;
- return false;
+ public boolean changedFileRequiresModuleRestart(IModuleFile file) {
+ if (restartFilePattern != null) {
+ // using find over matches to make it a substring search by default and avoid having to specify .*.class$ instead of just .class$
+ return restartFilePattern.matcher(file.getName()).find();
+ } else {
+ if (file.getName().toLowerCase().endsWith(".jar")) //$NON-NLS-1$
+ return true;
+ return false;
+ }
}
+
+ public void setRestartFilePattern(String filepattern) {
+ this.restartFilePattern = Pattern.compile(filepattern, Pattern.CASE_INSENSITIVE);
+ }
+
/**
* Some projects may request post-processing filtering on
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-02-08 14:11:46 UTC (rev 38502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
-import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -184,11 +183,4 @@
method = createPublishMethod();
DeploymentMarkerUtils.addDoDeployMarker(method, getServer(), paths, monitor);
}
-
- @Override
- public boolean changedFileRequiresModuleRestart(File file) {
- return super.changedFileRequiresModuleRestart(file);
- //return true;
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-02-08 14:11:46 UTC (rev 38502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -69,6 +69,7 @@
protected void markModuleRequiresRestart(IPath deployPath, IModule[] moduleTree,
IJBossServerPublishMethod method, IPublishCopyCallbackHandler handler) throws CoreException {
boolean useAS7Behavior = DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server.getServer());
+ System.out.println("Mark " + deployPath + " for restart"); //$NON-NLS-1$//$NON-NLS-2$
if( !useAS7Behavior) {
// Simply touch the descriptor as needed
JSTPublisherXMLToucher.getInstance().touch(deployPath,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-08 14:11:46 UTC (rev 38502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -55,7 +55,7 @@
monitor.beginTask("Copying " + relativePath.toString(), 100); //$NON-NLS-1$
File file = PublishUtil.getFile(mf);
DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
- shouldRestartModule |= beh.changedFileRequiresModuleRestart(file);
+ shouldRestartModule |= beh.changedFileRequiresModuleRestart(mf);
if( file != null ) {
InputStream in = null;
try {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2012-02-08 14:11:46 UTC (rev 38502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -49,7 +49,7 @@
public IStatus[] copyFile(final IModuleFile mf, final IPath path,
final IProgressMonitor monitor) throws CoreException {
final File file = PublishUtil.getFile(mf);
- shouldRestartModule |= method.getBehaviour().changedFileRequiresModuleRestart(file);
+ shouldRestartModule |= method.getBehaviour().changedFileRequiresModuleRestart(mf);
final IPath remotePath = root.append(path);
final CoreException[] coreEx = new CoreException[1];
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/ModuleRestartDetectionTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/ModuleRestartDetectionTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/ModuleRestartDetectionTest.java 2012-02-08 14:15:57 UTC (rev 38503)
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.test.publishing.v2;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.test.publishing.v2.ModuleRestartDetectionTest.MockFile;
+
+public class ModuleRestartDetectionTest extends TestCase {
+
+ static class MockFile implements IModuleFile {
+
+ String name;
+
+ public MockFile(String name) {
+ this.name = name;
+ }
+
+ public IPath getModuleRelativePath() {
+ return null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public long getModificationStamp() {
+ return 0;
+ }
+
+ }
+
+ private DeployableServerBehavior behavior;
+ private MockFile mixedJar;
+ private MockFile classyjar;
+ private MockFile htmlfile;
+ private MockFile classfile;
+ private MockFile jarfile;
+ private MockFile nodotjar;
+
+ public void testDefaults() {
+
+
+ assertTrue("Default behavior should restart on .jar", behavior.changedFileRequiresModuleRestart(jarfile));
+ assertFalse("Default behavior should not restart on .class", behavior.changedFileRequiresModuleRestart(classfile));
+ assertFalse("Default behavior should not restart on .html", behavior.changedFileRequiresModuleRestart(htmlfile));
+ assertFalse("Default should not restart on file named classy.jarfile", behavior.changedFileRequiresModuleRestart(classyjar));
+ assertFalse("Default should not restart on nodotjar", behavior.changedFileRequiresModuleRestart(nodotjar));
+
+ assertTrue("default behavior should restart on JAr too", behavior.changedFileRequiresModuleRestart(mixedJar));
+
+ }
+
+
+ public void setUp() {
+ behavior = new DeployableServerBehavior();
+
+ jarfile = new MockFile("blah.jar");
+ classfile = new MockFile("blah.class");
+ nodotjar = new MockFile("nodotjar");
+ htmlfile = new MockFile("blah.html");
+ classyjar = new MockFile("myclassy.jarfile");
+ mixedJar = new MockFile("BLAH.JAr");
+ }
+
+ public void testClassEndOfLine() {
+
+ String filepattern = ".class$";
+ behavior.setRestartFilePattern(filepattern);
+
+ assertFalse(filepattern + " should not restart on .jar", behavior.changedFileRequiresModuleRestart(jarfile));
+ assertTrue(filepattern + " should restart on .class", behavior.changedFileRequiresModuleRestart(classfile));
+ assertFalse(filepattern + " should not restart on .html", behavior.changedFileRequiresModuleRestart(htmlfile));
+ assertFalse(filepattern + "Default should not restart on file named classy.jarfile", behavior.changedFileRequiresModuleRestart(classyjar));
+ }
+
+ public void testBasicOr() {
+ String filepattern = ".class|.jar";
+ behavior.setRestartFilePattern(filepattern);
+
+ assertTrue(filepattern + " should restart on .jar", behavior.changedFileRequiresModuleRestart(jarfile));
+ assertTrue(filepattern + " should restart on .class", behavior.changedFileRequiresModuleRestart(classfile));
+ assertFalse(filepattern + " should not restart on .html", behavior.changedFileRequiresModuleRestart(htmlfile));
+ assertTrue(filepattern + " should restart on file named classy.jarfile", behavior.changedFileRequiresModuleRestart(classyjar));
+ assertTrue(filepattern + " behavior should restart on JAr too", behavior.changedFileRequiresModuleRestart(mixedJar));
+ }
+
+ public void testCaseInsensitive() {
+
+ assertTrue(behavior.changedFileRequiresModuleRestart(new MockFile(".jar")));
+
+ assertTrue(behavior.changedFileRequiresModuleRestart(new MockFile(".JAR")));
+
+ behavior.setRestartFilePattern(".jar");
+
+ assertTrue(behavior.changedFileRequiresModuleRestart(new MockFile(".jar")));
+
+ assertTrue(behavior.changedFileRequiresModuleRestart(new MockFile(".JAR")));
+
+ }
+
+ public void testBasicOrEndOfLine() {
+ String filepattern = ".class$|.jar$";
+ behavior.setRestartFilePattern(filepattern);
+
+ assertTrue(filepattern + " should restart on .jar", behavior.changedFileRequiresModuleRestart(jarfile));
+ assertTrue(filepattern + " should restart on .class", behavior.changedFileRequiresModuleRestart(classfile));
+ assertFalse(filepattern + " should not restart on .html", behavior.changedFileRequiresModuleRestart(htmlfile));
+ assertFalse(filepattern + "Default should not restart on file named classy.jarfile", behavior.changedFileRequiresModuleRestart(classyjar));
+
+ }
+
+ public void testSystemProperty() {
+
+ System.setProperty(DeployableServerBehavior.ORG_JBOSS_TOOLS_AS_RESTART_FILE_PATTERN,".blah");
+
+ behavior = new DeployableServerBehavior();
+
+ assertTrue(behavior.changedFileRequiresModuleRestart(new MockFile(".blah")));
+ assertFalse(behavior.changedFileRequiresModuleRestart(new MockFile(".jar")));
+
+ }
+}
14 years, 2 months
JBoss Tools SVN: r38502 - trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-08 09:11:46 -0500 (Wed, 08 Feb 2012)
New Revision: 38502
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
Log:
[JBIDE-10479] implemented EGitUtils#hasRemote(name, url) that reponds whether a repo has a configured remote with the given name and url
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-02-08 14:04:51 UTC (rev 38501)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-02-08 14:11:46 UTC (rev 38502)
@@ -408,13 +408,13 @@
*/
public static PushOperationResult push(String remote, Repository repository, IProgressMonitor monitor)
throws CoreException {
- RemoteConfig remoteConfig = getRemoteConfig(remote, repository);
+ RemoteConfig remoteConfig = getRemoteByName(remote, repository);
return push(repository, remoteConfig, false, monitor);
}
public static PushOperationResult pushForce(String remote, Repository repository, IProgressMonitor monitor)
throws CoreException {
- RemoteConfig remoteConfig = getRemoteConfig(remote, repository);
+ RemoteConfig remoteConfig = getRemoteByName(remote, repository);
return push(repository, remoteConfig, true, monitor);
}
@@ -634,7 +634,7 @@
String currentBranch = getCurrentBranch(repository);
String remote = getRemoteName(currentBranch, repository);
- return getRemoteConfig(remote, repository);
+ return getRemoteByName(remote, repository);
}
/**
@@ -645,7 +645,7 @@
* @return
* @throws CoreException
*/
- private static RemoteConfig getRemoteConfig(String remote, Repository repository) throws CoreException {
+ private static RemoteConfig getRemoteByName(String remote, Repository repository) throws CoreException {
Assert.isLegal(repository != null, "Could not get configuration. No repository provided.");
List<RemoteConfig> allRemotes = getAllRemoteConfigs(repository);
@@ -705,21 +705,20 @@
}
/**
- * Returns <code>true</code> if the given repository has a configured remote
- * repository with an url that matches the given pattern.
+ * Returns the first configured remote in the given repository whose url matches the given pattern.
*
* @param pattern
* @param repository
* @return
* @throws CoreException
*/
- public static boolean hasRemoteUrl(Pattern pattern, Repository repository) throws CoreException {
+ public static RemoteConfig getRemoteByUrl(Pattern pattern, Repository repository) throws CoreException {
for (RemoteConfig config : getAllRemoteConfigs(repository)) {
if (hasRemoteUrl(pattern, config)) {
- return true;
+ return config;
}
}
- return false;
+ return null;
}
public static boolean hasRemoteUrl(Pattern pattern, RemoteConfig config) {
@@ -733,6 +732,21 @@
}
/**
+ * Returns <code>true</code> if the given repository has a remote with the
+ * given name,
+ *
+ * @param name
+ * the remote name that we're looking for
+ * @param repository
+ * the repository to look at
+ * @return true if the given repo has a remote with the given name
+ * @throws CoreException
+ */
+ public static boolean hasRemote(String name, Repository repository) throws CoreException {
+ return getRemoteByName(name, repository) != null;
+ }
+
+ /**
* Returns <code>true</code> if the given repository has a remote config
* with the given name and url.
*
@@ -746,7 +760,7 @@
* @throws CoreException
*/
public static boolean hasRemote(String name, String url, Repository repository) throws CoreException {
- RemoteConfig remoteConfig = getRemoteConfig(name, repository);
+ RemoteConfig remoteConfig = getRemoteByName(name, repository);
if (remoteConfig == null) {
return false;
}
14 years, 2 months
JBoss Tools SVN: r38500 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-08 09:01:09 -0500 (Wed, 08 Feb 2012)
New Revision: 38500
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-1.1.1-SNAPSHOT.jar
Log:
updated to latest client jar (with IDomain#destroy
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-1.1.1-SNAPSHOT.jar
===================================================================
(Binary files differ)
14 years, 2 months