JBoss Tools SVN: r33975 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-16 12:10:33 -0400 (Tue, 16 Aug 2011)
New Revision: 33975
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/.project
Log:
[JBIDE-9522] corrected project name
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/.project
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/.project 2011-08-16 16:01:22 UTC (rev 33974)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/.project 2011-08-16 16:10:33 UTC (rev 33975)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.ide.eclipse.as.egit.internal.ui</name>
+ <name>org.jboss.ide.eclipse.as.egit.ui</name>
<comment></comment>
<projects>
</projects>
14 years, 8 months
JBoss Tools SVN: r33974 - trunk/as/plugins.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-16 12:01:22 -0400 (Tue, 16 Aug 2011)
New Revision: 33974
Modified:
trunk/as/plugins/pom.xml
Log:
[JBIDE-9549] removed until egit plugins are added to the target platform
Modified: trunk/as/plugins/pom.xml
===================================================================
--- trunk/as/plugins/pom.xml 2011-08-16 15:03:57 UTC (rev 33973)
+++ trunk/as/plugins/pom.xml 2011-08-16 16:01:22 UTC (rev 33974)
@@ -24,8 +24,8 @@
<module>org.jboss.ide.eclipse.as.rse.ui</module>
<module>org.jboss.ide.eclipse.as.jmx.integration</module>
<module>org.jboss.ide.eclipse.as.management.as7</module>
- <module>org.jboss.ide.eclipse.as.egit.core</module>
- <module>org.jboss.ide.eclipse.as.egit.ui</module>
+ <!-- <module>org.jboss.ide.eclipse.as.egit.core</module>
+ <module>org.jboss.ide.eclipse.as.egit.ui</module> -->
</modules>
</project>
14 years, 8 months
JBoss Tools SVN: r33973 - in trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core: internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-16 11:03:57 -0400 (Tue, 16 Aug 2011)
New Revision: 33973
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitUtils.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java
Log:
[JBIDE-9512] implemented simple commit method for egit
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitUtils.java (from rev 33972, trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitUtils.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitUtils.java 2011-08-16 15:03:57 UTC (rev 33973)
@@ -0,0 +1,49 @@
+package org.jboss.ide.eclipse.as.egit.core;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.egit.core.op.CommitOperation;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.UserConfig;
+
+public class EgitUtils {
+
+ public static void commit(IProject project) throws CoreException {
+
+ IFile[] commitables = new IFile[] {};
+ Collection<IFile> untracked = Collections.emptyList();
+ Repository repository = getRepository(project);
+ UserConfig userConfig = getUserConfig(repository);
+ CommitOperation op = new CommitOperation(
+ commitables,
+ null, // committables
+ null, // untracked
+ getSubject(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
+ getSubject(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
+ "Initial commit");
+ op.setCommitAll(true);
+ op.setRepository(repository );
+ op.execute(null);
+ }
+
+ private static Repository getRepository(IProject project) {
+ RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project);
+ if (repositoryMapping == null) {
+ return null;
+ }
+ return repositoryMapping.getRepository();
+ }
+
+ private static UserConfig getUserConfig(Repository repository) {
+ return repository.getConfig().get(UserConfig.KEY);
+ }
+
+ private static String getSubject(String name, String email) {
+ return new StringBuilder().append(name).append(" <").append(email).append('>').toString();
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java 2011-08-16 15:03:15 UTC (rev 33972)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java 2011-08-16 15:03:57 UTC (rev 33973)
@@ -1,49 +0,0 @@
-package org.jboss.ide.eclipse.as.egit.core.internal;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.egit.core.op.CommitOperation;
-import org.eclipse.egit.core.project.RepositoryMapping;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.UserConfig;
-
-public class EgitUtils {
-
- public static void commit(IProject project) throws CoreException {
-
- IFile[] commitables = new IFile[] {};
- Collection<IFile> untracked = Collections.emptyList();
- Repository repository = getRepository(project);
- UserConfig userConfig = getUserConfig(repository);
- CommitOperation op = new CommitOperation(
- commitables,
- null, // committables
- null, // untracked
- getSubject(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
- getSubject(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
- "Initial commit");
- op.setCommitAll(true);
- op.setRepository(repository );
- op.execute(null);
- }
-
- private static Repository getRepository(IProject project) {
- RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project);
- if (repositoryMapping == null) {
- return null;
- }
- return repositoryMapping.getRepository();
- }
-
- private static UserConfig getUserConfig(Repository repository) {
- return repository.getConfig().get(UserConfig.KEY);
- }
-
- private static String getSubject(String name, String email) {
- return new StringBuilder().append(name).append(" <").append(email).append('>').toString();
- }
-}
14 years, 8 months
JBoss Tools SVN: r33972 - in trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core: src/org/jboss/ide/eclipse/as/egit/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-16 11:03:15 -0400 (Tue, 16 Aug 2011)
New Revision: 33972
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublisher.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitPublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java
Log:
[JBIDE-9512] implemented simple commit method for egit
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF 2011-08-16 13:05:51 UTC (rev 33971)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/META-INF/MANIFEST.MF 2011-08-16 15:03:15 UTC (rev 33972)
@@ -16,3 +16,6 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
+Export-Package: org.jboss.ide.eclipse.as.egit.core,
+ org.jboss.ide.eclipse.as.egit.core.internal;x-friends:="org.jboss.ide.eclipse.as.egit.test",
+ org.jboss.ide.eclipse.as.egit.core.module
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitBehaviourDelegate.java (from rev 33955, trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitBehaviourDelegate.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitBehaviourDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitBehaviourDelegate.java 2011-08-16 15:03:15 UTC (rev 33972)
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.as.egit.core;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
+
+public class EgitBehaviourDelegate implements IJBossBehaviourDelegate {
+
+ private static final String ID = "egit";
+
+ @Override
+ public String getBehaviourTypeId() {
+ return ID;
+ }
+
+ @Override
+ public void setActualBehaviour(DelegatingServerBehavior actualBehaviour) {
+ }
+
+ @Override
+ public void stop(boolean force) {
+ }
+
+ @Override
+ public void publishStart(IProgressMonitor monitor) throws CoreException {
+ }
+
+ @Override
+ public void publishFinish(IProgressMonitor monitor) throws CoreException {
+ }
+
+ @Override
+ public void onServerStarting() {
+ // do nothing
+ }
+
+ @Override
+ public void onServerStopping() {
+ // do nothing
+ }
+
+ @Override
+ public IStatus canChangeState(String launchMode) {
+ // do nothing
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * remove from interface
+ */
+ @Override
+ public String getDefaultStopArguments() throws CoreException {
+ return null;
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitBehaviourDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublisher.java (from rev 33955, trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitPublisher.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublisher.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublisher.java 2011-08-16 15:03:15 UTC (rev 33972)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as.egit.core;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+
+public class EgitPublisher implements IJBossServerPublisher {
+
+ @Override
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ return false;
+ }
+
+ @Override
+ public int getPublishState() {
+ return 0;
+ }
+
+ @Override
+ public IStatus publishModule(IJBossServerPublishMethod method, IServer server, IModule[] module, int publishType,
+ IModuleResourceDelta[] delta, IProgressMonitor monitor) throws CoreException {
+ return null;
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EgitPublisher.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitBehaviourDelegate.java 2011-08-16 13:05:51 UTC (rev 33971)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitBehaviourDelegate.java 2011-08-16 15:03:15 UTC (rev 33972)
@@ -1,64 +0,0 @@
-package org.jboss.ide.eclipse.as.egit.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
-
-public class EgitBehaviourDelegate implements IJBossBehaviourDelegate {
-
- private static final String ID = "egit";
-
- @Override
- public String getBehaviourTypeId() {
- return ID;
- }
-
- @Override
- public void setActualBehaviour(DelegatingServerBehavior actualBehaviour) {
- }
-
- @Override
- public void stop(boolean force) {
- }
-
- @Override
- public void publishStart(IProgressMonitor monitor) throws CoreException {
- }
-
- @Override
- public void publishFinish(IProgressMonitor monitor) throws CoreException {
- }
-
- @Override
- public void onServerStarting() {
- // do nothing
- }
-
- @Override
- public void onServerStopping() {
- // do nothing
- }
-
- @Override
- public IStatus canChangeState(String launchMode) {
- // do nothing
- return Status.OK_STATUS;
- }
-
- /**
- * remove from interface
- */
- @Override
- public String getDefaultStopArguments() throws CoreException {
- return null;
- }
-
- @Override
- public void dispose() {
- // do nothing
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitPublisher.java 2011-08-16 13:05:51 UTC (rev 33971)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitPublisher.java 2011-08-16 15:03:15 UTC (rev 33972)
@@ -1,30 +0,0 @@
-package org.jboss.ide.eclipse.as.egit.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-
-public class EgitPublisher implements IJBossServerPublisher {
-
- @Override
- public boolean accepts(String method, IServer server, IModule[] module) {
- return false;
- }
-
- @Override
- public int getPublishState() {
- return 0;
- }
-
- @Override
- public IStatus publishModule(IJBossServerPublishMethod method, IServer server, IModule[] module, int publishType,
- IModuleResourceDelta[] delta, IProgressMonitor monitor) throws CoreException {
- return null;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java 2011-08-16 13:05:51 UTC (rev 33971)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/internal/EgitUtils.java 2011-08-16 15:03:15 UTC (rev 33972)
@@ -1,6 +1,5 @@
package org.jboss.ide.eclipse.as.egit.core.internal;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -8,20 +7,43 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.egit.core.op.CommitOperation;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.UserConfig;
public class EgitUtils {
public static void commit(IProject project) throws CoreException {
- IFile[] commitables = new IFile[]{};
+ IFile[] commitables = new IFile[] {};
Collection<IFile> untracked = Collections.emptyList();
+ Repository repository = getRepository(project);
+ UserConfig userConfig = getUserConfig(repository);
CommitOperation op = new CommitOperation(
commitables,
- new ArrayList<IFile>(),
- untracked,
- "dummyAuthor",
- "dummyCommitter",
+ null, // committables
+ null, // untracked
+ getSubject(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
+ getSubject(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
"Initial commit");
+ op.setCommitAll(true);
+ op.setRepository(repository );
op.execute(null);
}
+
+ private static Repository getRepository(IProject project) {
+ RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project);
+ if (repositoryMapping == null) {
+ return null;
+ }
+ return repositoryMapping.getRepository();
+ }
+
+ private static UserConfig getUserConfig(Repository repository) {
+ return repository.getConfig().get(UserConfig.KEY);
+ }
+
+ private static String getSubject(String name, String email) {
+ return new StringBuilder().append(name).append(" <").append(email).append('>').toString();
+ }
}
14 years, 8 months
JBoss Tools SVN: r33971 - trunk/forge/features/org.jboss.tools.forge.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-08-16 09:05:51 -0400 (Tue, 16 Aug 2011)
New Revision: 33971
Modified:
trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
Log:
org.jboss.tools.forge.runtime.ext should be unpacked after installation
Modified: trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
===================================================================
--- trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-08-16 12:42:16 UTC (rev 33970)
+++ trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-08-16 13:05:51 UTC (rev 33971)
@@ -45,7 +45,6 @@
id="org.jboss.tools.forge.runtime.ext"
download-size="0"
install-size="0"
- version="0.0.0"
- unpack="false"/>
+ version="0.0.0"/>
</feature>
14 years, 8 months
JBoss Tools SVN: r33970 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: src/org/jboss/tools/cdi/bot/test and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-08-16 08:42:16 -0400 (Tue, 16 Aug 2011)
New Revision: 33970
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/BrokenFarm.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/Dog.java.cdi
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
Log:
Added new quick fix test and util methods
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/BrokenFarm.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/BrokenFarm.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/BrokenFarm.java.cdi 2011-08-16 12:42:16 UTC (rev 33970)
@@ -0,0 +1,9 @@
+package org.cdi.test;
+
+import javax.inject.Inject;
+
+public class BrokenFarm {
+ @SuppressWarnings("unused")
+ @Inject private Animal animal;
+
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/Dog.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/Dog.java.cdi (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/Dog.java.cdi 2011-08-16 12:42:16 UTC (rev 33970)
@@ -0,0 +1,9 @@
+package org.cdi.test;
+
+public class Dog extends Animal {
+
+ public Dog() {
+
+ }
+
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-08-16 11:51:32 UTC (rev 33969)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-08-16 12:42:16 UTC (rev 33970)
@@ -40,9 +40,10 @@
*/
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
- CdiATWizardTest.class,
- BeansEditorTest.class,
- CDIQuickFixTest.class
+ //CdiATWizardTest.class,
+ CDIQuickFixTest.class,
+ //BeansEditorTest.class
+
})
public class CDIAllBotTests {
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java 2011-08-16 11:51:32 UTC (rev 33969)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/fix/CDIQuickFixTest.java 2011-08-16 12:42:16 UTC (rev 33970)
@@ -4,14 +4,12 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
-import org.jboss.tools.cdi.bot.test.uiutils.actions.NewCDIFileWizard;
import org.jboss.tools.cdi.bot.test.uiutils.actions.NewFileWizardAction;
-import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.DynamicWebProjectWizard;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
@@ -19,6 +17,7 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.junit.Before;
@@ -40,59 +39,142 @@
private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
private static final String PROJECT_NAME = "CDIProject";
private static final String PACKAGE_NAME = "org.cdi.test";
- private static final String BEAN_NAME = "B1";
-
@Before
public void setUp() {
eclipse.showView(ViewType.PROJECT_EXPLORER);
}
-
+
@Test
- public void testSerializableQF() {
- new NewFileWizardAction().run()
- .selectTemplate("Web", "Dynamic Web Project").next();
- new DynamicWebProjectWizard().setProjectName(PROJECT_NAME).finish();
- util.waitForNonIgnoredJobs();
- SWTBot v = eclipse.showView(ViewType.PROJECT_EXPLORER);
- SWTBotTree tree = v.tree();
- tree.setFocus();
- assertTrue("Project " + PROJECT_NAME + " was not created properly.",
- SWTEclipseExt.treeContainsItemWithLabel(tree, PROJECT_NAME));
- SWTBotTreeItem item = tree.getTreeItem(PROJECT_NAME);
- item.expand();
-
- CDIUtil.addCDISupport(tree, item, bot, util);
-
- new NewCDIFileWizard(CDIWizardType.BEAN).run().setPackage(PACKAGE_NAME)
- .setName(BEAN_NAME).finish();
+ public void testSerializableQF() {
+ createAndCheckCDIProject();
+ CDIUtil.bean(PACKAGE_NAME, "B1", true, false, false, false, null, null,
+ null, null).finish();
util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = bot.activeEditor();
+ assertTrue(("B1.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ LOGGER.fine(code);
+ assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
+ assertTrue(code.contains("public class B1 {"));
- SWTBotEditor ed = bot.editorByTitle(BEAN_NAME + ".java");
- assertNotNull("Bean: " + BEAN_NAME + " was not created properly.", ed);
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/B1.java.cdi"), false);
+ assertContains("@SessionScoped", ed.toTextEditor().getText());
+ SWTEclipseExt.showView(bot, ViewType.PROBLEMS);
+ bot.sleep(3 * TIME_1S);
+ SWTBotTreeItem[] warningTrees = ProblemsView.
+ getFilteredWarningsTreeItems(bot, "Managed bean B1 which", "/"
+ + PROJECT_NAME, "B1.java", "CDI Problem");
+ assertTrue("Warnings node should contain only one record instead of "
+ + warningTrees.length + " records.", warningTrees.length == 1);
+ CDIUtil.resolveQuickFix(bot.tree(), warningTrees[0], bot, util);
+ SWTBotEclipseEditor eclEditor = ed.toTextEditor();
+ assertTrue("Quick fix does not resolve issue properly.", eclEditor
+ .getText().contains("import java.io.Serializable;"));
+ warningTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
+ "Managed bean B1 which", "/" + PROJECT_NAME, "B1.java",
+ "CDI Problem");
+ assertTrue("Warnings should not contain resolved problem.",
+ warningTrees.length == 0);
+ }
+
+ @Test
+ public void testMultipleBeansQF() {
+ CDIUtil.bean(PACKAGE_NAME, "Animal", true, false, false, false, null,
+ null, null, null).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = bot.activeEditor();
+ assertTrue(("Animal.java").equals(ed.getTitle()));
+ String code = ed.toTextEditor().getText();
+ assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
+ assertTrue(code.contains("public class Animal {"));
+
+ CDIUtil.bean(PACKAGE_NAME, "Dog", true, false, false, false, null,
+ null, null, null).finish();
+ util.waitForNonIgnoredJobs();
+ ed = bot.activeEditor();
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/" + BEAN_NAME + ".java.cdi"), false);
- assertContains("@SessionScoped",ed.toTextEditor().getText());
-
+ .getResourceAsStream("/resources/cdi/Dog.java.cdi"), false);
+ assertTrue(("Dog.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ LOGGER.fine(code);
+ assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
+ assertTrue(code.contains("public class Dog extends Animal {"));
+
+ CDIUtil.qualifier(PACKAGE_NAME, "Q1", false, false).finish();
+ util.waitForNonIgnoredJobs();
+ ed = bot.activeEditor();
+ assertTrue(("Q1.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ LOGGER.fine(code);
+
+ JavaClassEntity brokenFarm = new JavaClassEntity();
+ brokenFarm.setClassName("BrokenFarm");
+ brokenFarm.setPackageName(PACKAGE_NAME);
+ eclipse.createJavaClass(brokenFarm);
+ ed = bot.activeEditor();
+ CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
+ .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
+ false);
+ assertTrue(("BrokenFarm.java").equals(ed.getTitle()));
+ code = ed.toTextEditor().getText();
+ LOGGER.fine(code);
+ assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
+ assertTrue(code.contains("public class BrokenFarm {"));
+ assertTrue(code.contains("@Inject private Animal animal;"));
+
SWTEclipseExt.showView(bot, ViewType.PROBLEMS);
bot.sleep(3 * TIME_1S);
+ SWTBotTreeItem[] warningTrees = ProblemsView
+ .getFilteredWarningsTreeItems(bot, "Multiple beans are eligible", "/"
+ + PROJECT_NAME, "BrokenFarm.java", "CDI Problem");
+ assertTrue("Warnings node should contain only one record instead of "
+ + warningTrees.length + " records.", warningTrees.length == 1);
+ CDIUtil.resolveQuickFix(bot.tree(), warningTrees[0], bot, util);
+ assertFalse("No qualifier has been chosen, Add button should not be active",
+ bot.button("Add >").isEnabled());
+ assertFalse("No qualifier has been chosen, Finish button should not be active",
+ bot.button("Finish").isEnabled());
+ SWTBotTable table = bot.table(0);
+ table.click(table.indexOf("Q1 - " + PACKAGE_NAME), 0);
+ assertTrue("Qualifier has been chosen, Add button should be active",
+ bot.button("Add >").isEnabled());
+ assertFalse("No qualifier has been chosen, Finish button should not be active",
+ bot.button("Finish").isEnabled());
+ bot.clickButton("Add >");
+ assertTrue("Qualifier has been chosen, Finish button should be active",
+ bot.button("Finish").isEnabled());
+ bot.clickButton("Finish");
- SWTBotTreeItem[] warningTrees = ProblemsView.getFilteredWarningsTreeItems(bot, "Managed bean B1 which",
- "/" + PROJECT_NAME , BEAN_NAME + ".java", "CDI Problem");
-
- assertNotNull("Warnings node should contain the expected problem.", warningTrees);
- assertTrue("Warnings node should contain only one record instead of " + warningTrees.length + " records.",
- warningTrees.length == 1);
-
- CDIUtil.resolveQuickFix(bot.tree(), warningTrees[0], bot, util);
-
- SWTBotEclipseEditor eclEditor = ed.toTextEditor();
- assertTrue("Quick fix does not resolve issue properly.",
- eclEditor.getText().contains("import java.io.Serializable;"));
- warningTrees = ProblemsView.getFilteredWarningsTreeItems(bot, "Managed bean B1 which",
- "/" + PROJECT_NAME , BEAN_NAME + ".java", "CDI Problem");
- assertTrue("Warnings should not contain resolved problem.", warningTrees.length == 0);
- }
+ bot.sleep(2*TIME_1S);
+ util.waitForNonIgnoredJobs();
+ code = ed.toTextEditor().getText();
+ assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
+ code = bot.editorByTitle("Dog.java").toTextEditor().getText();
+ assertTrue(code.contains("@Q1"));
+ warningTrees = ProblemsView
+ .getFilteredWarningsTreeItems(bot, "Multiple beans are eligible", "/"
+ + PROJECT_NAME, "BrokenFarm.java", "CDI Problem");
+ assertTrue("Warnings node should not contain resolved problem.", warningTrees.length == 0);
+ }
+
+ private void createAndCheckCDIProject() {
+ createCDIProject();
+ SWTBotTree tree = bot.tree();
+ assertTrue("Project " + PROJECT_NAME + " was not created properly.",
+ SWTEclipseExt.treeContainsItemWithLabel(tree, PROJECT_NAME));
+ SWTBotTreeItem item = tree.getTreeItem(PROJECT_NAME);
+ item.expand();
+ CDIUtil.addCDISupport(tree, item, bot, util);
+ }
+
+ private void createCDIProject() {
+ new NewFileWizardAction().run()
+ .selectTemplate("Web", "Dynamic Web Project").next();
+ new DynamicWebProjectWizard().setProjectName(PROJECT_NAME).finish();
+ util.waitForNonIgnoredJobs();
+ }
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-16 11:51:32 UTC (rev 33969)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-16 12:42:16 UTC (rev 33970)
@@ -10,6 +10,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizard;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardType;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
@@ -18,17 +20,15 @@
public static void addCDISupport(final SWTBotTree tree, SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
- nodeContextMenu(tree, item, "Configure",
- "Add CDI (Context and Dependency Injection) support...")
- .click();
+ nodeContextMenu(tree, item,
+ "Configure","Add CDI (Context and Dependency Injection) support...").click();
bot.activeShell().bot().button("OK").click();
bot.sleep(2000);
util.waitForNonIgnoredJobs();
}
public static void resolveQuickFix(final SWTBotTree tree, SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
- nodeContextMenu(bot.tree(), item, "Quick Fix")
- .click();
+ nodeContextMenu(bot.tree(), item, "Quick Fix").click();
bot.activeShell().bot().button("Finish").click();
bot.sleep(2000);
util.waitForNonIgnoredJobs();
@@ -61,10 +61,108 @@
});
}
+ public static CDIWizard qualifier(String pkg, String name, boolean inherited,
+ boolean comments) {
+ return create(CDIWizardType.QUALIFIER, pkg, name, inherited, comments);
+ }
+
+
+ public static CDIWizard scope(String pkg, String name, boolean inherited,
+ boolean comments, boolean normalScope, boolean passivating) {
+ CDIWizard w = create(CDIWizardType.SCOPE, pkg, name, inherited,
+ comments);
+ w = w.setNormalScope(normalScope);
+ return normalScope ? w.setPassivating(passivating) : w;
+ }
+
+
+ public static CDIWizard binding(String pkg, String name, String target,
+ boolean inherited, boolean comments) {
+ CDIWizard w = create(CDIWizardType.INTERCEPTOR_BINDING, pkg, name,
+ inherited, comments);
+ return target != null ? w.setTarget(target) : w;
+ }
+
+
+ public static CDIWizard stereotype(String pkg, String name, String scope,
+ String target, boolean inherited, boolean named,
+ boolean alternative, boolean comments) {
+ CDIWizard w = create(CDIWizardType.STEREOTYPE, pkg, name, inherited,
+ comments).setAlternative(alternative).setNamed(named);
+ if (scope != null) {
+ w = w.setScope(scope);
+ }
+ return target != null ? w.setTarget(target) : w;
+ }
+
+
+ public static CDIWizard decorator(String pkg, String name, String intf, String fieldName,
+ boolean isPublic, boolean isAbstract, boolean isFinal, boolean comments) {
+ CDIWizard w = create(CDIWizardType.DECORATOR, pkg, name, comments);
+ w = w.addInterface(intf).setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract);
+ return fieldName != null ? w.setFieldName(fieldName) : w;
+ }
+
+
+ public static CDIWizard interceptor(String pkg, String name, String ibinding,
+ String superclass, String method, boolean comments) {
+ CDIWizard w = create(CDIWizardType.INTERCEPTOR, pkg, name, comments);
+ if (superclass != null) {
+ w = w.setSuperclass(superclass);
+ }
+ if (method != null) {
+ w = w.setMethodName(method);
+ }
+ return w.addIBinding(ibinding);
+ }
+
+
+ public static CDIWizard bean(String pkg, String name, boolean isPublic, boolean isAbstract,
+ boolean isFinal, boolean comments, String named,
+ String interfaces, String scope, String qualifier) {
+ CDIWizard w = create(CDIWizardType.BEAN, pkg, name, comments);
+ if (named != null) {
+ w.setNamed(true);
+ if (!"".equals(named.trim())) {
+ w.setNamedName(named);
+ }
+ }
+ w = w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract);
+ if (interfaces != null && !"".equals(interfaces.trim())) {
+ w.addInterface(interfaces);
+ }
+ if (scope != null && !"".equals(scope.trim())) {
+ w.setScope(scope);
+ }
+ if (qualifier != null && !"".equals(qualifier.trim())) {
+ w.addQualifier(qualifier);
+ }
+ return w;
+ }
+
+ public static CDIWizard annLiteral(String pkg, String name, boolean isPublic, boolean isAbstract,
+ boolean isFinal, boolean comments, String qualifier) {
+ assert qualifier != null && !"".equals(qualifier.trim()) : "Qualifier has to be set";
+ CDIWizard w = create(CDIWizardType.ANNOTATION_LITERAL, pkg, name, comments);
+ return w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract).addQualifier(qualifier);
+ }
+
+ private static CDIWizard create(CDIWizardType type, String pkg, String name,
+ boolean inherited, boolean comments) {
+ return create(type, pkg, name, comments).setInherited(inherited);
+ }
+
+ private static CDIWizard create(CDIWizardType type, String pkg, String name, boolean comments) {
+ CDIWizard p = new NewCDIFileWizard(type).run();
+ return p.setPackage(pkg).setName(name).setGenerateComments(comments);
+ }
+
private static String readStream(InputStream is) {
// we don't care about performance in tests too much, so this should be
// OK
return new Scanner(is).useDelimiter("\\A").next();
}
+
+
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-08-16 11:51:32 UTC (rev 33969)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java 2011-08-16 12:42:16 UTC (rev 33970)
@@ -66,7 +66,7 @@
@Test
public void testQualifier() {
- qualifier("cdi", "Q1", false, false).finish();
+ CDIUtil.qualifier("cdi", "Q1", false, false).finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Q1.java").equals(ed.getTitle()));
@@ -78,7 +78,7 @@
assertFalse(code.contains("@Inherited"));
assertFalse(code.startsWith("/**"));
- qualifier("cdi", "Q2", true, true).finish();
+ CDIUtil.qualifier("cdi", "Q2", true, true).finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Q2.java").equals(ed.getTitle()));
@@ -93,7 +93,7 @@
@Test
public void testScope() {
- scope("cdi", "Scope1", true, false, true, false).finish();
+ CDIUtil.scope("cdi", "Scope1", true, false, true, false).finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope1.java").equals(ed.getTitle()));
@@ -107,7 +107,7 @@
assertTrue(code.contains("@Inherited"));
assertFalse(code.startsWith("/**"));
- scope("cdi", "Scope2", false, true, true, true).finish();
+ CDIUtil.scope("cdi", "Scope2", false, true, true, true).finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope2.java").equals(ed.getTitle()));
@@ -120,7 +120,7 @@
assertFalse(code.contains("@Inherited"));
assertTrue(code.startsWith("/**"));
- scope("cdi", "Scope3", false, true, false, false).finish();
+ CDIUtil.scope("cdi", "Scope3", false, true, false, false).finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("Scope3.java").equals(ed.getTitle()));
@@ -136,7 +136,7 @@
@Test
public void testIBinding() {
- CDIWizard w = binding("cdi", "B1", null, true, false);
+ CDIWizard w = CDIUtil.binding("cdi", "B1", null, true, false);
assertEquals(2, w.getTargets().size());
w.finish();
util.waitForNonIgnoredJobs();
@@ -150,7 +150,7 @@
assertTrue(code.contains("@Inherited"));
assertFalse(code.startsWith("/**"));
- binding("cdi", "B2", "TYPE", false, true).finish();
+ CDIUtil.binding("cdi", "B2", "TYPE", false, true).finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B2.java").equals(ed.getTitle()));
@@ -162,7 +162,7 @@
assertFalse(code.contains("@Inherited"));
assertTrue(code.startsWith("/**"));
- binding("cdi", "B3", "TYPE", false, true).finish();
+ CDIUtil.binding("cdi", "B3", "TYPE", false, true).finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
assertTrue(("B3.java").equals(ed.getTitle()));
@@ -174,7 +174,7 @@
assertFalse(code.contains("@Inherited"));
assertTrue(code.startsWith("/**"));
- w = binding("cdi", "B4", "TYPE", true, false);
+ w = CDIUtil.binding("cdi", "B4", "TYPE", true, false);
w.addIBinding("cdi.B2");
w.finish();
util.waitForNonIgnoredJobs();
@@ -192,7 +192,7 @@
@Test
public void testStereotype() {
- CDIWizard w = stereotype("cdi", "S1", null, null, false, false, false,
+ CDIWizard w = CDIUtil.stereotype("cdi", "S1", null, null, false, false, false,
false);
assertEquals(9, w.getScopes().size());
assertEquals(5, w.getTargets().size());
@@ -210,7 +210,7 @@
assertFalse(code.contains("@Inherited"));
assertFalse(code.startsWith("/**"));
- stereotype("cdi", "S2", "@Scope3", "FIELD", true, true, true, true)
+ CDIUtil.stereotype("cdi", "S2", "@Scope3", "FIELD", true, true, true, true)
.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
@@ -226,7 +226,7 @@
assertTrue(code.contains("@Target({ FIELD })"));
assertTrue(code.startsWith("/**"));
- w = stereotype("cdi", "S3", null, null, false, false, true, false);
+ w = CDIUtil.stereotype("cdi", "S3", null, null, false, false, true, false);
w.addIBinding("cdi.B1");
w.addStereotype("cdi.S1");
w.finish();
@@ -249,7 +249,7 @@
@Test
public void testDecorator() {
- CDIWizard w = decorator("cdi", "", "java.lang.Comparable", null, true, true, false, false);
+ CDIWizard w = CDIUtil.decorator("cdi", "", "java.lang.Comparable", null, true, true, false, false);
w.finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().editorByTitle("ComparableDecorator.java");
@@ -265,7 +265,7 @@
assertFalse(code.contains("final"));
assertFalse(code.startsWith("/**"));
- w = decorator("cdi", "", "java.util.Map", "field", false, false, true, true);
+ w = CDIUtil.decorator("cdi", "", "java.util.Map", "field", false, false, true, true);
w.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().editorByTitle("MapDecorator.java");
@@ -284,7 +284,7 @@
@Test
public void testInterceptor() {
- CDIWizard w = interceptor("cdi", "I1", "B2", null, null, false);
+ CDIWizard w = CDIUtil.interceptor("cdi", "I1", "B2", null, null, false);
w.finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().editorByTitle("I1.java");
@@ -298,7 +298,7 @@
assertFalse(code.contains("final"));
assertFalse(code.startsWith("/**"));
- w = interceptor("cdi", "I2", "B4", "java.util.Date", "sample", true);
+ w = CDIUtil.interceptor("cdi", "I2", "B4", "java.util.Date", "sample", true);
w.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().editorByTitle("I2.java");
@@ -329,7 +329,7 @@
@Test
public void testBean() {
- CDIWizard w = bean("cdi", "Bean1", true, true, false, false, null, null, null, null);
+ CDIWizard w = CDIUtil.bean("cdi", "Bean1", true, true, false, false, null, null, null, null);
w.finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
@@ -342,7 +342,7 @@
assertFalse(code.contains("final"));
assertFalse(code.startsWith("/**"));
- w = bean("cdi", "Bean2", false, false, true, true, "", null, "@Dependent", null);
+ w = CDIUtil.bean("cdi", "Bean2", false, false, true, true, "", null, "@Dependent", null);
w.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
@@ -356,7 +356,7 @@
assertTrue(code.contains("final class Bean2 {"));
assertTrue(code.startsWith("/**"));
- w = bean("cdi", "Bean3", true, false, false, true, "TestedBean", null, "@Scope2", "Q1");
+ w = CDIUtil.bean("cdi", "Bean3", true, false, false, true, "TestedBean", null, "@Scope2", "Q1");
w.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
@@ -374,7 +374,7 @@
@Test
public void testAnnLiteral() {
- CDIWizard w = annLiteral("cdi", "AnnL1", true, false, true, false, "cdi.Q1");
+ CDIWizard w = CDIUtil.annLiteral("cdi", "AnnL1", true, false, true, false, "cdi.Q1");
w.finish();
util.waitForNonIgnoredJobs();
SWTBotEditor ed = new SWTWorkbenchBot().activeEditor();
@@ -387,7 +387,7 @@
assertFalse(code.contains("abstract"));
assertFalse(code.startsWith("/**"));
- w = annLiteral("cdi", "AnnL2", false, true, false, true, "Q2");
+ w = CDIUtil.annLiteral("cdi", "AnnL2", false, true, false, true, "Q2");
w.finish();
util.waitForNonIgnoredJobs();
ed = new SWTWorkbenchBot().activeEditor();
@@ -401,103 +401,4 @@
assertTrue(code.contains("abstract"));
assertTrue(code.startsWith("/**"));
}
-
-
-
- private CDIWizard qualifier(String pkg, String name, boolean inherited,
- boolean comments) {
- return create(CDIWizardType.QUALIFIER, pkg, name, inherited, comments);
- }
-
-
- private CDIWizard scope(String pkg, String name, boolean inherited,
- boolean comments, boolean normalScope, boolean passivating) {
- CDIWizard w = create(CDIWizardType.SCOPE, pkg, name, inherited,
- comments);
- w = w.setNormalScope(normalScope);
- return normalScope ? w.setPassivating(passivating) : w;
- }
-
-
- private CDIWizard binding(String pkg, String name, String target,
- boolean inherited, boolean comments) {
- CDIWizard w = create(CDIWizardType.INTERCEPTOR_BINDING, pkg, name,
- inherited, comments);
- return target != null ? w.setTarget(target) : w;
- }
-
-
- private CDIWizard stereotype(String pkg, String name, String scope,
- String target, boolean inherited, boolean named,
- boolean alternative, boolean comments) {
- CDIWizard w = create(CDIWizardType.STEREOTYPE, pkg, name, inherited,
- comments).setAlternative(alternative).setNamed(named);
- if (scope != null) {
- w = w.setScope(scope);
- }
- return target != null ? w.setTarget(target) : w;
- }
-
-
- private CDIWizard decorator(String pkg, String name, String intf, String fieldName,
- boolean isPublic, boolean isAbstract, boolean isFinal, boolean comments) {
- CDIWizard w = create(CDIWizardType.DECORATOR, pkg, name, comments);
- w = w.addInterface(intf).setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract);
- return fieldName != null ? w.setFieldName(fieldName) : w;
- }
-
-
- private CDIWizard interceptor(String pkg, String name, String ibinding,
- String superclass, String method, boolean comments) {
- CDIWizard w = create(CDIWizardType.INTERCEPTOR, pkg, name, comments);
- if (superclass != null) {
- w = w.setSuperclass(superclass);
- }
- if (method != null) {
- w = w.setMethodName(method);
- }
- return w.addIBinding(ibinding);
- }
-
-
- private CDIWizard bean(String pkg, String name, boolean isPublic, boolean isAbstract,
- boolean isFinal, boolean comments, String named,
- String interfaces, String scope, String qualifier) {
- CDIWizard w = create(CDIWizardType.BEAN, pkg, name, comments);
- if (named != null) {
- w.setNamed(true);
- if (!"".equals(named.trim())) {
- w.setNamedName(named);
- }
- }
- w = w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract);
- if (interfaces != null && !"".equals(interfaces.trim())) {
- w.addInterface(interfaces);
- }
- if (scope != null && !"".equals(scope.trim())) {
- w.setScope(scope);
- }
- if (qualifier != null && !"".equals(qualifier.trim())) {
- w.addQualifier(qualifier);
- }
- return w;
- }
-
- private CDIWizard annLiteral(String pkg, String name, boolean isPublic, boolean isAbstract,
- boolean isFinal, boolean comments, String qualifier) {
- assert qualifier != null && !"".equals(qualifier.trim()) : "Qualifier has to be set";
- CDIWizard w = create(CDIWizardType.ANNOTATION_LITERAL, pkg, name, comments);
- return w.setPublic(isPublic).setFinal(isFinal).setAbstract(isAbstract).addQualifier(qualifier);
- }
-
- private CDIWizard create(CDIWizardType type, String pkg, String name,
- boolean inherited, boolean comments) {
- return create(type, pkg, name, comments).setInherited(inherited);
- }
-
- private CDIWizard create(CDIWizardType type, String pkg, String name, boolean comments) {
- CDIWizard p = new NewCDIFileWizard(type).run();
- return p.setPackage(pkg).setName(name).setGenerateComments(comments);
- }
-
}
14 years, 8 months
JBoss Tools SVN: r33969 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-08-16 07:51:32 -0400 (Tue, 16 Aug 2011)
New Revision: 33969
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Changes for subclipse third party test.
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 2011-08-16 11:35:12 UTC (rev 33968)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-08-16 11:51:32 UTC (rev 33969)
@@ -161,6 +161,9 @@
public static final String ADD_CSS_REFERENCE = "Add CSS Reference";
public static final String NEW_CSS_FILE = "New CSS File";
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 SECURE_STORAGE = "Secure Storage";
}
public class EntityGroup {
@@ -685,5 +688,17 @@
public static final String TEMPLATE_LABEL = "Template*";
public static final String RUNTIME_LABEL = "Runtime*";
public static final String HOME_DIRECTORY_LABEL = "Home Directory";
- }
+ }
+
+ public static class SVNRepositoriesView {
+
+ public static final String ADD_SVN_REPOSITORY_TOOLTIP = "Add SVN Repository";
+
+ }
+
+ public static class AddSVNRepositoryDialog {
+
+ public static final String URL_TEXT_LABEL = "Url:";
+
+ }
}
14 years, 8 months
JBoss Tools SVN: r33968 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-08-16 07:35:12 -0400 (Tue, 16 Aug 2011)
New Revision: 33968
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
Log:
Fix formating of displayed errors in Errors view.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2011-08-16 10:31:53 UTC (rev 33967)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2011-08-16 11:35:12 UTC (rev 33968)
@@ -27,6 +27,7 @@
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
@@ -1287,10 +1288,12 @@
}
return sb.toString();
}
- public static String getFormattedTreeNodeText (SWTBotTree tree, SWTBotTreeItem item){
+ public static String getFormattedTreeNodeText (SWTBotTreeItem item){
StringBuilder stringBuilder = new StringBuilder("");
if (item != null){
+ SWTBotTree tree =
+ new SWTBotTree((Tree)SWTUtilExt.invokeMethodReturnObject(item.widget, "getParent"));
for (int column = 0 ; column < tree.columnCount(); column++){
if (column > 0){
stringBuilder.append(" - ");
@@ -1309,7 +1312,7 @@
}
- public static String getFormattedTreeNodesText (SWTBotTree tree, SWTBotTreeItem[] items){
+ public static String getFormattedTreeNodesText (SWTBotTreeItem[] items){
StringBuilder stringBuilder = new StringBuilder("");
if (items != null){
@@ -1317,7 +1320,7 @@
if (stringBuilder.length() > 0){
stringBuilder.append("\n");
}
- stringBuilder.append(SWTEclipseExt.getFormattedTreeNodeText(tree,item));
+ stringBuilder.append(SWTEclipseExt.getFormattedTreeNodeText(item));
}
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2011-08-16 10:31:53 UTC (rev 33967)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2011-08-16 11:35:12 UTC (rev 33968)
@@ -769,6 +769,28 @@
return result;
}
/**
+ * Invoke method on object and returns result as Object
+ * @param object
+ * @param method
+ * @return
+ */
+ public static Object invokeMethodReturnObject (Object object, String method){
+
+ String result = "<null>";
+
+ try {
+ return SWTUtils.invokeMethod(object, method);
+ } catch (NoSuchMethodException e) {
+ result = "<null>";
+ } catch (IllegalAccessException e) {
+ result = "<null>";
+ } catch (InvocationTargetException e) {
+ result = "<null>";
+ }
+
+ return result;
+ }
+ /**
* Returns location of file within plugin
* @param pluginId
* @param fileName
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-08-16 10:31:53 UTC (rev 33967)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-08-16 11:35:12 UTC (rev 33968)
@@ -299,7 +299,7 @@
assertTrue("There were these errors when editing page "
+ TextEditingActionsTest.TEST_PAGE_NAME
+ ": "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
+ + SWTEclipseExt.getFormattedTreeNodesText(errors),
errors == null || errors.length == 0);
}
}
14 years, 8 months
JBoss Tools SVN: r33967 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-16 06:31:53 -0400 (Tue, 16 Aug 2011)
New Revision: 33967
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java
Log:
[JBIDE-9511] dont push if commit was cancelled
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java 2011-08-16 09:41:07 UTC (rev 33966)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java 2011-08-16 10:31:53 UTC (rev 33967)
@@ -20,19 +20,20 @@
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
- executeCommand(EGIT_COMMIT_COMMAND_ID, selection );
- executeCommand(EGIT_PUSH_COMMAND_ID, selection);
+ if (executeCommand(EGIT_COMMIT_COMMAND_ID, selection )) {
+ executeCommand(EGIT_PUSH_COMMAND_ID, selection);
+ }
return null;
}
- private static void executeCommand(String commandId, ISelection selection) throws ExecutionException {
+ private static boolean executeCommand(String commandId, ISelection selection) throws ExecutionException {
if (!(selection instanceof IStructuredSelection)) {
throw new ExecutionException(NLS.bind("Could not execute command \"{0}\" since there's no valid selection",
commandId));
}
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
try {
- CommandUtils.executeCommand(commandId, structuredSelection);
+ return CommandUtils.executeCommand(commandId, structuredSelection);
} catch (NotDefinedException e) {
throw new ExecutionException(NLS.bind("Could not execute command \"{0}\" since it is not defined",
commandId), e);
14 years, 8 months
JBoss Tools SVN: r33966 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-08-16 05:41:07 -0400 (Tue, 16 Aug 2011)
New Revision: 33966
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-9547
JPA: Can't remove @NamedNativeQuery#resultClass field from ui
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java 2011-08-16 09:32:06 UTC (rev 33965)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java 2011-08-16 09:41:07 UTC (rev 33966)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009-2010 Red Hat, Inc.
+ * Copyright (c) 2009-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,
@@ -57,6 +57,9 @@
@Override
protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
this.subject.setResultClass(value);
}
};
14 years, 8 months