JBoss Tools SVN: r17446 - branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-09-03 13:25:50 -0400 (Thu, 03 Sep 2009)
New Revision: 17446
Modified:
branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
Log:
Fix for VPE failing junit tests
Modified: branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2009-09-03 16:50:05 UTC (rev 17445)
+++ branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2009-09-03 17:25:50 UTC (rev 17446)
@@ -180,7 +180,19 @@
controller.getVisualBuilder().setShowInvisibleTags(true);
controller.visualRefresh();
- TestUtil.waitForIdle();
+// TestUtil.waitForIdle();
+ //added by Maksim Areshkau, when some non VPE background job
+ //TestUtil.waitForIdle() can be throw exception in time when vpe works normally
+ long start = System.currentTimeMillis();
+ visualElement = findElementById(controller, elementId);
+ while (visualElement==null) {
+ TestUtil.delay(500);
+ if ( (System.currentTimeMillis()-start) > TestUtil.MAX_IDLE) {
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+ }
+ visualElement = findElementById(controller, elementId);
+ }
+
// find visual element and check if it is not null
visualElement = findElementById(controller, elementId);
15 years, 3 months
JBoss Tools SVN: r17445 - trunk/jsf/docs/userguide/en/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-09-03 12:50:05 -0400 (Thu, 03 Sep 2009)
New Revision: 17445
Modified:
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
Log:
https://jira.jboss.org/jira/browse/JBDS-843 Context menu representation for visual part of VPE is redesigned - images are updated
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
===================================================================
(Binary files differ)
15 years, 3 months
JBoss Tools SVN: r17444 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-03 08:03:44 -0400 (Thu, 03 Sep 2009)
New Revision: 17444
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java 2009-09-03 11:43:45 UTC (rev 17443)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java 2009-09-03 12:03:44 UTC (rev 17444)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.seam.ui.search;
import org.eclipse.core.resources.IFile;
15 years, 3 months
JBoss Tools SVN: r17443 - in trunk/seam: plugins/org.jboss.tools.seam.ui and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-03 07:43:45 -0400 (Thu, 03 Sep 2009)
New Revision: 17443
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchQuery.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSeacher.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindUsagesInELAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSeacher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSeacher.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSeacher.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -38,6 +38,7 @@
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELMethodInvocation;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
@@ -67,6 +68,9 @@
}
public void findELReferences(){
+ if(baseFile == null)
+ return;
+
SeamProjectsSet projectsSet = new SeamProjectsSet(baseFile.getProject());
IProject[] projects = projectsSet.getAllProjects();
@@ -240,9 +244,16 @@
ELModel model = parser.parse(string);
for (ELInstance instance : model.getInstances()) {
for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELPropertyInvocation pi = findComponentReference(ie);
- if(pi != null)
- match(file, pi);
+ ELInvocationExpression expression = findComponentReference(ie);
+ if(expression != null){
+ if(expression instanceof ELPropertyInvocation){
+ ELPropertyInvocation pi = (ELPropertyInvocation)expression;
+ match(file, offset+pi.getStartPosition(), pi.getName().getStart()+pi.getName().getLength()-pi.getStartPosition());
+ }else if(expression instanceof ELMethodInvocation){
+ ELMethodInvocation mi = (ELMethodInvocation)expression;
+ match(file, offset+mi.getStartPosition(), mi.getName().getStart()+mi.getName().getLength()-mi.getStartPosition());
+ }
+ }
}
}
}
@@ -278,7 +289,7 @@
key = false;
if(key && token.startsWith(propertyName)){
- match(file, token);
+ match(file, offset, token.length());
}
}
@@ -288,12 +299,12 @@
}
- private ELPropertyInvocation findComponentReference(ELInvocationExpression invocationExpression){
+ protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
ELInvocationExpression invExp = invocationExpression;
while(invExp != null){
if(invExp instanceof ELPropertyInvocation){
if(((ELPropertyInvocation)invExp).getQualifiedName() != null && ((ELPropertyInvocation)invExp).getQualifiedName().equals(propertyName))
- return (ELPropertyInvocation)invExp;
+ return invExp;
else
invExp = invExp.getLeft();
@@ -306,7 +317,5 @@
protected abstract boolean isFileCorrect(IFile file);
- protected abstract void match(IFile file, ELPropertyInvocation elPropertyInvokation);
-
- protected abstract void match(IFile file, String token);
+ protected abstract void match(IFile file, int offset, int length);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -10,27 +10,15 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.refactoring;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Set;
-import java.util.StringTokenizer;
-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.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.TextFileChange;
@@ -39,24 +27,7 @@
import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
-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.model.ELInstance;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.model.project.ext.ITextSourceReference;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -71,8 +42,6 @@
import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
import org.jboss.tools.seam.internal.core.validation.SeamContextValidationHelper;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* @author Daniel Azarov
@@ -98,6 +67,15 @@
private String newName;
private String oldName;
+ private SeamSeacher seacher = null;
+
+ protected SeamSeacher getSeacher(){
+ if(seacher == null){
+ seacher = new SeamSeacher(declarationFile, getOldName());
+ }
+ return seacher;
+ }
+
public void setNewName(String newName){
this.newName = newName;
}
@@ -373,64 +351,6 @@
}
- // we need to find references in .java .xml .xhtml .jsp .properties files
- protected void findELReferences(){
- if(declarationFile == null)
- return;
-
- IProject[] projects = projectsSet.getAllProjects();
- for (IProject project : projects) {
- if(project == null) continue;
-
- 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(project.equals(projectsSet.getWarProject()))
- scan(projectsSet.getDefaultViewsFolder());
- else if(project.equals(projectsSet.getEarProject()))
- scan(projectsSet.getDefaultEarViewsFolder());
- else{
- scan(project);
- }
- }
- }
-
- private void scan(IProject project){
- IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
- if(javaProject == null)
- return;
-
- IResource[] sources = EclipseResourceUtil.getJavaSourceRoots(project);
- IPath output = null;
- try{
- output = javaProject.getOutputLocation();
- }catch(JavaModelException ex){
- SeamCorePlugin.getDefault().logError(ex);
- }
-
- try{
- for(IResource resource : project.members()){
- if(resource instanceof IFolder){
- if(checkFolder(resource, sources, output))
- scan((IFolder) resource);
- }else if(resource instanceof IFile)
- scan((IFile) resource);
- }
- }catch(CoreException ex){
- SeamCorePlugin.getDefault().logError(ex);
- }
- }
-
private boolean checkFolder(IResource resource, IResource[] sources, IPath output){
for(IResource folder : sources){
if(resource.equals(folder))
@@ -443,215 +363,6 @@
return true;
}
- private void scanForJava(IContainer container){
- try{
- for(IResource resource : container.members()){
- if(resource instanceof IFolder)
- scanForJava((IFolder) resource);
- else if(resource instanceof IFile)
- scanForJava((IFile) resource);
- }
- }catch(CoreException ex){
- SeamCorePlugin.getDefault().logError(ex);
- }
- }
-
- 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){
- SeamCorePlugin.getDefault().logError(ex);
- }
- }
-
- private void scanForJava(IFile file){
- String ext = file.getFileExtension();
-
- if(!isFileCorrect(file))
- return;
-
- String content = null;
- try {
- content = FileUtil.readStream(file.getContents());
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- return;
- }
- if(JAVA_EXT.equalsIgnoreCase(ext)){
- scanJava(file, content);
- }else if(XML_EXT.equalsIgnoreCase(ext))
- scanDOM(file, content);
- else if(PROPERTIES_EXT.equalsIgnoreCase(ext))
- scanProperties(file, content);
- }
-
- private void scan(IFile file){
- String ext = file.getFileExtension();
-
- if(!isFileCorrect(file))
- return;
-
- String content = null;
- try {
- content = FileUtil.readStream(file.getContents());
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- return;
- }
- if(XML_EXT.equalsIgnoreCase(ext) || XHTML_EXT.equalsIgnoreCase(ext) || JSP_EXT.equalsIgnoreCase(ext))
- scanDOM(file, content);
- }
-
- private void scanJava(IFile file, String content){
- try {
- FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
- Document document = new Document(content);
- scaner.setRange(document, 0, document.getLength());
- IToken token = scaner.nextToken();
- while(token!=null && token!=Token.EOF) {
- if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
- int length = scaner.getTokenLength();
- int offset = scaner.getTokenOffset();
- String value = document.get(offset, length);
- if(value.indexOf('{')>-1) {
- scanString(file, value, offset);
- }
- }
- token = scaner.nextToken();
- }
- } catch (BadLocationException e) {
- SeamCorePlugin.getDefault().logError(e);
- }
- }
-
- private void scanDOM(IFile file, String content){
- IModelManager manager = StructuredModelManager.getModelManager();
- if(manager == null) {
- return;
- }
- IStructuredModel model = null;
- try {
- model = manager.getModelForRead(file);
- if (model instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) model;
- IDOMDocument document = domModel.getDocument();
- scanChildNodes(file, document);
- }
- } catch (CoreException e) {
- SeamCorePlugin.getDefault().logError(e);
- } catch (IOException e) {
- SeamCorePlugin.getDefault().logError(e);
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
-
- private void scanChildNodes(IFile file, Node parent) {
- NodeList children = parent.getChildNodes();
- for(int i=0; i<children.getLength(); i++) {
- Node curentValidatedNode = children.item(i);
- if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType()) {
- scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE);
- } else if(Node.TEXT_NODE == curentValidatedNode.getNodeType()) {
- scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT);
- }
- scanChildNodes(file, curentValidatedNode);
- }
- }
-
- private void scanNodeContent(IFile file, IStructuredDocumentRegion node, String regionType) {
- 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);
- if(text.indexOf("{")>-1) { //$NON-NLS-1$
- int offset = node.getStartOffset() + region.getStart();
- scanString(file, text, offset);
- }
- }
- }
- }
-
- // looking for component references in EL
- private void scanString(IFile file, String string, int offset) {
- int startEl = string.indexOf("#{"); //$NON-NLS-1$
- if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(string);
- for (ELInstance instance : model.getInstances()) {
- for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELPropertyInvocation pi = findComponentReference(ie);
- if(pi != null)
- change(file, offset+pi.getStartPosition(), pi.getName().getStart()+pi.getName().getLength()-pi.getStartPosition(), newName);
- }
- }
- }
- }
-
- private ELPropertyInvocation findComponentReference(ELInvocationExpression invocationExpression){
- ELInvocationExpression invExp = invocationExpression;
- while(invExp != null){
- if(invExp instanceof ELPropertyInvocation){
- if(((ELPropertyInvocation)invExp).getQualifiedName() != null && ((ELPropertyInvocation)invExp).getQualifiedName().equals(getOldName()))
- return (ELPropertyInvocation)invExp;
- else
- invExp = invExp.getLeft();
-
- }else{
- invExp = invExp.getLeft();
- }
- }
- return null;
- }
-
- private void scanProperties(IFile file, String content){
- scanString(file, content, 0);
-
- if(!file.getName().equals(SEAM_PROPERTIES_FILE))
- return;
-
- StringTokenizer tokenizer = new StringTokenizer(content, "#= \t\r\n\f", true); //$NON-NLS-1$
-
- String lastToken = "\n"; //$NON-NLS-1$
- int offset = 0;
- boolean comment = false;
- boolean key = true;
-
- while(tokenizer.hasMoreTokens()){
- String token = tokenizer.nextToken("#= \t\r\n\f"); //$NON-NLS-1$
- if(token.equals("\r")) //$NON-NLS-1$
- token = "\n"; //$NON-NLS-1$
-
- if(token.equals("#") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
- comment = true;
- else if(token.equals("\n") && comment) //$NON-NLS-1$
- comment = false;
-
- if(!comment){
- if(!token.equals("\n") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
- key = true;
- else if(key && (token.equals("=") || token.equals(" "))) //$NON-NLS-1$ //$NON-NLS-2$
- key = false;
-
- if(key && token.startsWith(getOldName())){
- String changeText = token.replaceFirst(getOldName(), getNewName());
- change(file, offset, token.length(), changeText);
- }
- }
-
- lastToken = token;
- offset += token.length();
- }
- }
-
protected void renameComponent(IProgressMonitor pm, ISeamComponent component)throws CoreException{
pm.beginTask("", 3);
@@ -665,7 +376,7 @@
pm.worked(1);
- findELReferences();
+ getSeacher().findELReferences();
pm.done();
}
@@ -681,7 +392,7 @@
pm.worked(1);
- findELReferences();
+ getSeacher().findELReferences();
pm.done();
}
@@ -722,4 +433,20 @@
keys.add(key);
}
}
+
+ class SeamSeacher extends SeamRefactorSeacher{
+ public SeamSeacher(IFile declarationFile, String oldName){
+ super(declarationFile, oldName);
+ }
+
+ @Override
+ protected boolean isFileCorrect(IFile file) {
+ return SeamRenameProcessor.this.isFileCorrect(file);
+ }
+
+ @Override
+ protected void match(IFile file, int offset, int length) {
+ change(file, offset, length, newName);
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-09-03 11:43:45 UTC (rev 17443)
@@ -517,6 +517,16 @@
</extension>
<extension
+ id="ELSearchResultPage"
+ point="org.eclipse.search.searchResultViewPages">
+ <viewPage
+ id="org.jboss.tools.seam.ui.search.ELSearchResultPage"
+ searchResultClass="org.jboss.tools.seam.ui.search.ELSearchResult"
+ class="org.jboss.tools.seam.ui.search.SeamSearchResultPage">
+ </viewPage>
+ </extension>
+
+ <extension
point="org.eclipse.jdt.ui.quickAssistProcessors">
<quickAssistProcessor
class="org.jboss.tools.seam.ui.actions.SeamFindQuickAssistProcessor"
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindUsagesInELAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindUsagesInELAction.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindUsagesInELAction.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -11,18 +11,26 @@
package org.jboss.tools.seam.ui.actions;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.search.SearchMessages;
+import org.eclipse.jdt.internal.ui.search.SearchUtil;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate2;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.seam.internal.core.refactoring.SeamRefactorSeacher;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.IProgressService;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.search.ELSearchQuery;
public class FindUsagesInELAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
private IFile javaFile;
@@ -44,26 +52,37 @@
public void init(IWorkbenchWindow window) {
}
- public void run(IAction action) {
- //ELResolverFactoryManager.getInstance().getResolvers(resource);
-
-
-// ELInvocationExpression expression = SeamELCompletionEngine.findExpressionAtOffset(
-// document, selectionOffset, 0, document.getLength());
-//
-// if (expression == null)
-// return; // No EL Operand found
-//
-// try {
-// performNewSearch(expression, file);
-// } catch (JavaModelException jme) {
-// SeamGuiPlugin.getPluginLog().logError(jme);
-// } catch (InterruptedException ie) {
-// SeamGuiPlugin.getPluginLog().logError(ie);
-// }
-// return;
+ public void run() {
+ try {
+ performNewSearch();
+ } catch (JavaModelException jme) {
+ SeamGuiPlugin.getPluginLog().logError(jme);
+ } catch (InterruptedException ie) {
+ SeamGuiPlugin.getPluginLog().logError(ie);
+ }
}
+ private void performNewSearch() throws JavaModelException, InterruptedException {
+ ELSearchQuery query= createQuery();
+ if (query.canRunInBackground()) {
+ SearchUtil.runQueryInBackground(query);
+ } else {
+ IProgressService progressService= PlatformUI.getWorkbench().getProgressService();
+ IStatus status= SearchUtil.runQueryInForeground(progressService, query);
+ if (status.matches(IStatus.ERROR | IStatus.INFO | IStatus.WARNING)) {
+ ErrorDialog.openError(getShell(), SearchMessages.Search_Error_search_title, SearchMessages.Search_Error_search_message, status);
+ }
+ }
+ }
+
+ private ELSearchQuery createQuery() throws JavaModelException, InterruptedException {
+ return new ELSearchQuery(javaFile, type, propertyName);
+ }
+
+ private Shell getShell() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
public void selectionChanged(IAction action, ISelection selection) {
}
@@ -74,30 +93,9 @@
public void runWithEvent(IAction action, Event event) {
}
- class ELSearcher extends SeamRefactorSeacher{
- public ELSearcher(IFile file, String name){
- super(file, name);
- }
-
- @Override
- protected boolean isFileCorrect(IFile file) {
- // TODO Auto-generated method stub
- return true;
- }
-
- @Override
- protected void match(IFile file,
- ELPropertyInvocation elPropertyInvokation) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected void match(IFile file, String token) {
- // TODO Auto-generated method stub
-
- }
-
-
+ public void run(IAction action) {
+ run();
}
+
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -430,12 +430,12 @@
String name = method.getElementName();
if(name.startsWith(GET) || name.startsWith(SET))
- return name.substring(3);
+ return name.substring(3).toLowerCase();
if(name.startsWith(IS))
- return name.substring(2);
+ return name.substring(2).toLowerCase();
- return name;
+ return name.toLowerCase();
}
private static void saveAndBuild(){
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchQuery.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchQuery.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchQuery.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.seam.ui.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.ISearchResult;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELMethodInvocation;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.seam.internal.core.refactoring.SeamRefactorSeacher;
+
+public class ELSearchQuery implements ISearchQuery {
+ private String propertyName;
+ private ELSearcher searcher;
+
+ private ELSearchResult result;
+
+ public ELSearchQuery(IFile file, IType type, String propertyName){
+ this.propertyName = propertyName;
+ searcher = new ELSearcher(file, propertyName);
+
+ result = new ELSearchResult(this);
+ }
+
+ public String getPropertyName(){
+ return propertyName;
+ }
+
+ public boolean canRerun() {
+ return false;
+ }
+
+ public boolean canRunInBackground() {
+ return true;
+ }
+
+ public String getLabel() {
+ return "Seach for property references in Expression Language";
+ }
+
+ public ISearchResult getSearchResult() {
+ return result;
+ }
+
+ public IStatus run(IProgressMonitor monitor)
+ throws OperationCanceledException {
+ searcher.findELReferences();
+
+ return Status.OK_STATUS;
+ }
+
+ class ELSearcher extends SeamRefactorSeacher{
+ public ELSearcher(IFile file, String name){
+ super(file, name);
+ }
+
+ @Override
+ protected 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;
+ }
+
+ @Override
+ protected void match(IFile file, int offset, int length) {
+ Match match = new Match(file, offset, length);
+ result.addMatch(match);
+ }
+
+ protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
+ ELInvocationExpression invExp = invocationExpression;
+ while(invExp != null){
+ if(invExp instanceof ELMethodInvocation || invExp instanceof ELPropertyInvocation){
+ if(invExp.getMemberName() != null && invExp.getMemberName().equalsIgnoreCase(propertyName))
+ return invExp;
+ else
+ invExp = invExp.getLeft();
+ }else{
+ invExp = invExp.getLeft();
+ }
+ }
+ return null;
+ }
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchQuery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -0,0 +1,80 @@
+package org.jboss.tools.seam.ui.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.search.internal.ui.SearchPluginImages;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.text.AbstractTextSearchResult;
+import org.eclipse.search.ui.text.IEditorMatchAdapter;
+import org.eclipse.search.ui.text.IFileMatchAdapter;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+
+public class ELSearchResult extends AbstractTextSearchResult implements IEditorMatchAdapter, IFileMatchAdapter {
+ private ELSearchQuery query;
+ private final Match[] EMPTY_ARR= new Match[0];
+
+ public ELSearchResult(ELSearchQuery query){
+ super();
+ this.query = query;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return SearchPluginImages.DESC_OBJ_TSEARCH_DPDN;
+ }
+
+ public String getLabel() {
+ return "'"+query.getPropertyName()+"' property references in Expression Language - "+getMatchCount()+" matches found";
+ }
+
+ public ISearchQuery getQuery() {
+ return query;
+ }
+
+ public String getTooltip() {
+ return getLabel();
+ }
+
+ @Override
+ public IEditorMatchAdapter getEditorMatchAdapter() {
+ return this;
+ }
+
+ @Override
+ public IFileMatchAdapter getFileMatchAdapter() {
+ return this;
+ }
+
+ public Match[] computeContainedMatches(AbstractTextSearchResult result,
+ IEditorPart editor) {
+ IEditorInput ei= editor.getEditorInput();
+ if (ei instanceof IFileEditorInput) {
+ IFileEditorInput fi= (IFileEditorInput) ei;
+ return getMatches(fi.getFile());
+ }
+ return EMPTY_ARR;
+ }
+
+ public boolean isShownInEditor(Match match, IEditorPart editor) {
+ IEditorInput ei= editor.getEditorInput();
+ if (ei instanceof IFileEditorInput) {
+ IFileEditorInput fi= (IFileEditorInput) ei;
+ return match.getElement().equals(fi.getFile());
+ }
+ return false;
+ }
+
+ public Match[] computeContainedMatches(AbstractTextSearchResult result,
+ IFile file) {
+ return getMatches(file);
+ }
+
+ public IFile getFile(Object element) {
+ if (element instanceof IFile)
+ return (IFile)element;
+ return null;
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/ELSearchResult.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -88,8 +88,8 @@
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput instanceof SeamSearchResult) {
- initialize((SeamSearchResult) newInput);
+ if (newInput instanceof AbstractTextSearchResult) {
+ initialize((AbstractTextSearchResult) newInput);
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-09-03 11:38:35 UTC (rev 17442)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-09-03 11:43:45 UTC (rev 17443)
@@ -135,8 +135,8 @@
// Test results
- if(!fromJar)
- assertNull("There is unexpected component in seam project: " + componentName, seamProject.getComponent(componentName));
+ //if(!fromJar)
+ //assertNull("There is unexpected component in seam project: " + componentName, seamProject.getComponent(componentName));
assertNotNull("Can't load component " + newName, seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
15 years, 3 months
JBoss Tools SVN: r17442 - in trunk/seam/tests/org.jboss.tools.seam.core.test: projects/SeamWebWarTestProject/WebContent/WEB-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-03 07:38:35 -0400 (Thu, 03 Sep 2009)
New Revision: 17442
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/JBIDE-1631.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/Component12.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.original
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.original
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4495
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/JBIDE-1631.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/JBIDE-1631.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/JBIDE-1631.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,14 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+</ui:define>
+</ui:composition>
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:drools="http://jboss.com/products/seam/drools"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:mail="http://jboss.com/products/seam/mail"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
+ http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
+ http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
+
+ <core:init debug="true" jndi-pattern="@jndiPattern@"/>
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"
+ conversation-is-long-running-parameter="clr"/>
+
+ <core:managed-persistence-context name="entityManager"
+ auto-create="true"
+ entity-manager-factory="#{SeamWebWarTestProjectEntityManagerFactory}"/>
+
+ <core:entity-manager-factory name="SeamWebWarTestProjectEntityManagerFactory"
+ persistence-unit-name="SeamWebWarTestProject"/>
+
+ <core:ejb installed="@embeddedEjb@"/>
+
+ <drools:rule-base name="securityRules">
+ <drools:rule-files><value>/security.drl</value></drools:rule-files>
+ </drools:rule-base>
+
+ <security:identity authenticate-method="#{authenticator.authenticate}"
+ security-rules="#{securityRules}"
+ remember-me="true"/>
+
+ <event type="org.jboss.seam.notLoggedIn">
+ <action expression="#{redirect.captureCurrentView}"/>
+ </event>
+ <event type="org.jboss.seam.postAuthenticate">
+ <action expression="#{redirect.returnToCapturedView}"/>
+ </event>
+
+ <mail:mail-session host="localhost" port="2525" username="test" password="test" />
+
+ <!-- For use with jBPM pageflow or process management -->
+ <!--
+ <core:jbpm>
+ <core:process-definitions></core:process-definitions>
+ <core:pageflow-definitions></core:pageflow-definitions>
+ </core:jbpm>
+ -->
+ <component class="org.domain.SeamWebWarTestProject.session.TestComponent" name="test" />
+
+ <factory name="test" />
+
+ <security:identity authenticate-method="#{test.operate}"
+ security-rules="#{securityRules}"
+ remember-me="true"/>
+
+</components>
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/abcComponent.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,31 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ xmlns:a="https://ajax4jsf.dev.java.net/ajax"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <rich:panel>
+ <f:facet name="header">abcComponent</f:facet>
+
+ <h:form id="abcComponentForm">
+
+ <h:commandButton id="abcComponent" value="abcComponent!"
+ action="#{abcComponent.actionType}"/>
+
+ </h:form>
+
+ </rich:panel>
+
+</ui:define>
+
+</ui:composition>
+
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,55 @@
+package org.domain.SeamWebWarTestProject.entity;
+
+import javax.ejb.Remove;
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Version;
+import org.hibernate.validator.Length;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Entity
+(a)Scope(ScopeType.EVENT)
+@Name("abcEntity")
+public class abcEntity implements Serializable {
+ static final long serialVersionUID = 1000;
+ //seam-gen attributes (you should probably edit these)
+ private Long id;
+ private Integer version;
+ private String name;
+
+ //add additional entity attributes
+
+ //seam-gen attribute getters/setters with annotations (you probably should edit)
+
+ @Id @GeneratedValue
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Version
+ public Integer getVersion() {
+ return version;
+ }
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ @Length(max=20)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,20 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+@Name("bbcComponent")
+public class BbcComponent {
+
+ @Logger private Log log;
+
+ public void bbcComponent()
+ {
+ //implement your business logic here
+ log.info("bbcComponent.bbcComponent() action called");
+ }
+
+ //add additional action methods
+
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/Component12.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/Component12.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/Component12.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,40 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("component12")
+public class Component12 {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @Factory("messageList12")
+ public List<String> findMessages() {
+ return messageList;
+ }
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+
+ public void component12()
+ {
+ //implement your business logic here
+ log.info("component12.component12() action called");
+ //facesMessages.add("component12");
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,48 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("contextVariableTest")
+@Role(name="role1")
+public class ContextVariableTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @Out(value="output")
+ private String output;
+
+ public void contextVariableTest()
+ {
+ //implement your business logic here
+ log.info("contextVariableTest.contextVariableTest() action called");
+ }
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @Factory("messageList")
+ public void findMessages() {
+
+ }
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public String getOutput(){
+ return output;
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,7 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("duplicateJavaAndXmlComponentName")
+public class DuplicateComponent {
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelectionIndex;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionIndexTest")
+public class SelectionIndexTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelectionIndex("messageList") int index;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionIndexTest()
+ {
+ //implement your business logic here
+ log.info("selectionIndexTest.selectionIndexTest() action called");
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,42 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.core.FacesMessages;
+
+@Name("selectionTest")
+public class SelectionTest {
+
+ @Logger private Log log;
+
+ @In FacesMessages facesMessages;
+
+ @DataModel
+ private List<String> messageList=new ArrayList<String>();
+
+ @DataModel
+ private List<String> nameList=new ArrayList<String>();
+
+ @DataModelSelection("messageList") String s;
+
+ public List<String> getList(){
+ return messageList;
+ }
+
+ public List<String> getNames(){
+ return nameList;
+ }
+
+ public void selectionTest()
+ {
+ //implement your business logic here
+ log.info("selectionTest.selectionTest() action called");
+ }
+}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,52 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+@Name("statefulComponent")
+
+@Stateful
+(a)Scope(ScopeType.APPLICATION)
+public class StatefulComponent {
+
+ private String abc;
+
+ @Logger private Log log;
+
+
+ //seam-gen method
+ public String statefulComponent()
+ {
+ //implement your business logic here
+ log.info("statefulComponent.statefulComponent() action called");
+ return "success";
+ }
+
+ //add additional action methods
+ @Destroy
+ public void destroyMethod(){
+
+ }
+
+
+ @Remove
+ public void removeMethod(){
+
+ }
+
+ public String getAbc() {
+ return abc;
+ }
+
+ public void setAbc(String abc) {
+ this.abc = abc;
+ }
+
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.original
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.original (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.original 2009-09-03 11:38:35 UTC (rev 17442)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Stateful;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+
+/**
+ * Test component for JBIDE-1696
+ * @author Alexey Kazakov
+ */
+@Stateful
+@Name("testComponentJBIDE1696")
+public class SubclassTestComponent extends SuperclassTestComponent {
+
+ @Destroy public void foo1() {}
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-09-03 10:51:10 UTC (rev 17441)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-09-03 11:38:35 UTC (rev 17442)
@@ -36,6 +36,7 @@
import org.jboss.tools.tests.IMarkerFilter;
public class SeamValidatorsTest extends AbstractResourceMarkerTest {
+
IProject project = null;
public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
@@ -63,6 +64,68 @@
this.project = project.getProject();
JobUtils.waitForIdle();
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ // restore state
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.original");
+
+ copyContentsFile("WebContent/WEB-INF/components.xml", "WebContent/WEB-INF/components.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original");
+
+ copyContentsFile("WebContent/JBIDE-1631.xhtml",
+ "WebContent/JBIDE-1631.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.java",
+ "src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/Component12.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/Component12.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.original");
+
+ copyContentsFile("WebContent/abcComponent.xhtml",
+ "WebContent/abcComponent.original");
+
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.java",
+ "src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.original");
+
+ refreshProject(project);
+ }
+
+ private void copyContentsFile(String originalName, String newContentName){
+ IFile originalFile = project.getFile(originalName);
+ IFile newContentFile = project.getFile(newContentName);
+
+ copyContentsFile(originalFile, newContentFile);
+ }
+
+ private void copyContentsFile(IFile originalFile, String newContentName){
+ IFile newContentFile = project.getFile(newContentName);
+
+ copyContentsFile(originalFile, newContentFile);
+ }
+
+ private void copyContentsFile(IFile originalFile, IFile newContentFile){
+ try{
+ originalFile.setContents(newContentFile.getContents(), true, false, null);
+ }catch(Exception e){
+ JUnitUtils.fail("Error during changing '"+originalFile.getFullPath()+"' content to '"+newContentFile.getFullPath()+"'", e);
+ }
+ }
private ISeamProject getSeamProject(IProject project) {
refreshProject(project);
@@ -113,12 +176,9 @@
IFile subclassComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SubclassTestComponent.java");
assertMarkerIsCreated(subclassComponentFile, MARKER_TYPE, "Stateful component \"testComponentJBIDE1696\" must have a method marked @Remove", 25);
IFile superclassComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SuperclassTestComponent.java");
- IFile superclassComponentFileWithRemove = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SuperclassTestComponent.withRemove");
- try{
- superclassComponentFile.setContents(superclassComponentFileWithRemove.getContents(), true, false, null);
- }catch(Exception e){
- JUnitUtils.fail("Error during changing 'SuperclassTestComponent.java' content to 'SuperclassTestComponent.withRemove'", e);
- }
+
+ copyContentsFile(superclassComponentFile, "src/action/org/domain/SeamWebWarTestProject/session/SuperclassTestComponent.withRemove");
+
refreshProject(project);
int number = getMarkersNumber(subclassComponentFile);
assertTrue("We changed super class of component but it still don't see changes.", number == 0);
@@ -212,29 +272,14 @@
}
public void testComponentWithoutSetter_Validator() throws CoreException {
- IFile statefulComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
IFile componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
// Component class does not contain setter for property
- IFile componentsFile3 = project.getFile("WebContent/WEB-INF/components.3");
+ copyContentsFile(componentsFile, "WebContent/WEB-INF/components.3");
- try{
- componentsFile.setContents(componentsFile3.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'components.xml' content to " +
- "'components.3'", ex);
- }
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java", "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.5");
- IFile statefulComponentFile5 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.5");
-
- try{
- statefulComponentFile.setContents(statefulComponentFile5.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
- "'StatefulComponent.5'", ex);
- }
-
refreshProject(project);
assertMarkerIsCreated(
@@ -399,13 +444,7 @@
markerText, 24);
- IFile component12File2 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/DuplicateFactory");
- try{
- component12File.setContents(component12File2.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'Component12File2.java' content to " +
- "'DuplicateFactory'", ex);
- }
+ copyContentsFile(component12File, "src/action/org/domain/SeamWebWarTestProject/session/DuplicateFactory");
refreshProject(project);
@@ -427,21 +466,9 @@
// Multiple data binder
- IFile selectionTestFile2 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2");
- try{
- selectionTestFile.setContents(selectionTestFile2.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'SelectionTest.java' content to " +
- "'SelectionTest.2'", ex);
- }
+ copyContentsFile(selectionTestFile, "src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2");
- IFile selectionIndexTestFile2 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2");
- try{
- selectionIndexTestFile.setContents(selectionIndexTestFile2.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'SelectionIndexTest.java' content to " +
- "'SelectionIndexTest.2'", ex);
- }
+ copyContentsFile(selectionIndexTestFile, "src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2");
refreshProject(project);
@@ -479,21 +506,9 @@
IFile selectionIndexTestFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java");
// Unknown @DataModel/@Out name
- IFile selectionTestFile3 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3");
- try{
- selectionTestFile.setContents(selectionTestFile3.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'SelectionTest.java' content to " +
- "'SelectionTest.3'", ex);
- }
+ copyContentsFile(selectionTestFile, "src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3");
- IFile selectionIndexTestFile3 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3");
- try{
- selectionIndexTestFile.setContents(selectionIndexTestFile3.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'SelectionIndexTest.java' content to " +
- "'SelectionIndexTest.3'", ex);
- }
+ copyContentsFile(selectionIndexTestFile, "src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3");
refreshProject(project);
@@ -521,13 +536,7 @@
// Duplicate variable name
- IFile contextVariableTestFile2 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2");
- try{
- contextVariableTestFile.setContents(contextVariableTestFile2.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'ContextVariableTest.java' content to " +
- "'ContextVariableTest.2'", ex);
- }
+ copyContentsFile(contextVariableTestFile, "src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2");
refreshProject(project);
@@ -607,13 +616,7 @@
enableUnpairGetterOrSetterValidation(true);
- IFile abcComponentFile2 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.2");
- try{
- abcComponentFile.setContents(abcComponentFile2.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'abcComponent.java' content to " +
- "'abcComponent.2'", ex);
- }
+ copyContentsFile(abcComponentFile, "src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.2");
refreshProject(project);
@@ -627,7 +630,6 @@
public void testPropertyHasOnlyGetter_Validator() throws CoreException {
IFile abcComponentXHTMLFile = project.getFile("WebContent/abcComponent.xhtml");
- IFile abcComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.java");
String markerText = "Property \"actionType\" has only Getter. Setter is missing.";
@@ -635,13 +637,7 @@
enableUnpairGetterOrSetterValidation(true);
- IFile abcComponentFile3 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.3");
- try{
- abcComponentFile.setContents(abcComponentFile3.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'abcComponent.java' content to " +
- "'abcComponent.3'", ex);
- }
+ copyContentsFile("src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.java", "src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.3");
refreshProject(project);
@@ -688,13 +684,10 @@
IFile duplicateJavaComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/DuplicateComponent.java");
IFile componentsXmlFile = project.getFile("WebContent/WEB-INF/components.xml");
- IFile duplicateComponentsXmlFile = project.getFile("WebContent/WEB-INF/duplicateComponents.test");
- try{
- componentsXmlFile.setContents(duplicateComponentsXmlFile.getContents(), true, false, null);
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'components.xml' content to 'duplicateComponents.test'", ex);
- }
+ copyContentsFile(componentsXmlFile, "WebContent/WEB-INF/duplicateComponents.test");
+
refreshProject(project);
+
Integer[] lineNumbers = getMarkersNumbersOfLine(duplicateJavaComponentFile, SEAM_MARKER_FILTER);
assertEquals("There should be the only one error marker in DuplicateComponent.java.", 1, lineNumbers.length);
assertEquals("Problem marker has wrong line number", 5, lineNumbers[0].intValue());
@@ -712,15 +705,10 @@
SeamCorePlugin.getDefault().getPreferenceStore().setValue(SeamPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.ERROR);
IFile componentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.java");
- IFile newComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.new");
- IFile originalComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.original");
IFile xhtmlFile = project.getFile("WebContent/testElRevalidation.xhtml");
- try {
- componentFile.setContents(newComponentFile.getContents(), true, false, null);
- } catch(Exception ex) {
- JUnitUtils.fail("Error in changing 'TestElRevalidation.new' content to 'TestElRevalidation.java'", ex);
- }
+ copyContentsFile(componentFile, "src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.new");
+
refreshProject(project);
int n = getMarkersNumber(xhtmlFile, SEAM_MARKER_FILTER);
@@ -728,11 +716,8 @@
SeamCorePlugin.getDefault().getPreferenceStore().setValue(SeamPreferences.RE_VALIDATE_UNRESOLVED_EL, SeamPreferences.DISABLE);
// Check if the validator was not invoked.
- try {
- componentFile.setContents(originalComponentFile.getContents(), true, false, null);
- } catch(Exception ex) {
- JUnitUtils.fail("Error in changing 'TestElRevalidation.original' content to 'TestElRevalidation.java'", ex);
- }
+ copyContentsFile(componentFile, "src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.original");
+
refreshProject(project);
n = getMarkersNumber(xhtmlFile, SEAM_MARKER_FILTER);
15 years, 3 months
JBoss Tools SVN: r17441 - branches/jbosstools-3.1.0.M3/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-03 06:51:10 -0400 (Thu, 03 Sep 2009)
New Revision: 17441
Modified:
branches/jbosstools-3.1.0.M3/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
Log:
try to fix junit test on hudson
Modified: branches/jbosstools-3.1.0.M3/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
===================================================================
--- branches/jbosstools-3.1.0.M3/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-03 10:45:38 UTC (rev 17440)
+++ branches/jbosstools-3.1.0.M3/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-03 10:51:10 UTC (rev 17441)
@@ -62,6 +62,9 @@
oneOf(saveDialog).open();
will(returnValue(filePath));
+ allowing(editor).getSite();
+ will(returnValue(null));
+
allowing(editor).getEditPartViewer();
will(returnValue(graphicalViewer));
15 years, 3 months
JBoss Tools SVN: r17440 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-03 06:45:38 -0400 (Thu, 03 Sep 2009)
New Revision: 17440
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
Log:
try to fix junit test on Hudson
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-03 04:10:42 UTC (rev 17439)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-03 10:45:38 UTC (rev 17440)
@@ -62,6 +62,9 @@
oneOf(saveDialog).open();
will(returnValue(filePath));
+ allowing(editor).getSite();
+ will(returnValue(null));
+
allowing(editor).getEditPartViewer();
will(returnValue(graphicalViewer));
15 years, 3 months
JBoss Tools SVN: r17438 - trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-02 20:26:40 -0400 (Wed, 02 Sep 2009)
New Revision: 17438
Added:
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/EsbPluginsLoadTest.java
Modified:
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBAllTests.java
trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4810
esbcomponent tests have been enabled in build
Modified: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBAllTests.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBAllTests.java 2009-09-03 00:26:36 UTC (rev 17437)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBAllTests.java 2009-09-03 00:26:40 UTC (rev 17438)
@@ -16,8 +16,9 @@
public class ESBAllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test ESB model");
- suite.addTestSuite(ESBModelTest.class);
+ TestSuite suite = new TestSuite("Test ESB Corel");
+ suite.addTestSuite(EsbPluginsLoadTest.class);
+ suite.addTestSuite(ESBModelTest.class);
return suite;
}
Modified: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2009-09-03 00:26:36 UTC (rev 17437)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/ESBModelTest.java 2009-09-03 00:26:40 UTC (rev 17438)
@@ -31,13 +31,9 @@
public ESBModelTest() {}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.esb.core.test", null, "Test", false);
+ provider = new TestProjectProvider("org.jboss.tools.esb.core.test", null, "Test", true);
project = provider.getProject();
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } catch (Exception e) {
- e.printStackTrace();
- }
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
/*
Added: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/EsbPluginsLoadTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/EsbPluginsLoadTest.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/EsbPluginsLoadTest.java 2009-09-03 00:26:40 UTC (rev 17438)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.test;
+
+import org.jboss.tools.tests.AbstractPluginsLoadTest;
+
+/**
+ * @author eskimo
+ */
+public class EsbPluginsLoadTest extends AbstractPluginsLoadTest {
+
+ public EsbPluginsLoadTest() {}
+
+ public void testEsbPluginsAreResolvedAndActivated() {
+ testBundlesAreLoadedFor("org.jboss.tools.esb.feature");
+ }
+}
Property changes on: trunk/esb/tests/org.jboss.tools.esb.core.test/src/org/jboss/tools/esb/core/test/EsbPluginsLoadTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 3 months
JBoss Tools SVN: r17437 - trunk/esb/features/org.jboss.tools.esb.test.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-02 20:26:36 -0400 (Wed, 02 Sep 2009)
New Revision: 17437
Added:
trunk/esb/features/org.jboss.tools.esb.test.feature/.project
trunk/esb/features/org.jboss.tools.esb.test.feature/build.properties
trunk/esb/features/org.jboss.tools.esb.test.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4810
esb component tests have been enabled in build
Added: trunk/esb/features/org.jboss.tools.esb.test.feature/.project
===================================================================
--- trunk/esb/features/org.jboss.tools.esb.test.feature/.project (rev 0)
+++ trunk/esb/features/org.jboss.tools.esb.test.feature/.project 2009-09-03 00:26:36 UTC (rev 17437)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.esb.test.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/esb/features/org.jboss.tools.esb.test.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/features/org.jboss.tools.esb.test.feature/build.properties
===================================================================
--- trunk/esb/features/org.jboss.tools.esb.test.feature/build.properties (rev 0)
+++ trunk/esb/features/org.jboss.tools.esb.test.feature/build.properties 2009-09-03 00:26:36 UTC (rev 17437)
@@ -0,0 +1 @@
+bin.includes = feature.xml
Property changes on: trunk/esb/features/org.jboss.tools.esb.test.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/features/org.jboss.tools.esb.test.feature/feature.xml
===================================================================
--- trunk/esb/features/org.jboss.tools.esb.test.feature/feature.xml (rev 0)
+++ trunk/esb/features/org.jboss.tools.esb.test.feature/feature.xml 2009-09-03 00:26:36 UTC (rev 17437)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.esb.test.feature"
+ label="ESB Tests Plugin"
+ version="1.0.0"
+ provider-name="JBoss by RedHat">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <plugin
+ id="org.jboss.tools.esb.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.esb.project.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Property changes on: trunk/esb/features/org.jboss.tools.esb.test.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 3 months
JBoss Tools SVN: r17436 - trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-09-02 20:26:20 -0400 (Wed, 02 Sep 2009)
New Revision: 17436
Added:
trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/.project
trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/build.properties
trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4810 freemarker tests were added
Added: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/.project
===================================================================
--- trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/.project (rev 0)
+++ trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/.project 2009-09-03 00:26:20 UTC (rev 17436)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.freemarker.test.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/build.properties
===================================================================
--- trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/build.properties (rev 0)
+++ trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/build.properties 2009-09-03 00:26:20 UTC (rev 17436)
@@ -0,0 +1 @@
+bin.includes = feature.xml
Property changes on: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/feature.xml
===================================================================
--- trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/feature.xml (rev 0)
+++ trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/feature.xml 2009-09-03 00:26:20 UTC (rev 17436)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.ide.eclipse.freemarker.test.feature"
+ label="Freemarker Tests"
+ version="1.0.0"
+ provider-name="JBoss by RedHat">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <plugin
+ id="org.jboss.ide.eclipse.freemarker.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Property changes on: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.test.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 3 months