JBoss Tools SVN: r26838 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-23 10:10:36 -0500 (Tue, 23 Nov 2010)
New Revision: 26838
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-7719
https://jira.jboss.org/browse/JBIDE-7719
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-11-23 13:47:38 UTC (rev 26837)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-11-23 15:10:36 UTC (rev 26838)
@@ -21,7 +21,9 @@
import java.util.TreeMap;
import java.util.TreeSet;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IAnnotation;
@@ -55,9 +57,12 @@
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.BeansXMLDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.INodeReference;
/**
@@ -1342,4 +1347,41 @@
return getBeans(attemptToResolveAmbiguousDependency, beanType, qualifiers.toArray(new IType[0]));
}
+
+ /**
+ * For usage in TCK tests which contain many versions of beans.xml in packages.
+ * @param path
+ */
+ public IPath replaceBeanXML(IPath path) {
+ getNature().getDefinitions().newWorkingCopy(false);
+ DefinitionContext context = getNature().getDefinitions().getWorkingCopy();
+
+ Set<BeansXMLDefinition> beanXMLs = context.getBeansXMLDefinitions();
+ Set<IPath> old = new HashSet<IPath>();
+ for (BeansXMLDefinition d: beanXMLs) {
+ IPath p = d.getPath();
+ if(p != null && "beans.xml".equals(p.lastSegment())) {
+ old.add(p);
+ }
+ }
+ for (IPath p: old) context.clean(p);
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if(f != null && f.exists()) {
+ XModelObject beansXML = EclipseResourceUtil.getObjectByResource(f);
+ if(beansXML == null) {
+ beansXML = EclipseResourceUtil.createObjectForResource(f);
+ }
+ if(beansXML != null) {
+ BeansXMLDefinition def = new BeansXMLDefinition();
+ def.setPath(f.getFullPath());
+ def.setBeansXML(beansXML);
+ context.addBeanXML(f.getFullPath(), def);
+ }
+ }
+
+
+ context.applyWorkingCopy();
+ return old.isEmpty() ? null : old.iterator().next();
+ }
+
}
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r26837 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-11-23 08:47:38 -0500 (Tue, 23 Nov 2010)
New Revision: 26837
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7710
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-11-23 12:25:58 UTC (rev 26836)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-11-23 13:47:38 UTC (rev 26837)
@@ -410,54 +410,76 @@
* @param method
* @return
*/
- public static boolean isBusinessMethod(ISessionBean bean, IBeanMethod method) {
+ public static boolean isBusinessOrStaticMethod(ISessionBean bean, IBeanMethod method) {
return getBusinessMethodDeclaration(bean, method)!=null;
}
/**
- * Returns IMethod of @Local interface which is implemented by given business method.
- * Returns null if the method is a non-static method of the session bean class, and the method is not a business method of the session bean.
- * If the method is a static one then returns this method.
+ * Returns the @Local interface for the session bean if it is defined.
*
* @param bean
+ * @return
+ */
+ public static IType getLocalInterfaceForBean(ISessionBean bean) {
+ try {
+ Set<IParametedType> types = bean.getLegalTypes();
+ for (IParametedType type : types) {
+ IType sourceType = type.getType();
+ if (sourceType == null) {
+ continue;
+ }
+ if(!sourceType.isInterface()) {
+ continue;
+ }
+ IAnnotation annotation = sourceType.getAnnotation(CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
+ if (annotation == null) {
+ annotation = sourceType.getAnnotation("Local"); //$NON-NLS-N1
+ }
+ if (annotation != null && CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType, "Local"))) { //$NON-NLS-N1
+ return sourceType;
+ }
+ }
+ return null;
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ return null;
+ }
+
+ /**
+ * Returns IMethod of @Local interface which is implemented by given business method if such an interface is defined.
+ * If such an interface is not define then return then check if the method is static or public, not final and doesn't start with "ejb".
+ * If so then return this method, otherwise return null.
+ *
+ * @param bean
* @param method
* @return
*/
public static IMethod getBusinessMethodDeclaration(ISessionBean bean, IBeanMethod method) {
try {
- if (!Flags.isStatic(method.getMethod().getFlags())) {
+ int flags = method.getMethod().getFlags();
+ if(Flags.isStatic(flags)) {
+ return method.getMethod();
+ } else if (!Flags.isFinal(flags) && Flags.isPublic(flags) && !method.getMethod().getElementName().startsWith("ejb")) {
if(bean.getAnnotation(CDIConstants.SINGLETON_ANNOTATION_TYPE_NAME)!=null) {
return method.getMethod();
}
- Set<IParametedType> types = bean.getLegalTypes();
- for (IParametedType type : types) {
- IType sourceType = type.getType();
- if (sourceType == null) {
- continue;
- }
- if(!sourceType.isInterface()) {
- continue;
- }
- IAnnotation annotation = sourceType.getAnnotation(CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
- if (annotation == null) {
- annotation = sourceType.getAnnotation("Local"); //$NON-NLS-N1
- }
- if (annotation != null && CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType, "Local"))) { //$NON-NLS-N1
- IMethod[] methods = sourceType.getMethods();
- for (IMethod iMethod : methods) {
- if (method.getMethod().isSimilar(iMethod)) {
- return iMethod;
- }
+ IType sourceType = getLocalInterfaceForBean(bean);
+ if(sourceType!=null) {
+ IMethod[] methods = sourceType.getMethods();
+ for (IMethod iMethod : methods) {
+ if (method.getMethod().isSimilar(iMethod)) {
+ return iMethod;
}
- break;
}
+ return null;
}
- return null;
+ return method.getMethod();
}
} catch (JavaModelException e) {
CDICorePlugin.getDefault().logError(e);
}
- return method.getMethod();
+ return null;
}
/**
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-11-23 12:25:58 UTC (rev 26836)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-11-23 13:47:38 UTC (rev 26837)
@@ -879,7 +879,7 @@
String bindedErrorMessage = NLS.bind(errorMessage, new String[]{method.getMethod().getElementName(), bean.getBeanClass().getElementName()});
addError(bindedErrorMessage, preferencesKey, declaration, bean.getResource());
}
- } else {
+ } else if (iMethod != method.getMethod()) {
getValidationContext().addLinkedCoreResource(bean.getSourcePath().toOSString(), iMethod.getResource().getFullPath(), false);
}
}
@@ -1053,7 +1053,7 @@
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{producerMethod.getMethod().getElementName(), producer.getBeanClass().getElementName()});
addError(bindedErrorMessage, CDIPreferences.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, producer.getProducesAnnotation(), producer.getResource());
saveAllSuperTypesAsLinkedResources(classBean);
- } else {
+ } else if (method != producerMethod.getMethod()) {
getValidationContext().addLinkedCoreResource(classBean.getSourcePath().toOSString(), method.getResource().getFullPath(), false);
}
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java 2010-11-23 13:47:38 UTC (rev 26837)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.disposers;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Stateless
+public class WidgetRepositoryProducerOk {
+ // NOTE cannot use producer field because Weld attempts to close EntityManager
+ @PersistenceContext EntityManager em;
+
+ public @Produces EntityManager retrieveEntityManager() {
+ return em;
+ }
+
+ public void disposeEntityManager(@Disposes EntityManager em) {}
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2010-11-23 12:25:58 UTC (rev 26836)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2010-11-23 13:47:38 UTC (rev 26837)
@@ -520,6 +520,19 @@
/**
* 3.3.2. Declaring a producer method
+ * - non-static method of a session bean class is annotated @Produces, and the method is not a business method of the session bean
+ * See https://jira.jboss.org/browse/JBIDE-7710
+ *
+ * @throws Exception
+ */
+ public void testProducerMethodOnSessionBeanMustBeBusinessMethodWithoutLocalInterface() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java");
+ String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{"retrieveEntityManager", "WidgetRepositoryProducerOk"});
+ assertMarkerIsNotCreated(file, bindedErrorMessage, 14);
+ }
+
+ /**
+ * 3.3.2. Declaring a producer method
* - decorator has a method annotated @Produces
*
* @throws Exception
@@ -623,6 +636,19 @@
/**
* 3.3.6. Declaring a disposer method
+ * - a non-static method of a session bean class has a parameter annotated @Disposes, and the method is not a business method of the session bean
+ * See https://jira.jboss.org/browse/JBIDE-7710
+ *
+ * @throws Exception
+ */
+ public void testDisposalMethodNotBusinessOrStaticWithoutLocalInterface() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java");
+ String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"disposeEntityManager", "WidgetRepositoryProducerOk"});
+ assertMarkerIsNotCreated(file, bindedErrorMessage, 18);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
* - decorators may not declare disposer methods
*
* @throws Exception
15 years, 5 months
JBoss Tools SVN: r26836 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-23 07:25:58 -0500 (Tue, 23 Nov 2010)
New Revision: 26836
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
corrected error text
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-23 11:57:10 UTC (rev 26835)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-23 12:25:58 UTC (rev 26836)
@@ -249,7 +249,7 @@
public void loadChildren() throws DeltaCloudException {
DeltaCloudMultiException multiException = new DeltaCloudMultiException(MessageFormat.format(
- "Could not load children from cloud {0}", getName()));
+ "Could not load children of cloud {0}", getName()));
clearImages();
clearInstances();
try {
@@ -431,15 +431,6 @@
}
}
- public DeltaCloudInstance[] destroyInstance(String instanceId) throws DeltaCloudException {
- DeltaCloudInstance instance = getInstance(instanceId);
- performInstanceAction(instance, DeltaCloudInstance.DESTROY);
- instances.remove(instance);
- // TODO: remove notification with all instances, replace by notifying
- // the changed instance
- return notifyInstanceListListeners();
- }
-
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
try {
client.createKey(keyname, keystoreLocation);
15 years, 5 months
JBoss Tools SVN: r26835 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-23 06:57:10 -0500 (Tue, 23 Nov 2010)
New Revision: 26835
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7695] added check against <code>null</code> server type. fixed NPE that occurred when nonsense url was entered in connection wizard
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-23 11:02:55 UTC (rev 26834)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-23 11:57:10 UTC (rev 26835)
@@ -1,3 +1,10 @@
+2010-11-23 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
+ (performFinish):
+ (getServerType):
+ [JBIDE-7695] added check against <code>null</code> server type. fixed NPE that occurred when nonsense url was entered in connection wizard
+
2010-11-19 André Dietisheim <adietish(a)redhat.com>
* plugin.xml:
15 years, 5 months
JBoss Tools SVN: r26834 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-23 06:02:55 -0500 (Tue, 23 Nov 2010)
New Revision: 26834
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-7695] added check against <code>null</code> server type. fixed NPE that occurred when nonsense url was entered in connection wizard
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2010-11-23 10:23:17 UTC (rev 26833)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2010-11-23 11:02:55 UTC (rev 26834)
@@ -19,6 +19,7 @@
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientImpl.DeltaCloudServerType;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
public class NewCloudConnectionWizard extends Wizard implements INewWizard, CloudConnection {
@@ -67,7 +68,7 @@
String url = mainPage.getModel().getUrl();
String username = mainPage.getModel().getUsername();
String password = mainPage.getModel().getPassword();
- String type = mainPage.getModel().getType().toString();
+ String type = getServerType();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password, type);
DeltaCloudManager.getDefault().addCloud(newCloud);
@@ -80,6 +81,15 @@
return true;
}
+ private String getServerType() {
+ DeltaCloudServerType type = mainPage.getModel().getType();
+ if (type == null) {
+ return null;
+ }
+
+ return type.toString();
+ }
+
@Override
public boolean needsProgressMonitor() {
return true;
15 years, 5 months
JBoss Tools SVN: r26833 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-11-23 05:23:17 -0500 (Tue, 23 Nov 2010)
New Revision: 26833
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java
Log:
Fixed DB requirement sql script reading
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java 2010-11-23 09:49:01 UTC (rev 26832)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java 2010-11-23 10:23:17 UTC (rev 26833)
@@ -95,6 +95,7 @@
fail("Can't read script" + file.getAbsolutePath());
}
builder.append(line);
+ builder.append(System.getProperty("line.separator"));
}
return builder;
}
15 years, 5 months
JBoss Tools SVN: r26832 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-11-23 04:49:01 -0500 (Tue, 23 Nov 2010)
New Revision: 26832
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
Log:
Updated info related to DB requirements
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties 2010-11-23 09:11:25 UTC (rev 26831)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties 2010-11-23 09:49:01 UTC (rev 26832)
@@ -12,5 +12,11 @@
#DB Definition
#DB=<db_type>,<version>,<driver_path>,<jdbc_string>,<username>,[<password>,<scriptpath>]
#Supported types: hsqldb18, db2_97, mssql2005, mssql2008, mysql50, mysql51, oracle10g, oracle11gR1, oracle11gR1RAC, oracle11gR2, oracle11gR2RAC, postgresql82, postgresql83, postgresql84, sybase15
-#For internal: hsqldb18
-DB=hsqldb18,1.8,/home/user/lib/hsqldb/lib/hsqldb.jar,jdbc\:hsqldb\:hsql\://localhost\:8001/xdb,sa,,
+#For internal: use "hsqldb18" as type and "internal" as a version
+#Internal DB example (driver,jdbc,user,password are ignored)
+#DB=hsqldb18,internal,driver,jdbc,user,,
+#External db example
+#DB=hsqldb18,1.8,/home/username/lib/hsqldb/lib/hsqldb.jar,jdbc:hsqldb:hsql://localhost:8001/xdb,sa,,
+#Connection profile named <db_type>_<version> will be created
+#Annotation usage for TestCase db=@DB
+DB=hsqldb18,internal,driver,jdbc,user,,
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r26831 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: views/server/extensions and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-11-23 04:11:25 -0500 (Tue, 23 Nov 2010)
New Revision: 26831
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
Log:
JBIDE-7613 - explore utils weren't using api's, were instead duplicating code and being inconsistant
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2010-11-23 00:29:08 UTC (rev 26830)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2010-11-23 09:11:25 UTC (rev 26831)
@@ -21,6 +21,7 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -85,15 +86,10 @@
public static String getDeployDirectory(IServer server) {
IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- if (server.getRuntime() != null && deployableServer != null) {
+ if (server != null && deployableServer != null) {
return deployableServer.getDeployFolder();
}
- IServerWorkingCopy swc = server.createWorkingCopy();
- ServerAttributeHelper helper = new ServerAttributeHelper(swc
- .getOriginal(), swc);
- String deployDirectory = helper.getAttribute(
- IDeployableServer.DEPLOY_DIRECTORY, ""); //$NON-NLS-1$
- return deployDirectory.trim();
+ return server.getAttribute(IDeployableServer.DEPLOY_DIRECTORY, "").trim();
}
public static boolean canExplore(IServer server) {
@@ -106,6 +102,13 @@
}
return true;
}
+ public static boolean canExplore(IServer server, IModule[] modules) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ IPath p = PublishUtil.getDeployRootFolder(modules, ds);
+ if (p == null || !p.toFile().exists() || ExploreUtils.getExploreCommand() == null)
+ return false;
+ return true;
+ }
public static void explore(String name) {
File file = new File(name);
@@ -144,28 +147,11 @@
}
public static IPath getDeployPath(IDeployableServer server,IModule[] moduleTree) {
- IPath root = new Path( server.getDeployFolder() );
- String type, name;
- for( int i = 0; i < moduleTree.length; i++ ) {
- type = moduleTree[i].getModuleType().getId();
- name = moduleTree[i].getName();
- if( new Path(name).segmentCount() > 1 )
- // we strongly suspect this is a binary object and not a project
- return root.append(new Path(name).lastSegment());
- if( "jst.ear".equals(type)) //$NON-NLS-1$
- root = root.append(name + ".ear"); //$NON-NLS-1$
- else if( "jst.web".equals(type)) //$NON-NLS-1$
- root = root.append(name + ".war"); //$NON-NLS-1$
- else if( "jst.utility".equals(type) && i >= 1 && "jst.web".equals(moduleTree[i-1].getModuleType().getId())) //$NON-NLS-1$ //$NON-NLS-2$
- root = root.append("WEB-INF").append("lib").append(name + ".jar"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else if( "jst.connector".equals(type)) { //$NON-NLS-1$
- root = root.append(name + ".rar"); //$NON-NLS-1$
- } else if( "jst.jboss.esb".equals(type)){ //$NON-NLS-1$
- root = root.append(name + ".esb"); //$NON-NLS-1$
- }else
- root = root.append(name + ".jar"); //$NON-NLS-1$
+ IPath p = PublishUtil.getDeployRootFolder(moduleTree, server);
+ if( !PublishUtil.isBinaryObject(moduleTree)) {
+ return PublishUtil.getDeployPath(moduleTree, server);
}
- return root;
+ return p;
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2010-11-23 00:29:08 UTC (rev 26830)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2010-11-23 09:11:25 UTC (rev 26831)
@@ -7,7 +7,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -26,12 +25,8 @@
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
-import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
@@ -197,28 +192,8 @@
private IPath getDeployPath() {
ModuleServer ms = selection[0];
IModule[] module = ms.module;
- IJBossServerPublisher publisher = ExtensionManager.getDefault()
- .getPublisher(ms.getServer(), module, "local");
- IPath path = null;
- IDeployableServer deployableServer = ServerConverter
- .getDeployableServer(ms.server);
- if (deployableServer != null) {
- if (publisher instanceof JstPublisher) {
- path = ExploreUtils.getDeployPath(deployableServer,
- module);
- } else if (publisher instanceof SingleFilePublisher) {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module[0].loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if (delegate != null) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- IPath destFolder = new Path(deployableServer.getDeployFolder());
- path = destFolder.append(sourcePath.lastSegment());
- } else {
- path = new Path(deployableServer.getDeployFolder());
- }
- } else {
- path = new Path(deployableServer.getDeployFolder());
- }
- }
+ IDeployableServer deployableServer = ServerConverter.getDeployableServer(ms.server);
+ IPath path = ExploreUtils.getDeployPath(deployableServer, module);
return path;
}
}
15 years, 5 months
JBoss Tools SVN: r26830 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-11-22 19:29:08 -0500 (Mon, 22 Nov 2010)
New Revision: 26830
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
Log:
https://jira.jboss.org/browse/JBIDE-7711 VpeUiTests blocks tests execution and is usually killed by timeout
CustomSashFormTest commented out
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-11-22 21:02:45 UTC (rev 26829)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-11-23 00:29:08 UTC (rev 26830)
@@ -29,7 +29,7 @@
suite.addTestSuite(VpeCommandsTests.class);
suite.addTestSuite(VpeResourcesDialogTest.class);
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
- suite.addTestSuite(CustomSashFormTest.class);
+ //suite.addTestSuite(CustomSashFormTest.class);
//suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
return new VpeTestSetup(suite);
15 years, 5 months
JBoss Tools SVN: r26829 - in trunk/maven/plugins: org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-11-22 16:02:45 -0500 (Mon, 22 Nov 2010)
New Revision: 26829
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
Log:
JBIDE-7699 Mavenized Seam Project ignores changing name of ear, ejb and/or test project
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2010-11-22 20:01:56 UTC (rev 26828)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2010-11-22 21:02:45 UTC (rev 26829)
@@ -404,7 +404,7 @@
build.getResources().add(resource);
}
- public static void addMavenEarPlugin(Build build, IProject project, IDataModel m2FacetModel, boolean addModule) throws JavaModelException {
+ public static void addMavenEarPlugin(Build build, IProject project, IDataModel m2FacetModel, String ejbArtifactId, boolean addModule) throws JavaModelException {
String sourceDirectory = getEarRoot(project);
build.setSourceDirectory(sourceDirectory);
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
@@ -429,14 +429,15 @@
Xpp3Dom modules = new Xpp3Dom("modules"); //$NON-NLS-1$
configuration.addChild(modules);
- String ejbModuleName = m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID) + "-ejb.jar"; //$NON-NLS-1$
- Xpp3Dom ejbProject = getEarModule(
- "ejbModule", //$NON-NLS-1$
- m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
- m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID)
- + "-ejb", "/", ejbModuleName ); //$NON-NLS-1$ //$NON-NLS-2$
- modules.addChild(ejbProject);
-
+ if (ejbArtifactId != null) {
+ String ejbModuleName = ejbArtifactId + ".jar"; //$NON-NLS-1$
+ Xpp3Dom ejbProject = getEarModule(
+ "ejbModule", //$NON-NLS-1$
+ m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
+ ejbArtifactId, "/", ejbModuleName); //$NON-NLS-1$
+ modules.addChild(ejbProject);
+ }
+
Xpp3Dom seamModule = getEarModule("ejbModule", "org.jboss.seam", //$NON-NLS-1$ //$NON-NLS-2$
"jboss-seam", "/", null); //$NON-NLS-1$ //$NON-NLS-2$
modules.addChild(seamModule);
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2010-11-22 20:01:56 UTC (rev 26828)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2010-11-22 21:02:45 UTC (rev 26829)
@@ -100,7 +100,7 @@
if (fpwc
.hasProjectFacet(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET)) {
MavenCoreActivator.addMavenEarPlugin(build, project,
- config, false);
+ config, null, false);
MavenCoreActivator.createMavenProject(project.getName(),
monitor, model, true);
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2010-11-22 20:01:56 UTC (rev 26828)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2010-11-22 21:02:45 UTC (rev 26829)
@@ -75,12 +75,6 @@
private static final String ORG_CODEHAUS_MOJO = "org.codehaus.mojo"; //$NON-NLS-1$
- private static final String TEST_SUFFIX = "-test"; //$NON-NLS-1$
-
- private static final String EJB_SUFFIX = "-ejb"; //$NON-NLS-1$
-
- private static final String EAR_SUFFIX = "-ear"; //$NON-NLS-1$
-
private static final String PARENT_SUFFIX = "-parent"; //$NON-NLS-1$
// The plug-in ID
@@ -149,12 +143,12 @@
groupId = m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID);
parentProjectName = webProjectName + PARENT_SUFFIX;
parentArtifactId = artifactId + PARENT_SUFFIX;
- testProjectName = webProjectName + TEST_SUFFIX;
- testArtifactId = artifactId + TEST_SUFFIX;
- earProjectName = webProjectName + EAR_SUFFIX;
- earArtifactId = artifactId + EAR_SUFFIX;
- ejbProjectName = webProjectName + EJB_SUFFIX;
- ejbArtifactId = artifactId + EJB_SUFFIX;
+ testProjectName = seamFacetModel.getStringProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT);
+ testArtifactId = testProjectName;
+ earProjectName = seamFacetModel.getStringProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT);
+ earArtifactId = earProjectName;
+ ejbProjectName = seamFacetModel.getStringProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT);;
+ ejbArtifactId = ejbProjectName;
configureParentProject(m2FacetModel, seamFacetModel);
configureWarProject(m2FacetModel, seamFacetModel);
configureTestProject(m2FacetModel, seamFacetModel);
@@ -482,7 +476,7 @@
build.setSourceDirectory(sourceDirectory);
}
build.setOutputDirectory("target/classes"); //$NON-NLS-1$
- MavenCoreActivator.addMavenEarPlugin(build, project, m2FacetModel, true);
+ MavenCoreActivator.addMavenEarPlugin(build, project, m2FacetModel, ejbArtifactId, true);
model.setBuild(build);
MavenCoreActivator.createMavenProject(earProjectName, null, model, true);
removeWTPContainers(m2FacetModel, project);
15 years, 5 months