JBoss Tools SVN: r23204 - 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-07-02 15:32:56 -0400 (Fri, 02 Jul 2010)
New Revision: 23204
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
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/errorList.txt
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rule: bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-07-02 19:32:56 UTC (rev 23204)
@@ -46,5 +46,6 @@
defaultPreferences.put(CDIPreferences.INJECTED_INTERCEPTOR, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.MISSING_NONBINDING_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferences.WARNING);
}
}
\ No newline at end of file
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-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-02 19:32:56 UTC (rev 23204)
@@ -30,9 +30,11 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
@@ -543,6 +545,29 @@
ITextSourceReference declaration = param.getAnnotationPosition(CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
if (declaration != null) {
declarations.add(declaration);
+
+ /*
+ * 10.4.2. Declaring an observer method
+ * - bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
+ */
+ if(CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME.equals(bean.getScope().getSourceType().getFullyQualifiedName())) {
+ ICompilationUnit unit = observer.getMethod().getCompilationUnit();
+ if(unit!=null) {
+ try {
+ String source = unit.getSource();
+ ISourceRange unitRange = unit.getSourceRange();
+ int start = declaration.getStartPosition() - unitRange.getOffset();
+ int end = start + declaration.getLength();
+ int position = source.substring(start, end).indexOf("IF_EXISTS");
+ // TODO Shecks if IF_EXISTS as a string. But this string may be in a comment then we will show incorrect error message.
+ if(position>11) {
+ addError(CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, declaration, bean.getResource());
+ }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ }
+ }
}
}
/*
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-07-02 19:32:56 UTC (rev 23204)
@@ -187,7 +187,7 @@
10.4.3. Conditional observer methods
-- bean with scope @Dependent has an observer method declared receive=IF_EXISTS
+- bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
12.1. Bean archives
- bean class is deployed in two different bean archives (Non-Portable behavior)
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-02 19:32:56 UTC (rev 23204)
@@ -55,7 +55,7 @@
STATIC_METHOD_ANNOTATED_INJECT=Static method of a bean is annotated @Inject
MULTIPLE_OBSERVING_PARAMETERS=Method has more than one parameter annotated @Observes
ILLEGAL_OBSERVER_IN_SESSION_BEAN=Non-static method of a session bean class has a parameter annotated @Observes, and the method is not a business method of the EJB
-ILLEGAL_CONDITIONAL_OBSERVER=Bean with scope @Dependent has an observer method declared receive=IF_EXISTS
+ILLEGAL_CONDITIONAL_OBSERVER=Beans with scope @Dependent may not have conditional observer methods [JSR-299 �10.4.3]
BOTH_INTERCEPTOR_AND_DECORATOR=The bean class of a managed bean is annotated with both the @Interceptor and @Decorator stereotypes
SESSION_BEAN_ANNOTATED_INTERCEPTOR=Bean class of a session bean is annotated @Interceptor
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-07-02 19:32:56 UTC (rev 23204)
@@ -95,7 +95,7 @@
{CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_genericMethodAnnotatedInject_label},
{CDIPreferences.MULTIPLE_OBSERVING_PARAMETERS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_multipleObservingParameters_label},
{CDIPreferences.ILLEGAL_OBSERVER_IN_SESSION_BEAN, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalObserverInSessionBean_label},
-// {CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalConditionalObserver_label},
+ {CDIPreferences.ILLEGAL_CONDITIONAL_OBSERVER, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalConditionalObserver_label},
},
CDICorePlugin.PLUGIN_ID
);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-02 19:20:11 UTC (rev 23203)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-02 19:32:56 UTC (rev 23204)
@@ -1389,6 +1389,17 @@
assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
}
+ /**
+ * 10.4.3. Conditional observer methods
+ * - bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
+ *
+ * @throws Exception
+ */
+ public void testDependentBeanWithConditionalObserverMethodIsDefinitionError() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/dependentIsConditionalObserver/AlarmSystem.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
+ }
+
public static int getMarkersNumber(IResource resource) {
return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
}
15 years, 9 months
JBoss Tools SVN: r23203 - in trunk/ws/tests: org.jboss.tools.ws.creation.core.test and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 15:20:11 -0400 (Fri, 02 Jul 2010)
New Revision: 23203
Added:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/requirements.properties
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTestSuite.java
Removed:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
Modified:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/pom.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java
trunk/ws/tests/pom.xml
Log:
ws component maven repo structure updated to match svn repo
creation.core.test are enabled
code coverage are enabled for tests
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF 2010-07-02 19:20:11 UTC (rev 23203)
@@ -30,9 +30,10 @@
org.eclipse.jdt.core,
org.eclipse.ui.console,
org.eclipse.jface.text,
- org.jboss.ide.eclipse.as.classpath.core
+ org.jboss.ide.eclipse.as.classpath.core,
+ org.jboss.ide.eclipse.as.ui;bundle-version="2.1.0",
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="2.1.0"
Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: ws-creation-core-test.jar
Export-Package: org.jboss.tools.ws.creation.core.test,
org.jboss.tools.ws.creation.core.test.command
Bundle-Vendor: %Bundle-Vendor.0
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties 2010-07-02 19:20:11 UTC (rev 23203)
@@ -1,6 +1,7 @@
-source.ws-creation-core-test.jar = src/
-output.ws-creation-core-test.jar = bin/
bin.includes = META-INF/,\
- ws-creation-core-test.jar,\
projects/,\
- plugin.properties
+ plugin.properties,\
+ .
+jars.compile.order = .
+source.. = src/
+output.. = bin/
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/pom.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/pom.xml 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/pom.xml 2010-07-02 19:20:11 UTC (rev 23203)
@@ -7,8 +7,14 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.toolsws.tests</groupId>
<artifactId>org.jboss.tools.ws.creation.core.test</artifactId>
<version>1.0.0</version>
- <packaging>eclipse-plugin</packaging>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <properties>
+ <systemProperties>-Djbosstools.test.jboss.home.4.2=${requirement.build.root}/jboss-soa-p.4.3.0/jboss-as</systemProperties>
+ <emma.filter>org.jboss.tools.ws.creation.core*</emma.filter>
+ <emma.instrument.bundles>org.jboss.tools.ws.creation.core</emma.instrument.bundles>
+ </properties>
</project>
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project 2010-07-02 19:20:11 UTC (rev 23203)
@@ -15,11 +15,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project 2010-07-02 19:20:11 UTC (rev 23203)
@@ -15,11 +15,7 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
+
</buildSpec>
<natures>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project 2010-07-02 19:20:11 UTC (rev 23203)
@@ -20,11 +20,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/requirements.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/requirements.properties (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/requirements.properties 2010-07-02 19:20:11 UTC (rev 23203)
@@ -0,0 +1 @@
+requirements=soap
\ No newline at end of file
Copied: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTestSuite.java (from rev 23130, trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java)
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTestSuite.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTestSuite.java 2010-07-02 19:20:11 UTC (rev 23203)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.creation.core.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.jboss.tools.ws.creation.core.test.command.JBossWSClientCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSClientSampleCreationCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSJavaFirstCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSMergeWebXMLCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSTopDownCommandTest;
+
+public class JBossWSCreationCoreTestSuite extends TestCase {
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core.test";
+ public static Test suite ()
+ {
+ TestSuite suite = new TestSuite(JBossWSCreationCoreTestSuite.class.getName());
+ suite.addTestSuite(JBossWSTopDownCommandTest.class);
+ suite.addTestSuite(JBossWSJavaFirstCommandTest.class);
+ suite.addTestSuite(JBossWSClientCommandTest.class);
+ suite.addTestSuite(JBossWSMergeWebXMLCommandTest.class);
+ suite.addTestSuite(JBossWSClientSampleCreationCommandTest.class);
+ return suite;
+ }
+}
\ No newline at end of file
Deleted: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java 2010-07-02 19:20:11 UTC (rev 23203)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.creation.core.test;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.jboss.tools.ws.creation.core.test.command.JBossWSClientCommandTest;
-import org.jboss.tools.ws.creation.core.test.command.JBossWSClientSampleCreationCommandTest;
-import org.jboss.tools.ws.creation.core.test.command.JBossWSJavaFirstCommandTest;
-import org.jboss.tools.ws.creation.core.test.command.JBossWSMergeWebXMLCommandTest;
-import org.jboss.tools.ws.creation.core.test.command.JBossWSTopDownCommandTest;
-
-public class JBossWSCreationCoreTests extends TestCase {
- public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core.test";
- public static Test suite ()
- {
- TestSuite suite = new TestSuite(JBossWSCreationCoreTests.class.getName());
- suite.addTestSuite(JBossWSTopDownCommandTest.class);
- suite.addTestSuite(JBossWSJavaFirstCommandTest.class);
- suite.addTestSuite(JBossWSClientCommandTest.class);
- suite.addTestSuite(JBossWSMergeWebXMLCommandTest.class);
- suite.addTestSuite(JBossWSClientSampleCreationCommandTest.class);
- return suite;
- }
-}
\ No newline at end of file
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java 2010-07-02 19:20:11 UTC (rev 23203)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.creation.core.test.command;
import java.io.File;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
@@ -75,11 +76,10 @@
protected static final int DEFAULT_STARTUP_TIME = 150000;
protected static final int DEFAULT_SHUTDOWN_TIME = 90000;
- protected static final String JBOSSWS_HOME_DEFAULT = "D:/softinstall/jboss-4.2.3GA/jboss-4.2.3.GA";
public static final String JBOSSWS_42_HOME = "jbosstools.test.jboss.home.4.2";
public static final String JBOSS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
public static final String JBOSS_AS_42_HOME = System.getProperty(
- JBOSSWS_42_HOME, JBOSSWS_HOME_DEFAULT);
+ JBOSSWS_42_HOME);
public static final String JBOSS_SERVER_42 = "org.jboss.ide.eclipse.as.42";
protected final Set<IResource> resourcesToCleanup = new HashSet<IResource>();
@@ -115,7 +115,7 @@
// create jbossws web project
- createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME,
+ createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, getJBossWSHomeFolder().getAbsolutePath(),
"default");
// first thing's first. Let's add a server state listener
stateListener = new ServerStateListener();
@@ -281,11 +281,14 @@
protected File getJBossWSHomeFolder() {
- String jbosshome = System.getProperty(JBOSSWS_42_HOME,
- JBOSSWS_HOME_DEFAULT);
+ String jbosshome = System.getProperty(JBOSSWS_42_HOME);
+ if (jbosshome==null) {
+ String message = "{0} system property is not defined. Use -D{0}=/path/to/the/server in command line or in VM Arguments group of Aclipse Application Launch Configuration Arguments tab";
+ throw new IllegalArgumentException(MessageFormat.format(message, JBOSSWS_42_HOME));
+ }
+ String wrongLocationMessage = "{0} system property points to none existing folder";
File runtimelocation = new File(jbosshome);
- assertTrue("Please set JBoss EAP Home in system property:"
- + JBOSSWS_42_HOME, runtimelocation.exists());
+ assertTrue(MessageFormat.format(wrongLocationMessage,JBOSSWS_42_HOME), runtimelocation.exists());
String cmdFileLocation = jbosshome + File.separator + "bin"
+ File.separator + "wsconsume.sh";
Modified: trunk/ws/tests/pom.xml
===================================================================
--- trunk/ws/tests/pom.xml 2010-07-02 19:13:08 UTC (rev 23202)
+++ trunk/ws/tests/pom.xml 2010-07-02 19:20:11 UTC (rev 23203)
@@ -9,6 +9,7 @@
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.ws.core.test</module>
+ <module>org.jboss.tools.ws.creation.core.test</module>
<module>org.jboss.tools.ws.ui.test</module>
</modules>
</project>
15 years, 9 months
JBoss Tools SVN: r23202 - in trunk/requirements: generic and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 15:13:08 -0400 (Fri, 02 Jul 2010)
New Revision: 23202
Added:
trunk/requirements/jboss-riftsaw/
trunk/requirements/jboss-riftsaw/buildRequirement.xml
trunk/requirements/jbossesb/
trunk/requirements/jbossesb/build.properties
trunk/requirements/riftsaw/
trunk/requirements/riftsaw/build.properties
Modified:
trunk/requirements/build.xml
trunk/requirements/generic/build.xml
Log:
new requirement definitions are added
Modified: trunk/requirements/build.xml
===================================================================
--- trunk/requirements/build.xml 2010-07-02 17:57:02 UTC (rev 23201)
+++ trunk/requirements/build.xml 2010-07-02 19:13:08 UTC (rev 23202)
@@ -4,6 +4,7 @@
<property name="requirement.root" value="${basedir}" />
<property name="requirement.download.root" value="${basedir}/download" />
+ <property name="requirement.build.root" value="${basedir}/target" />
<condition property="skipRequirementBuild">
<equals arg1="${maven.test.skip}" arg2="true"/>
@@ -13,8 +14,8 @@
<echo>maven.test.skip=${maven.test.skip}</echo>
<echo>settings.offline=${settings.offline}</echo>
<echo>requirements=${requirements}</echo>
- <echo>unzipto=${basedir}/target/requirements</echo>
- <buildRequirements requirements="${requirements}" unzipto="${basedir}/target" />
+ <echo>unzipto=${requirement.build.root}</echo>
+ <buildRequirements requirements="${requirements}" unzipto="${requirement.build.root}" />
</target>
</project>
Modified: trunk/requirements/generic/build.xml
===================================================================
--- trunk/requirements/generic/build.xml 2010-07-02 17:57:02 UTC (rev 23201)
+++ trunk/requirements/generic/build.xml 2010-07-02 19:13:08 UTC (rev 23202)
@@ -84,9 +84,10 @@
<or>
<equals arg1="${settings.offline}" arg2="true" />
<equals arg1="${maven.test.skip}" arg2="true" />
+ <equals arg1="${skipDownload}" arg2="true" />
</or>
<then>
- <echo>Skip download for ${build.uri}/${build.archive} because of tests are skept or build is running in offline mode</echo>
+ <echo>Skip download for ${build.uri}/${build.archive}</echo>
</then>
<else>
<mkdir dir="${driver.dest}"/>
Added: trunk/requirements/jboss-riftsaw/buildRequirement.xml
===================================================================
--- trunk/requirements/jboss-riftsaw/buildRequirement.xml (rev 0)
+++ trunk/requirements/jboss-riftsaw/buildRequirement.xml 2010-07-02 19:13:08 UTC (rev 23202)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+download required dependencies
+-jbossas
+-jbossesb
+-riftsaw
+
+unpack jbossas to location different from default
+install jbossesb
+install riftsaw
+
+-->
+<project name="projectroject" default="build.requirement">
+ <property file="build.properties" />
+
+ <target name="build.requirement" depends="unpack.requirement,install-jbossas,install-jbossesb,install-riftsaw" />
+ <target name="download.requirement" />
+ <target name="unpack.requirement" >
+ <ant dir="../jbossas" antfile="buildRequirement.xml" target="download.requirement" inheritall="true">
+ <property name="requirement" value="jbossas"/>
+ </ant>
+ <ant dir="../jbossesb" antfile="../generic/build.xml" target="build.requirement" inheritall="true">
+ <property name="requirement" value="jbossesb"/>
+ </ant>
+ <ant dir="../riftsaw" antfile="../generic/build.xml" target="build.requirement" inheritall="true">
+ <property name="requirement" value="riftsaw"/>
+ </ant>
+ </target>
+ <target name="install-jbossas" >
+ <property file="../jbossas/build.properties" />
+ <unzip src="${requirement.build.root}/jbossas/${jboss51.build.archive}" dest="${unzip.dest}" >
+ <mapper type="glob" from="${jboss51.build.name}/*" to="${jboss51.build.name}-riftsaw/*"/>
+ </unzip>
+ </target>
+ <target name="install-jbossesb" >
+ <property file="../jbossesb/build.properties" prefix="jbossesb" />
+ <ant dir="${unzip.dest}/${jbossesb.build.archive.root}/install" target="deploy">
+ <property name="org.jboss.esb.server.home" value="${unzip.dest}/${jboss51.build.name}-riftsaw" />
+ <property name="org.jboss.esb.server.config" value="default" />
+ </ant>
+ </target>
+ <target name="install-riftsaw" >
+ <property file="../riftsaw/build.properties" prefix="riftsaw" />
+ <ant dir="${unzip.dest}/${riftsaw.build.archive.root}/install" target="deploy">
+ <property name="org.jboss.as.home" value="${unzip.dest}/${jboss51.build.name}-riftsaw" />
+ <property name="org.jboss.as.config" value="default" />
+ <property name="org.jboss.esb.home" value="${unzip.dest}/${jbossesb.build.archive.root}" />
+ <property name="databasev" value="hsql" />
+ </ant>
+ </target>
+
+
+</project>
Property changes on: trunk/requirements/jboss-riftsaw/buildRequirement.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/requirements/jbossesb/build.properties
===================================================================
--- trunk/requirements/jbossesb/build.properties (rev 0)
+++ trunk/requirements/jbossesb/build.properties 2010-07-02 19:13:08 UTC (rev 23202)
@@ -0,0 +1,7 @@
+jbossesb.build.uri=http://www.jboss.org/file-access/default/members/jbossesb/downloads/4.7/binary
+build.uri=${jbossesb.build.uri}
+build.archive.root=jbossesb-4.7
+build.archive=${build.archive.root}.zip
+md5=da0d98bc0713229b7f8ba7ab5951072c
+
+
Property changes on: trunk/requirements/jbossesb/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/requirements/riftsaw/build.properties
===================================================================
--- trunk/requirements/riftsaw/build.properties (rev 0)
+++ trunk/requirements/riftsaw/build.properties 2010-07-02 19:13:08 UTC (rev 23202)
@@ -0,0 +1,8 @@
+#riftsaw.build.uri=http://downloads.sourceforge.net/project/riftsaw/riftsaw/2.0-CR1
+riftsaw.build.uri=http://repository.jboss.org/sourceforge
+build.uri=${riftsaw.build.uri}
+build.archive.root=riftsaw-2.0-CR1
+build.archive=${build.archive.root}.zip
+md5=a9be5fcc32d1715c59c616284a737108
+
+
Property changes on: trunk/requirements/riftsaw/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23201 - trunk/jsf/plugins/org.jboss.tools.jsf.ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-02 13:57:02 -0400 (Fri, 02 Jul 2010)
New Revision: 23201
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2010-07-02 17:56:11 UTC (rev 23200)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2010-07-02 17:57:02 UTC (rev 23201)
@@ -441,8 +441,25 @@
</with>
</enablement>
</renameParticipant>
+ <renameParticipant
+ class="org.jboss.tools.jsf.ui.el.refactoring.MessagesFileRenameParticipant"
+ id="org.jboss.tools.jsf.ui.el.refactoring.MessagesFileRenameParticipant"
+ name="jsf-MessagesFileRenameParticipant">
+ <enablement>
+ <!--with variable="affectedNatures">
+ <iterate operator="or">
+ <equals value="org.eclipse.wst.common.modulecore.ModuleCoreNature"/>
+ </iterate>
+ </with-->
+ <with variable="element">
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ </with>
+ </enablement>
+ </renameParticipant>
+
</extension>
+
<!-- Refactorng -->
<extension
point="org.eclipse.ui.menus">
15 years, 9 months
JBoss Tools SVN: r23200 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-02 13:56:11 -0400 (Fri, 02 Jul 2010)
New Revision: 23200
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java 2010-07-02 17:55:43 UTC (rev 23199)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java 2010-07-02 17:56:11 UTC (rev 23200)
@@ -37,7 +37,6 @@
@Override
protected boolean initialize(Object element) {
- System.out.println("MessagesFileRenameParticipant - initialize, element - "+element.getClass());
if(element instanceof IFile){
rootChange = new CompositeChange(JsfUIMessages.MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES);
file = (IFile)element;
15 years, 9 months
JBoss Tools SVN: r23199 - in trunk: jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-02 13:55:43 -0400 (Fri, 02 Jul 2010)
New Revision: 23199
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-07-02 17:38:46 UTC (rev 23198)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-07-02 17:55:43 UTC (rev 23199)
@@ -41,6 +41,8 @@
public static String MISSING_NATURES_INFO_MESSAGE_TITLE;
public static String SKIP_BUTTON_LABEL;
+ public static String MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, JsfUIMessages.class);
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java 2010-07-02 17:55:43 UTC (rev 23199)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.el.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jst.web.kb.refactoring.SearchUtil;
+import org.jboss.tools.jst.web.kb.refactoring.SearchUtil.FileResult;
+import org.jboss.tools.jst.web.kb.refactoring.SearchUtil.SearchResult;
+
+public class MessagesFileRenameParticipant extends RenameParticipant {
+ private static final String PROPERTIES_EXT = "properties";
+ private RefactoringStatus status;
+ private CompositeChange rootChange;
+ private IFile file;
+
+ @Override
+ protected boolean initialize(Object element) {
+ System.out.println("MessagesFileRenameParticipant - initialize, element - "+element.getClass());
+ if(element instanceof IFile){
+ rootChange = new CompositeChange(JsfUIMessages.MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES);
+ file = (IFile)element;
+ String ext = file.getFileExtension();
+ if(PROPERTIES_EXT.equals(ext)){
+
+ IPath path = file.getFullPath();
+ String newName = getArguments().getNewName();
+ String oldName = "\"demo.Messages\"";
+
+ SearchUtil su = new SearchUtil(SearchUtil.XML_FILES, oldName);
+ SearchResult result = su.searchInNodeAttribute(file.getProject(), ":loadBundle", "basename");
+ for(FileResult fr : result.getEntries()){
+ TextFileChange fileChange = new TextFileChange(fr.getFile().getName(), fr.getFile());
+ MultiTextEdit root = new MultiTextEdit();
+ fileChange.setEdit(root);
+ rootChange.add(fileChange);
+ for(int position : fr.getPositions()){
+ TextEdit edit = new ReplaceEdit(position, oldName.length(), "\""+newName+"\"");
+ fileChange.addEdit(edit);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public RefactoringStatus checkConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws OperationCanceledException {
+
+ return status;
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ return rootChange;
+ }
+
+ @Override
+ public String getName() {
+ if(file != null)
+ return file.getName();
+ return null;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-07-02 17:38:46 UTC (rev 23198)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-07-02 17:55:43 UTC (rev 23199)
@@ -30,4 +30,5 @@
ENABLE_JSF_CODE_COMPLETION_TEXT=The project "{0}" does not have JSF code completion and validation enabled completely.\n\nPlease use "Enabale JSF Code Completion..." fix button if you want these features working.
DONT_SHOW_CHECKER_DIALOG=Do not show this dialog again!
MISSING_NATURES_INFO_MESSAGE_TITLE=Missing Natures
-SKIP_BUTTON_LABEL=Skip
\ No newline at end of file
+SKIP_BUTTON_LABEL=Skip
+MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES=Update Message Bundle References
\ No newline at end of file
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java 2010-07-02 17:55:43 UTC (rev 23199)
@@ -0,0 +1,292 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.refactoring;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.jboss.tools.common.el.core.ELCorePlugin;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SearchUtil {
+ public static final int JAVA_FILES = 1 << 1;
+ public static final int XML_FILES = 1 << 2;
+ public static final int PROPERTY_FILES = 1 << 3;
+ public static final int EVERYWHERE = JAVA_FILES|XML_FILES|PROPERTY_FILES;
+
+
+ private static final String JAVA_EXT = "java"; //$NON-NLS-1$
+ private static final String XML_EXT = "xml"; //$NON-NLS-1$
+ private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
+ private static final String JSP_EXT = "jsp"; //$NON-NLS-1$
+ private static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
+
+ private int fileSet;
+ private String nodeName=null;
+ private String attributeName=null;
+ private SearchResult result = null;
+ private FileResult lastResult=null;
+
+ private String searchString;
+
+ public SearchUtil(int fileSet, String searchString){
+ this.fileSet = fileSet;
+ this.searchString = searchString;
+ result = new SearchResult();
+ }
+
+ private boolean isSearchInJavaFiles () {
+ if ((fileSet & JAVA_FILES) != 0)
+ return true;
+ return false;
+ }
+
+ private boolean isSearchInXMLFiles () {
+ if ((fileSet & XML_FILES) != 0)
+ return true;
+ return false;
+ }
+
+ private boolean isSearchInPropertyFiles () {
+ if ((fileSet & PROPERTY_FILES) != 0)
+ return true;
+ return false;
+ }
+
+ public SearchResult searchInNodeAttribute(IProject project, String nodeName, String attributeName){
+ this.nodeName = nodeName;
+ this.attributeName = attributeName;
+ return search(project);
+ }
+
+ public SearchResult search(IProject project){
+
+ if(isSearchInJavaFiles()){
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+
+ // searching java, xml and property files in source folders
+ if(javaProject != null){
+ for(IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)){
+ //if(resource instanceof IFolder)
+ //scanForJava((IFolder) resource);
+ //else if(resource instanceof IFile)
+ //scanForJava((IFile) resource);
+ }
+ }
+ }
+
+ // searching jsp, xhtml and xml files in WebContent folders
+ if(isSearchInXMLFiles()){
+ if(getViewFolder(project) != null)
+ scan(getViewFolder(project));
+ else
+ scan(project);
+ }
+
+ return result;
+ }
+
+ protected IContainer getViewFolder(IProject project){
+ IPath path = ProjectHome.getFirstWebContentPath(project);
+
+ if(path != null)
+ return project.getFolder(path.removeFirstSegments(1));
+
+ return null;
+ }
+
+
+ private boolean isFileCorrect(IFile file){
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ return false;
+ }else if(file.isPhantom()){
+ return false;
+ }else if(file.isReadOnly()){
+ return false;
+ }
+ return true;
+ }
+
+
+ private void scan(IContainer container){
+ try{
+ for(IResource resource : container.members()){
+ if(resource instanceof IFolder)
+ scan((IFolder) resource);
+ else if(resource instanceof IFile)
+ scan((IFile) resource);
+ }
+ }catch(CoreException ex){
+ ELCorePlugin.getDefault().logError(ex);
+ }
+ }
+
+ private void scan(IFile file){
+ if(isFileCorrect(file)) {
+ String fileContent=null;
+ try {
+ fileContent = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ ELCorePlugin.getDefault().logError(e);
+ }
+ String ext = file.getFileExtension();
+ if(XHTML_EXT.equalsIgnoreCase(ext)
+ || JSP_EXT.equalsIgnoreCase(ext)) {
+ scanInDOM(file, fileContent);
+ }
+ }
+ }
+
+
+ private boolean scanInDOM(IFile file, String content){
+ IModelManager manager = StructuredModelManager.getModelManager();
+ if(manager == null) {
+ return false;
+ }
+ IStructuredModel model = null;
+ try {
+ model = manager.getModelForRead(file);
+ if (model instanceof IDOMModel) {
+ IDOMModel domModel = (IDOMModel) model;
+ IDOMDocument document = domModel.getDocument();
+ return scanChildNodes(file, document);
+ }
+ } catch (CoreException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } catch (IOException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } finally {
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+ return false;
+ }
+
+ private boolean scanChildNodes(IFile file, Node parent) {
+ boolean status = false;
+
+ if(parent == null)
+ return false;
+
+ NodeList children = parent.getChildNodes();
+ for(int i=0; i<children.getLength(); i++) {
+ Node curentValidatedNode = children.item(i);
+ if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType()) {
+ if(nodeName == null || curentValidatedNode.getNodeName().endsWith(nodeName))
+ status = scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE);
+ if(status)
+ return status;
+ }/* else if(Node.TEXT_NODE == curentValidatedNode.getNodeType()) {
+ status = scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT);
+ if(status)
+ return status;
+ }*/
+ status = scanChildNodes(file, curentValidatedNode);
+ if(status)
+ return status;
+ }
+ return false;
+ }
+
+ private boolean scanNodeContent(IFile file, IStructuredDocumentRegion node, String regionType) {
+ boolean status = false;
+
+ if(node == null)
+ return false;
+
+ ITextRegionList regions = node.getRegions();
+ for(int i=0; i<regions.size(); i++) {
+ ITextRegion region = regions.get(i);
+ if(region.getType() == regionType) {
+ String text = node.getFullText(region).trim();
+ if(searchString.equals(text)){
+ if(lastResult == null || !lastResult.getFile().equals(file)){
+ lastResult = new FileResult(file);
+ result.getEntries().add(lastResult);
+ }
+
+ lastResult.addPosition(node.getStartOffset()+region.getStart());
+ }
+ }
+ }
+ return false;
+ }
+
+
+
+ public class SearchResult{
+ private List<FileResult> entries;
+
+ public SearchResult(){
+ entries = new ArrayList<FileResult>();
+ }
+
+ public List<FileResult> getEntries(){
+ return entries;
+ }
+ }
+
+ public class FileResult{
+ private IFile file;
+ private List<Integer> positions;
+
+ public FileResult(IFile file){
+ this.file = file;
+ positions = new ArrayList<Integer>();
+ }
+
+ public void addPosition(int position){
+ positions.add(new Integer(position));
+ }
+
+ public IFile getFile(){
+ return file;
+ }
+
+ public int[] getPositions(){
+ Integer[] integerArray = (Integer[])positions.toArray(new Integer[positions.size()]);
+
+ int[] intArray = new int[positions.size()];
+ int index = 0;
+ for(Integer position : positions){
+ intArray[index++] = position.intValue();
+ }
+ return intArray;
+ }
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23198 - trunk/xulrunner/site.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 13:38:46 -0400 (Fri, 02 Jul 2010)
New Revision: 23198
Added:
trunk/xulrunner/site/README.txt
Log:
readme for xulrunner update site
Added: trunk/xulrunner/site/README.txt
===================================================================
--- trunk/xulrunner/site/README.txt (rev 0)
+++ trunk/xulrunner/site/README.txt 2010-07-02 17:38:46 UTC (rev 23198)
@@ -0,0 +1,22 @@
+To regen update site metadata:
+
+java -jar ~/eclipse/eclipse36/plugins/org.eclipse.equinox.launcher_*.jar \
+-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher \
+-metadataRepository file:/home/nboldt/11/jbosstools-trunk/xulrunner/ \
+-artifactRepository file:/home/nboldt/11/jbosstools-trunk/xulrunner/ \
+-source /home/nboldt/11/jbosstools-trunk/xulrunner/ -configs "*.*.*" \
+-compress -publishArtifacts
+
+or
+
+java -jar ~/eclipse/eclipse36/plugins/org.eclipse.equinox.launcher_*.jar \
+-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher \
+-metadataRepository file:/home/nboldt/11/jbosstools-trunk/xulrunner/ \
+-artifactRepository file:/home/nboldt/11/jbosstools-trunk/xulrunner/ \
+-source /home/nboldt/11/jbosstools-trunk/xulrunner/features/org.mozilla.xulrunner.site -configs "*.*.*" \
+-compress -publishArtifacts
+
+... or just run:
+
+cd /home/nboldt/11/jbosstools-trunk/xulrunner/site/; mvn3 clean install
+
Property changes on: trunk/xulrunner/site/README.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23197 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 13:37:15 -0400 (Fri, 02 Jul 2010)
New Revision: 23197
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/pom.xml
Log:
group id error fixed in jsf.ext.text.test
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/pom.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/pom.xml 2010-07-02 17:34:20 UTC (rev 23196)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/pom.xml 2010-07-02 17:37:15 UTC (rev 23197)
@@ -7,7 +7,7 @@
<artifactId>jsf.generic.test</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.jsf.tests</groupId>
<artifactId>org.jboss.tools.jsf.text.ext.test</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
15 years, 9 months
JBoss Tools SVN: r23196 - trunk/jsf/plugins/org.jboss.tools.jsf.doc.user.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 13:34:20 -0400 (Fri, 02 Jul 2010)
New Revision: 23196
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.doc.user/pom.xml
Log:
groupId errors fixed in jsf.doc.user plugin
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.doc.user/pom.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.doc.user/pom.xml 2010-07-02 17:32:20 UTC (rev 23195)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.doc.user/pom.xml 2010-07-02 17:34:20 UTC (rev 23196)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools.jsf.plugins</groupId>
<artifactId>org.jboss.tools.jsf.doc.user</artifactId>
<version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
15 years, 9 months
JBoss Tools SVN: r23195 - trunk/birt/features/org.jboss.tools.birt.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-02 13:32:20 -0400 (Fri, 02 Jul 2010)
New Revision: 23195
Modified:
trunk/birt/features/org.jboss.tools.birt.feature/pom.xml
Log:
group ide fixed in birt.feature
Modified: trunk/birt/features/org.jboss.tools.birt.feature/pom.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/pom.xml 2010-07-02 17:30:10 UTC (rev 23194)
+++ trunk/birt/features/org.jboss.tools.birt.feature/pom.xml 2010-07-02 17:32:20 UTC (rev 23195)
@@ -7,7 +7,7 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools.features</groupId>
+ <groupId>org.jboss.tools.birt.features</groupId>
<artifactId>org.jboss.tools.birt.feature</artifactId>
<version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
15 years, 9 months