JBoss Tools SVN: r18523 - in trunk/tests/tests/org.jboss.tools.tests: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-09 17:54:28 -0500 (Mon, 09 Nov 2009)
New Revision: 18523
Modified:
trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/tests/org.jboss.tools.tests/build.properties
Log:
switch to . instead of nested jar
Modified: trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF 2009-11-09 22:36:17 UTC (rev 18522)
+++ trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF 2009-11-09 22:54:28 UTC (rev 18523)
@@ -14,6 +14,6 @@
Export-Package: org.jboss.tools.test.util,
org.jboss.tools.test.util.xpl,
org.jboss.tools.tests
-Bundle-ClassPath: tools-tests.jar
+Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/tests/tests/org.jboss.tools.tests/build.properties
===================================================================
--- trunk/tests/tests/org.jboss.tools.tests/build.properties 2009-11-09 22:36:17 UTC (rev 18522)
+++ trunk/tests/tests/org.jboss.tools.tests/build.properties 2009-11-09 22:54:28 UTC (rev 18523)
@@ -1,10 +1,11 @@
+source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- testProject1/,\
- tools-tests.jar,\
- plugin.properties
src.includes = src/,\
+ META-INF/,\
testProject1/,\
build.properties,\
- META-INF/
-source.tools-tests.jar = src/
+ plugin.*
+bin.includes = .,\
+ META-INF/,\
+ testProject1/,\
+ plugin.*
15 years, 1 month
JBoss Tools SVN: r18522 - in trunk/seam/tests: org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-09 17:36:17 -0500 (Mon, 09 Nov 2009)
New Revision: 18522
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/refactoring/SeamContextVariableRefactoringTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5179
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-11-09 22:35:15 UTC (rev 18521)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-11-09 22:36:17 UTC (rev 18522)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core.test;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -21,6 +22,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
import org.jboss.tools.jst.web.kb.validation.IValidator;
@@ -123,10 +125,20 @@
}
private void copyContentsFile(IFile originalFile, IFile newContentFile){
- try{
- originalFile.setContents(newContentFile.getContents(), true, false, null);
- }catch(Exception e){
+ InputStream is = null;
+ try {
+ is = newContentFile.getContents();
+ originalFile.setContents(is, true, false, null);
+ } catch (CoreException e) {
JUnitUtils.fail("Error during changing '"+originalFile.getFullPath()+"' content to '"+newContentFile.getFullPath()+"'", e);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
}
@@ -212,7 +224,7 @@
IFile newContentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.3");
IFile targetFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java");
- targetFile.setContents(newContentFile.getContents(), true, false, null);
+ FileUtil.copyContent(newContentFile, targetFile, true, false, null);
refreshProject(project);
}
@@ -400,14 +412,26 @@
*/
protected void assertMarkerIsCreated(String targetPath, String newContentPath,
String pattern, int line) throws CoreException {
-
+
IFile newContentFile = project.getFile(newContentPath);
IFile targetFile = project.getFile(targetPath);
- targetFile.setContents(newContentFile.getContents(), true, false, null);
+ InputStream is = null;
+ try {
+ is = newContentFile.getContents();
+ targetFile.setContents(is, true, false, null);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
refreshProject(project);
assertMarkerIsCreated(targetFile, MARKER_TYPE, pattern, line);
}
-
+
/**
* @param statefulComponentFile
* @param string
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-11-09 22:35:15 UTC (rev 18521)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-11-09 22:36:17 UTC (rev 18522)
@@ -68,7 +68,7 @@
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
- content = FileUtil.readStream(file.getContents());
+ content = FileUtil.readStream(file);
for(TestTextChange change : changeStructure.getTextChanges()){
assertEquals("There is unexpected change in resource - "+file.getName(),change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2009-11-09 22:35:15 UTC (rev 18521)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2009-11-09 22:36:17 UTC (rev 18522)
@@ -32,6 +32,7 @@
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
@@ -290,7 +291,7 @@
IFile newComponent = project.getFile("src/action/demo/TestComponentForVarAttributes.1");
IFile emptyComponent = project.getFile("src/action/demo/TestComponentForVarAttributes.2");
try{
- component.setContents(newComponent.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(newComponent, component, true, false, new NullProgressMonitor());
}catch(Exception e){
JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.1'", e);
}
@@ -300,7 +301,7 @@
checkProposals("/WebContent/varAttributes.xhtml", 640, new String[]{"item.name"}, false);
try{
- component.setContents(emptyComponent.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(emptyComponent, component, true, false, new NullProgressMonitor());
}catch(Exception e){
JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.2'", e);
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2009-11-09 22:35:15 UTC (rev 18521)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2009-11-09 22:36:17 UTC (rev 18522)
@@ -39,7 +39,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.navigator.CommonNavigator;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -100,15 +100,24 @@
fail("Cannot find test data file 'WebContent/WEB-INF/components.1'");
}
-
+ InputStream is = null;
try {
- componentsFile.setContents(file1.getContents(),
- true, false, new NullProgressMonitor());
+ is = file1.getContents();
+ componentsFile.setContents(is,
+ true, false, new NullProgressMonitor());
} catch (CoreException e) {
JUnitUtils.fail("Error in changing 'components.xml' content to " +
"'WebContent/WEB-INF/components.1'", e);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
-
+
refreshProject(project);
navigator.getCommonViewer().refresh(true);
@@ -149,7 +158,7 @@
}
try{
- componentsFile.setContents(file1.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(file1, componentsFile, true, false, new NullProgressMonitor());
}catch(Exception ex){
JUnitUtils.fail("Error in changing 'components.xml' content to " +
"'WebContent/WEB-INF/components.2'", ex);
@@ -172,7 +181,7 @@
fail("Cannot find test data file 'WebContent/WEB-INF/components.3'");
}
try{
- componentsFile.setContents(file1.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(file1, componentsFile, true, false, new NullProgressMonitor());
}catch(Exception ex){
JUnitUtils.fail("Error in changing 'components.xml' content to " +
"'WebContent/WEB-INF/components.3'", ex);
@@ -209,22 +218,32 @@
IFile file1 = project.getFile("WebContent/WEB-INF/components.4");
assertTrue("Cannot find components.2 in test project", file1 != null && file1.exists());
-
- try{
- componentsFile.setContents(file1.getContents(), true, false, new NullProgressMonitor());
- }catch(Exception ex){
- JUnitUtils.fail("Cannot read file WebContent/WEB-INF/components.4", ex);
+
+ InputStream is = null;
+ try {
+ is = file1.getContents();
+ componentsFile.setContents(is,
+ true, false, new NullProgressMonitor());
+ } catch (CoreException e) {
+ JUnitUtils.fail("Cannot read file WebContent/WEB-INF/components.4", e);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
-
+
refreshProject(project);
navigator.getCommonViewer().refresh(true);
navigator.getCommonViewer().expandAll();
-
+
seamPackage = findSeamPackage(tree, "myNewPackage");
assertTrue("Package \"myNewPackage\" found!",seamPackage==null);
+ }
- }
-
public void testAddComponentInClass(){
classFile = project.getFile("JavaSource/demo/Person.java");
@@ -289,7 +308,7 @@
assertTrue("Cannot find Person.2 in test project", file1 != null && file1.exists());
try{
- classFile.setContents(file1.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(file1, classFile, true, false, new NullProgressMonitor());
}catch(Exception ex){
JUnitUtils.fail("Cannot read file JavaSource/demo/Person.2", ex);
}
@@ -311,7 +330,7 @@
assertTrue("Cannot find Person.3 in test project", file2 != null && file2.exists());
try{
- classFile.setContents(file2.getContents(), true, false, new NullProgressMonitor());
+ FileUtil.copyContent(file2, classFile, true, false, new NullProgressMonitor());
}catch(Exception ex){
JUnitUtils.fail("Cannot read file JavaSource/demo/Person.3", ex);
}
15 years, 1 month
JBoss Tools SVN: r18521 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-09 17:35:15 -0500 (Mon, 09 Nov 2009)
New Revision: 18521
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5179
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-11-09 22:31:47 UTC (rev 18520)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-11-09 22:35:15 UTC (rev 18521)
@@ -43,6 +43,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.jboss.tools.common.CommonPlugin;
public final class FileUtil {
@@ -203,6 +204,22 @@
return content;
}
+ public static void copyContent(IFile from, IFile to, boolean force, boolean keepHistory, IProgressMonitor monitor) throws CoreException {
+ InputStream is = null;
+ try {
+ is = from.getContents();
+ to.setContents(is, force, keepHistory, monitor);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ CommonPlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ }
+
public static boolean writeFile(File f, String value) {
return writeFileWithEncodingCheck(f, value, null);
}
15 years, 1 month
JBoss Tools SVN: r18520 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-09 17:31:47 -0500 (Mon, 09 Nov 2009)
New Revision: 18520
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
JBIDE-5177
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-11-09 22:26:49 UTC (rev 18519)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-11-09 22:31:47 UTC (rev 18520)
@@ -307,6 +307,7 @@
}
public IStatus[] deleteResource(IPath resource, IProgressMonitor monitor) {
+ resource = deployRootFolder.append(resource);
if( resource.toFile().isDirectory())
return deleteDirectory(resource.toFile(), monitor);
if( !resource.toFile().delete()) {
@@ -398,8 +399,8 @@
return false;
}
- public IStatus[] makeDirectoryIfRequired(IPath dir, IProgressMonitor monitor) {
- dir.toFile().mkdirs();
+ public IStatus[] makeDirectoryIfRequired(IPath relativeDir, IProgressMonitor monitor) {
+ deployRootFolder.append(relativeDir).toFile().mkdirs();
return new IStatus[] {Status.OK_STATUS};
}
15 years, 1 month
JBoss Tools SVN: r18518 - trunk/bpel/plugins/org.jboss.tools.bpel.cheatsheet/src.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-09 17:26:18 -0500 (Mon, 09 Nov 2009)
New Revision: 18518
Modified:
trunk/bpel/plugins/org.jboss.tools.bpel.cheatsheet/src/
Log:
svn propset svn:ignore . bin
Property changes on: trunk/bpel/plugins/org.jboss.tools.bpel.cheatsheet/src
___________________________________________________________________
Name: svn:ignore
+ .
15 years, 1 month
JBoss Tools SVN: r18517 - trunk/tests/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-09 17:08:47 -0500 (Mon, 09 Nov 2009)
New Revision: 18517
Added:
trunk/tests/tests/org.jboss.tools.tests/
Removed:
org.jboss.tools.tests/
Log:
make plugin ID and directory the same value to avoid confusion
Copied: trunk/tests/tests/org.jboss.tools.tests (from rev 18516, org.jboss.tools.tests)
15 years, 1 month
JBoss Tools SVN: r18516 - trunk/tests/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-11-09 17:05:50 -0500 (Mon, 09 Nov 2009)
New Revision: 18516
Added:
org.jboss.tools.tests/
Removed:
trunk/tests/tests/org.jboss.tools.test/
Log:
make plugin ID and directory the same value to avoid confusion
Copied: org.jboss.tools.tests (from rev 18515, trunk/tests/tests/org.jboss.tools.test)
15 years, 1 month
JBoss Tools SVN: r18515 - trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-11-09 16:32:30 -0500 (Mon, 09 Nov 2009)
New Revision: 18515
Modified:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
Log:
another attempt to fix JMXCOnnection test errors
Modified: trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java
===================================================================
--- trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2009-11-09 19:52:09 UTC (rev 18514)
+++ trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/tests/DefaultProviderTest.java 2009-11-09 21:32:30 UTC (rev 18515)
@@ -109,7 +109,7 @@
ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
HashMap map = new HashMap();
map.put(DefaultConnectionProvider.ID, "Test Connection");
- map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://127.0.0.1:9999" +
+ map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999" +
"/jmxrmi");
map.put(DefaultConnectionProvider.USERNAME, "");
map.put(DefaultConnectionProvider.PASSWORD, "");
15 years, 1 month
JBoss Tools SVN: r18514 - in trunk: jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-09 14:52:09 -0500 (Mon, 09 Nov 2009)
New Revision: 18514
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/ELReference.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/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
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/SeamContextVariableRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5179
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-11-09 19:32:58 UTC (rev 18513)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -12,7 +12,6 @@
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
@@ -64,7 +63,6 @@
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.project.ModelNature;
import org.jboss.tools.common.model.project.ModelNatureExtension;
-import org.jboss.tools.common.util.FileUtil;
import org.osgi.framework.Bundle;
public class EclipseResourceUtil {
@@ -986,23 +984,4 @@
path = path.toLowerCase();
return path.endsWith(".jar") || path.endsWith(".zip"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- public static String getFileContent(IFile file) {
- InputStream is = null;
- try {
- is = file.getContents();
- return FileUtil.readStream(is);
- } catch (CoreException e) {
- ModelPlugin.getPluginLog().logError(e);
- return null;
- } finally {
- if(is!=null) {
- try {
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
- }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2009-11-09 19:32:58 UTC (rev 18513)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -73,6 +73,7 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
import org.jboss.tools.jsf.project.JSFNature;
@@ -268,7 +269,13 @@
removeAllMessagesFromResource(file);
displaySubtask(JSFValidationMessages.VALIDATING_EL_FILE, new String[]{file.getProject().getName(), file.getName()});
String ext = file.getFileExtension();
- String content = EclipseResourceUtil.getFileContent(file);
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+
if(ext.equalsIgnoreCase(JAVA_EXT)) {
validateJava(file, content);
} else {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/ELReference.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/ELReference.java 2009-11-09 19:32:58 UTC (rev 18513)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/ELReference.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -28,8 +28,8 @@
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.el.core.parser.SyntaxError;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.w3c.dom.Element;
@@ -117,7 +117,12 @@
public ELExpression[] getEl() {
if(el==null) {
Set<ELExpression> exps = new HashSet<ELExpression>();
- String content = EclipseResourceUtil.getFileContent(getResource());
+ String content = null;
+ try {
+ content = FileUtil.readStream(getResource());
+ } catch (CoreException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
String elText = content.substring(startPosition, startPosition + length);
int startEl = elText.indexOf("#{"); //$NON-NLS-1$
if(startEl>-1) {
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-11-09 19:32:58 UTC (rev 18513)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -30,8 +30,8 @@
import org.eclipse.text.edits.TextEdit;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
@@ -218,7 +218,13 @@
if(!isFileCorrect(file))
return;
- String content = EclipseResourceUtil.getFileContent(file);
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+
String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
if(text.startsWith("<")){ //$NON-NLS-1$
int position = text.lastIndexOf("/>"); //$NON-NLS-1$
@@ -238,7 +244,13 @@
if(!isFileCorrect(file))
return;
- String content = EclipseResourceUtil.getFileContent(file);
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+
String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
int openBracket = text.indexOf("("); //$NON-NLS-1$
int openQuote = text.indexOf("\""); //$NON-NLS-1$
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-11-09 19:32:58 UTC (rev 18513)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -78,7 +78,6 @@
import org.jboss.tools.seam.internal.core.refactoring.RenameSeamContextVariableProcessor;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.SeamUIUtil;
import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
import org.jboss.tools.seam.ui.wizard.RenameSeamContextVariableWizard;
import org.w3c.dom.Node;
@@ -175,7 +174,11 @@
selectedText = selection.getText();
- fileContent = EclipseResourceUtil.getFileContent(editorFile);
+ try {
+ fileContent = FileUtil.readStream(editorFile);
+ } catch (CoreException e) {
+ SeamGuiPlugin.getDefault().logError(e);
+ }
boolean status = false;
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-11-09 19:32:58 UTC (rev 18513)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -9,7 +9,6 @@
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.text.edits.MultiTextEdit;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
@@ -131,15 +130,17 @@
assertNotNull("Can't load component " + newName, seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
- String content = EclipseResourceUtil.getFileContent(file);
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
//System.out.println("File - "+file.getName()+" offset - "+changeStructure.getOffset()+" expected - ["+changeStructure.getText()+"] actual - ["+content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength())+"]");
for(TestTextChange change : changeStructure.getTextChanges()){
assertEquals("There is unexpected change in resource - "+file.getName(),change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
}
}
}
-
-
-
-
}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-11-09 19:32:58 UTC (rev 18513)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamContextVariableRefactoringTest.java 2009-11-09 19:52:09 UTC (rev 18514)
@@ -9,7 +9,6 @@
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.text.edits.MultiTextEdit;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.internal.core.refactoring.RenameSeamContextVariableProcessor;
@@ -26,14 +25,21 @@
// Test before renaming
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
- String content = EclipseResourceUtil.getFileContent(file);
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+
for(TestTextChange change : changeStructure.getTextChanges()){
assertNotSame(change.getText(), content.substring(change.getOffset(), change.getOffset()+change.getLength()));
}
}
IFile sourceFile = seamProject.getProject().getFile(fileName);
-
+
// Rename Seam Context Variable
RenameSeamContextVariableProcessor processor = new RenameSeamContextVariableProcessor(sourceFile, variableName);
processor.setNewName(newName);
15 years, 1 month