JBoss Tools SVN: r31686 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-05-31 14:48:48 -0400 (Tue, 31 May 2011)
New Revision: 31686
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java
Log:
https://issues.jboss.org/browse/JBIDE-9020
Updated in order not to break testCDIBeanQueryParticipant(org.jboss.tools.cdi.ui.test.search.CDISearchParticipantTest) test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java 2011-05-31 17:41:04 UTC (rev 31685)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java 2011-05-31 18:48:48 UTC (rev 31686)
@@ -44,5 +44,5 @@
praiseEvent.fire(new Praise());
}
- @Inject void foo(Object o) {}
+ @Inject void foo(String o) {}
}
13 years, 6 months
JBoss Tools SVN: r31685 - branches/jbosstools-3.2.x/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-31 13:41:04 -0400 (Tue, 31 May 2011)
New Revision: 31685
Modified:
branches/jbosstools-3.2.x/build/target-platform/build.xml
branches/jbosstools-3.2.x/build/target-platform/jbds.target
branches/jbosstools-3.2.x/build/target-platform/targetUpdateFromRepo.xml
Log:
backport changes from trunk and attempt to find apache.commons.io another way
Modified: branches/jbosstools-3.2.x/build/target-platform/build.xml
===================================================================
--- branches/jbosstools-3.2.x/build/target-platform/build.xml 2011-05-31 16:57:48 UTC (rev 31684)
+++ branches/jbosstools-3.2.x/build/target-platform/build.xml 2011-05-31 17:41:04 UTC (rev 31685)
@@ -77,6 +77,10 @@
Or, simply call the jbds target, to use the defaults in the previous example:
$ ant jbds
+
+To run for JBDS target file WHILE JBT target file is being run:
+
+ $ ant jbds -DWORKINGDIR=${basedir}
</echo>
</target>
@@ -139,6 +143,8 @@
<!-- should work on osx-cocoa32, win32, lin32, lin64 -->
<target name="get.eclipse">
<!-- NOTE: must use same platform (50M) or SDK (103M - 168M) version as feature version on target platform, or will get install/update conflicts -->
+ <!-- don't forget to increment these files when moving up a version:
+ build.xml, *.target*, publish.sh, target2p2mirror.xml -->
<property name="eclipse.version" value="3.6.2" />
<property name="eclipse.URL" value="http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downl..." />
<!--
Modified: branches/jbosstools-3.2.x/build/target-platform/jbds.target
===================================================================
--- branches/jbosstools-3.2.x/build/target-platform/jbds.target 2011-05-31 16:57:48 UTC (rev 31684)
+++ branches/jbosstools-3.2.x/build/target-platform/jbds.target 2011-05-31 17:41:04 UTC (rev 31685)
@@ -2,12 +2,12 @@
<target includeMode="feature" name="jbds">
<locations>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <!-- Pro tip: to convert
- from org.eclipse.tptp.platform.xerces_4.6.0.v201005032111-777K4AkF7B77R7c7N77.jar
- to <unit version="4.6.0.v201005032111-777K4AkF7B77R7c7N77" id="org.eclipse.tptp.platform.xerces.feature.group"/>
- using vi, apply this transform:
- :%s/.\+\/\(org.\+\)_\(\d\+.\+\)\.jar/\t\t\t<unit id="\1.feature.group" version="\2"\/>/g
- -->
+ <!-- Pro tip: to convert
+ from org.eclipse.tptp.platform.xerces_4.6.0.v201005032111-777K4AkF7B77R7c7N77.jar
+ to <unit version="4.6.0.v201005032111-777K4AkF7B77R7c7N77" id="org.eclipse.tptp.platform.xerces.feature.group"/>
+ using vi, apply this transform:
+ :%s/.\+\/\(org.\+\)_\(\d\+.\+\)\.jar/\t\t\t<unit id="\1.feature.group" version="\2"\/>/g
+ -->
<!-- CVS -->
<unit id="org.eclipse.cvs.feature.group" version="1.2.0.v20100427-7B77FKt90GE5h0SBT5FV9A01911"/>
@@ -153,4 +153,7 @@
<repository location="http://download.jboss.org/jbosstools/updates/helios/"/>
</location>
</locations>
-</target>
+ <includeBundles>
+ <plugin id="org.apache.commons.io"/>
+ </includeBundles>
+ </target>
Modified: branches/jbosstools-3.2.x/build/target-platform/targetUpdateFromRepo.xml
===================================================================
--- branches/jbosstools-3.2.x/build/target-platform/targetUpdateFromRepo.xml 2011-05-31 16:57:48 UTC (rev 31684)
+++ branches/jbosstools-3.2.x/build/target-platform/targetUpdateFromRepo.xml 2011-05-31 17:41:04 UTC (rev 31685)
@@ -105,39 +105,60 @@
<delete dir="${tmpDir}" includeemptydirs="true" quiet="true" />
</target>
+ <!-- test examples:
+ cd ~/32x/build/target-platform
+ ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=swtbot
+ ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=js -DtargetFile=jbds.target -DrepoDir=`pwd`/JBDS_REPO/
+ -->
<target name="test.updateTargetFile" depends="check.content.xml, get.content.xml, copy.content.xml, contentXml2artifactVersions.xsl">
- <echo>Load *swtbot* properties from ${tmpDir}/artifactVersions.properties</echo>
+ <!-- properties to set commandline: -->
+ <property name="test.pattern" value="swtbot"/>
+ <property name="test.targetFile" value="${targetFile}"/>
+
+ <property name="tmpfile" value="${tmpDir}/test.updateTargetFile.tmp"/>
+ <property name="tmpfile2" value="${tmpDir}/test.updateTargetFile.tmpsed"/>
+ <echo level="info">Load /${test.pattern}/ properties from ${tmpDir}/artifactVersions.properties</echo>
<loadfile srcfile="${tmpDir}/artifactVersions.properties" property="artifactVersionsPropertiesContents">
<filterchain>
<linecontains>
- <contains value="swtbot" />
+ <contains value="${test.pattern}" />
<contains value="feature.group" />
</linecontains>
</filterchain>
</loadfile>
- <echo>${artifactVersionsPropertiesContents}</echo>
+ <echo file="${tmpfile}">${artifactVersionsPropertiesContents}</echo>
<antcall target="target2targetTemplate">
- <param name="outputFile" value="${tmpDir}/${unified.targetFile}.template" />
+ <param name="outputFile" value="${tmpDir}/${test.targetFile}.template" />
<param name="replacement.URL" value="${unified.URL}" />
</antcall>
- <echo>Generated ${tmpDir}/${unified.targetFile}.template: </echo>
- <exec executable="egrep">
- <arg line=""swtbot" ${tmpDir}/${unified.targetFile}.template" />
- </exec>
+ <!-- <echo level="info">Generated ${tmpDir}/${unified.targetFile}.template: </echo>
+ <exec executable="egrep">
+ <arg line=""${test.pattern}" ${tmpDir}/${test.targetFile}.template" />
+ </exec> -->
<antcall target="updateTargetFile">
- <param name="targetFile" value="${unified.targetFile}" />
+ <param name="targetFile" value="${test.targetFile}" />
</antcall>
- <echo>--
+ <echo level="info">--
If loaded version values (in artifactVersions.properties) do not match
-output below, an error has occurred or replace.versions is undefined.
+output below (values from repo), an error has occurred or replace.versions is undefined.
+It is also possible that the complete list of features in the repo is greater than those
+in the target. If so, clean the repo and regenerate to remove extraneous content.
--</echo>
- <exec executable="egrep">
- <arg line=""swtbot.*feature.group" ${unified.targetFile}" />
+ <!-- $ sed -n -e '/swtbot.*feature.group/ p' unified.target | sed -e 's/\t\t\t<unit id="\|"\/>//g' -->
+ <exec executable="sed" output="${tmpfile2}">
+ <arg line=" -n -e '/${test.pattern}.*feature.group/ p' ${test.targetFile}" />
</exec>
-
-
+ <exec executable="sed" output="${tmpfile}.2">
+ <arg line=" -e 's/\t\t\t<unit id="\|"\/>//g' ${tmpfile2} -e 's/" version="/.version=/g'" />
+ </exec>
+ <exec executable="sort" output="${tmpfile}.sorted"><arg line="${tmpfile}"/></exec>
+ <exec executable="sort" output="${tmpfile}.2.sorted"><arg line="${tmpfile}.2"/></exec>
+ <exec executable="diff" outputproperty="diffout">
+ <arg line="${tmpfile}.sorted ${tmpfile}.2.sorted"/>
+ </exec>
+ <echo>${diffout}</echo>
+ <antcall target="cleanup"/>
</target>
-
</project>
13 years, 6 months
JBoss Tools SVN: r31683 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-31 12:47:26 -0400 (Tue, 31 May 2011)
New Revision: 31683
Modified:
trunk/build/target-platform/targetUpdateFromRepo.xml
Log:
enhance test.updateTargetFile to do better validation of .target file vs. local repo contents (compare versions and check for missing files / dangling references
Modified: trunk/build/target-platform/targetUpdateFromRepo.xml
===================================================================
--- trunk/build/target-platform/targetUpdateFromRepo.xml 2011-05-31 16:31:29 UTC (rev 31682)
+++ trunk/build/target-platform/targetUpdateFromRepo.xml 2011-05-31 16:47:26 UTC (rev 31683)
@@ -105,39 +105,60 @@
<delete dir="${tmpDir}" includeemptydirs="true" quiet="true" />
</target>
+ <!-- test examples:
+ cd ~/32x/build/target-platform
+ ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=swtbot
+ ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=js -DtargetFile=jbds.target -DrepoDir=`pwd`/JBDS_REPO/
+ -->
<target name="test.updateTargetFile" depends="check.content.xml, get.content.xml, copy.content.xml, contentXml2artifactVersions.xsl">
- <echo>Load *swtbot* properties from ${tmpDir}/artifactVersions.properties</echo>
+ <!-- properties to set commandline: -->
+ <property name="test.pattern" value="swtbot"/>
+ <property name="test.targetFile" value="${targetFile}"/>
+
+ <property name="tmpfile" value="${tmpDir}/test.updateTargetFile.tmp"/>
+ <property name="tmpfile2" value="${tmpDir}/test.updateTargetFile.tmpsed"/>
+ <echo level="info">Load /${test.pattern}/ properties from ${tmpDir}/artifactVersions.properties</echo>
<loadfile srcfile="${tmpDir}/artifactVersions.properties" property="artifactVersionsPropertiesContents">
<filterchain>
<linecontains>
- <contains value="swtbot" />
+ <contains value="${test.pattern}" />
<contains value="feature.group" />
</linecontains>
</filterchain>
</loadfile>
- <echo>${artifactVersionsPropertiesContents}</echo>
+ <echo file="${tmpfile}">${artifactVersionsPropertiesContents}</echo>
<antcall target="target2targetTemplate">
- <param name="outputFile" value="${tmpDir}/${unified.targetFile}.template" />
+ <param name="outputFile" value="${tmpDir}/${test.targetFile}.template" />
<param name="replacement.URL" value="${unified.URL}" />
</antcall>
- <echo>Generated ${tmpDir}/${unified.targetFile}.template: </echo>
- <exec executable="egrep">
- <arg line=""swtbot" ${tmpDir}/${unified.targetFile}.template" />
- </exec>
+ <!-- <echo level="info">Generated ${tmpDir}/${unified.targetFile}.template: </echo>
+ <exec executable="egrep">
+ <arg line=""${test.pattern}" ${tmpDir}/${test.targetFile}.template" />
+ </exec> -->
<antcall target="updateTargetFile">
- <param name="targetFile" value="${unified.targetFile}" />
+ <param name="targetFile" value="${test.targetFile}" />
</antcall>
- <echo>--
+ <echo level="info">--
If loaded version values (in artifactVersions.properties) do not match
-output below, an error has occurred or replace.versions is undefined.
+output below (values from repo), an error has occurred or replace.versions is undefined.
+It is also possible that the complete list of features in the repo is greater than those
+in the target. If so, clean the repo and regenerate to remove extraneous content.
--</echo>
- <exec executable="egrep">
- <arg line=""swtbot.*feature.group" ${unified.targetFile}" />
+ <!-- $ sed -n -e '/swtbot.*feature.group/ p' unified.target | sed -e 's/\t\t\t<unit id="\|"\/>//g' -->
+ <exec executable="sed" output="${tmpfile2}">
+ <arg line=" -n -e '/${test.pattern}.*feature.group/ p' ${test.targetFile}" />
</exec>
-
-
+ <exec executable="sed" output="${tmpfile}.2">
+ <arg line=" -e 's/\t\t\t<unit id="\|"\/>//g' ${tmpfile2} -e 's/" version="/.version=/g'" />
+ </exec>
+ <exec executable="sort" output="${tmpfile}.sorted"><arg line="${tmpfile}"/></exec>
+ <exec executable="sort" output="${tmpfile}.2.sorted"><arg line="${tmpfile}.2"/></exec>
+ <exec executable="diff" outputproperty="diffout">
+ <arg line="${tmpfile}.sorted ${tmpfile}.2.sorted"/>
+ </exec>
+ <echo>${diffout}</echo>
+ <antcall target="cleanup"/>
</target>
-
</project>
13 years, 6 months
JBoss Tools SVN: r31682 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2011-05-31 12:31:29 -0400 (Tue, 31 May 2011)
New Revision: 31682
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
Log:
[hb-bot-test] fixed hibernate console test for postgres and mysql
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2011-05-31 15:02:56 UTC (rev 31681)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2011-05-31 16:31:29 UTC (rev 31682)
@@ -167,19 +167,11 @@
db.contextMenu("Refresh").click();
bot.sleep(TIME_1S);
db.expand();
- SWTBotTreeItem pub = null;
- try {
- pub = db.expandNode("public").select();
- }
- catch (WidgetNotFoundException e) {
- pub = db.expandNode("PUBLIC").select();
- }
-
+
+ SWTBotTreeItem pub = db.getItems()[0];
+ pub.select();
bot.sleep(TIME_500MS);
- // Workaround, DB content isn't correcly expanded (SWTBot 2.0.3)
- pub.doubleClick();
- bot.sleep(TIME_500MS);
pub.doubleClick();
bot.sleep(TIME_500MS);
DataHolder.tables = pub.getNodes();
13 years, 6 months
JBoss Tools SVN: r31681 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-05-31 11:02:56 -0400 (Tue, 31 May 2011)
New Revision: 31681
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/ESBProviderFactory.java
Log:
esb bot tests: fixed due to JBIDE-8568
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/ESBProviderFactory.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/ESBProviderFactory.java 2011-05-31 14:38:31 UTC (rev 31680)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/editor/ESBProviderFactory.java 2011-05-31 15:02:56 UTC (rev 31681)
@@ -64,7 +64,7 @@
protected void doFillForm(SWTBotShell shell) {
Assertions.assertButtonEnabled(shell.bot().button(IDELabel.Button.NEXT), false);
shell.bot().text(0).setText(this.uiName);
- shell.bot().text(1).setText(this.uiName);
+ shell.bot().comboBox().setSelection(0);
Assertions.assertButtonEnabled(shell.bot().button(IDELabel.Button.NEXT), true);
shell.bot().button(IDELabel.Button.NEXT).click();
Assertions.assertButtonEnabled(shell.bot().button(getFinishButton()), false);
@@ -78,7 +78,7 @@
protected void doFillForm(SWTBotShell shell) {
Assertions.assertButtonEnabled(shell.bot().button(IDELabel.Button.NEXT), false);
shell.bot().text(0).setText(this.uiName);
- shell.bot().text(1).setText(this.uiName);
+ shell.bot().comboBox().setSelection(0);
Assertions.assertButtonEnabled(shell.bot().button(IDELabel.Button.NEXT), true);
shell.bot().button(IDELabel.Button.NEXT).click();
Assertions.assertButtonEnabled(shell.bot().button(getFinishButton()), false);
13 years, 6 months
JBoss Tools SVN: r31680 - trunk/vpe/plugins/org.jboss.tools.vpe.html/templates.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-05-31 10:38:31 -0400 (Tue, 31 May 2011)
New Revision: 31680
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
Log:
https://issues.jboss.org/browse/JBIDE-8479 : HTML 5 support in Visual Page Editor
- added support of reversed attribute to ol tag
- added support of height, width and placeholder attributes to input tag
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2011-05-31 13:51:38 UTC (rev 31679)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2011-05-31 14:38:31 UTC (rev 31680)
@@ -1237,7 +1237,7 @@
<vpe:tag name="input" case-sensitive="no">
<vpe:if test="(@type='checkbox')|(@type='radio')">
<vpe:template children="no" modify="no">
- <vpe:copy attrs="id,style,class,type,checked,disabled">
+ <vpe:copy attrs="id,style,class,type,checked,disabled,height,width,placeholder">
<!--vpe:attribute name="disabled" value="disabled"/-->
</vpe:copy>
<vpe:dnd>
@@ -1247,7 +1247,7 @@
</vpe:if>
<vpe:if test="(@type='submit')|(@type='button')">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id,type,value,style,class,dir,disabled" />
+ <vpe:copy attrs="id,type,value,style,class,dir,disabled,height,width,placeholder" />
<!--span class="__button__tag" style="{@style}">
<nobr><vpe:value expr="{@value}"/></nobr>
</span-->
@@ -1265,7 +1265,7 @@
<vpe:if test="@type='reset'">
<vpe:if test="@value=''">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id,type,checked,class,style,dir,disabled">
+ <vpe:copy attrs="id,type,checked,class,style,dir,disabled,height,width,placeholder">
<vpe:attribute name="value" value="Reset" />
</vpe:copy>
<!--span class="__button__tag" style="{@style}">
@@ -1280,7 +1280,7 @@
</vpe:if>
<vpe:if test="not(@value='')">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id,type,checked,value,class,style,disabled" />
+ <vpe:copy attrs="id,type,checked,value,class,style,disabled,height,width,placeholder" />
<!--span class="__button__tag" style="{@style}">
<nobr><vpe:value expr="{@value}"/></nobr>
</span-->
@@ -1292,7 +1292,8 @@
<vpe:if test="@type='file'">
<vpe:template children="no" modify="no">
<input type="file" value="{@value}"
- class="{@styleClass}" style="{@style}" size="{@size}" disabled="{@disabled}" />
+ class="{@styleClass}" style="{@style}" size="{@size}" disabled="{@disabled}"
+ height="{@height}" width="{@width}" placeholder="{@placeholder}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -1311,11 +1312,12 @@
<vpe:template children="no" modify="no">
<!-- <img src="{@src}" width="20" height="20" />-->
<input type="image" value="{@value}" class="{@class}" style="{@style}"
- size="{@size}" disabled="{@disabled}" border="{@border}" dir="{@dir}" src="{src(@src)}" />
+ size="{@size}" disabled="{@disabled}" border="{@border}" dir="{@dir}" src="{src(@src)}"
+ height="{@height}" width="{@width}" placeholder="{@placeholder}" />
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="no">
- <vpe:copy attrs="id,type,style,class,value,size,dir,disabled" />
+ <vpe:copy attrs="id,type,style,class,value,size,dir,disabled,height,width,placeholder" />
<!--span class="__input__tag" style="{@style}">
<nobr><vpe:value expr="{@value}"/></nobr>
</span-->
@@ -1611,7 +1613,7 @@
<vpe:tag name="ol" case-sensitive="no">
<vpe:template children="yes" modify="no">
- <vpe:copy attrs="id,style,class,type,start,dir" />
+ <vpe:copy attrs="id,style,class,type,start,dir,reversed" />
<vpe:dnd>
<vpe:drop container="yes">
<vpe:container-child tag-name="del" />
@@ -2402,4 +2404,4 @@
</vpe:template>
</vpe:tag>
-</vpe:templates>
\ No newline at end of file
+</vpe:templates>
13 years, 6 months
JBoss Tools SVN: r31679 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-05-31 09:51:38 -0400 (Tue, 31 May 2011)
New Revision: 31679
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java
Log:
[JBIDE-9023] fixed CoreException
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java 2011-05-31 13:51:38 UTC (rev 31679)
@@ -0,0 +1,44 @@
+package org.jboss.ide.eclipse.as.core.util.internal;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Various util methods that allow to read and write to files.
+ *
+ * @author André Dietisheim
+ *
+ */
+public class FileUtils {
+
+ private static final int BUFFER = 65536;
+ private static byte[] buffer = new byte[BUFFER];
+
+ public static void writeTo(InputStream in, String fileName) throws IOException {
+ writeTo(in, new File(fileName));
+ }
+
+ public static void writeTo(InputStream in, File file) throws IOException {
+ OutputStream out = null;
+ try {
+ out = new BufferedOutputStream(new FileOutputStream(file));
+ writeTo(in, out);
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ public static void writeTo(InputStream in, OutputStream out) throws IOException {
+ int avail = in.read(buffer);
+ while (avail > 0) {
+ out.write(buffer, 0, avail);
+ avail = in.read(buffer);
+ }
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
JBoss Tools SVN: r31678 - 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: adietish
Date: 2011-05-31 09:44:40 -0400 (Tue, 31 May 2011)
New Revision: 31678
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
[JBIDE-9023] fixed CoreException
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 2011-05-31 11:20:38 UTC (rev 31677)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2011-05-31 13:44:40 UTC (rev 31678)
@@ -13,7 +13,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -31,7 +30,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.util.internal.ProgressMonitorUtil;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.Messages;
import org.eclipse.wst.server.core.internal.ProgressUtil;
@@ -44,6 +42,7 @@
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.internal.FileUtils;
/**
* Utility class with an assortment of useful file methods.
* <p>
@@ -113,8 +112,6 @@
public static class LocalCopyCallback implements IPublishCopyCallbackHandler {
- private static final int BUFFER = 65536;
- private static byte[] buf = new byte[BUFFER];
private static final File tempDir = ServerPlugin.getInstance().getStateLocation().toFile();
private static final String TEMPFILE_PREFIX = "tmp"; //$NON-NLS-1$
@@ -162,16 +159,8 @@
* @return a status
*/
private IStatus copyFile(InputStream in, String to) {
- OutputStream out = null;
-
try {
- out = new FileOutputStream(to);
-
- int avail = in.read(buf);
- while (avail > 0) {
- out.write(buf, 0, avail);
- avail = in.read(buf);
- }
+ FileUtils.writeTo(in, to);
return Status.OK_STATUS;
} catch (Exception e) {
//Trace.trace(Trace.SEVERE, "Error copying file", e);
@@ -183,12 +172,6 @@
} catch (Exception ex) {
// ignore
}
- try {
- if (out != null)
- out.close();
- } catch (Exception ex) {
- // ignore
- }
}
}
@@ -201,28 +184,11 @@
* @throws CoreException if anything goes wrong
*/
private IStatus copyFile(InputStream in, IPath to, long ts, IModuleFile mf) throws CoreException {
- OutputStream out = null;
-
File tempFile = null;
try {
File file = to.toFile();
-
- // Change from original PublishUtil, will require
- tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + to.getFileExtension(), getTempFolder()); //$NON-NLS-1$
-
- out = new FileOutputStream(tempFile);
-
- int avail = in.read(buf);
- while (avail > 0) {
- out.write(buf, 0, avail);
- avail = in.read(buf);
- }
-
- out.close();
- out = null;
-
+ tempFile = writeToTempFile(in, to);
moveTempFile(tempFile, file);
-
if (ts != IResource.NULL_STAMP && ts != 0)
file.setLastModified(ts);
} catch (CoreException e) {
@@ -239,16 +205,17 @@
} catch (Exception ex) {
// ignore
}
- try {
- if (out != null)
- out.close();
- } catch (Exception ex) {
- // ignore
- }
}
return null;
}
+ private File writeToTempFile(InputStream in, IPath filePath) throws IOException {
+ // Change from original PublishUtil, will require
+ File tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + filePath.getFileExtension(), getTempFolder()); //$NON-NLS-1$
+ FileUtils.writeTo(in, tempFile);
+ return tempFile;
+ }
+
/**
* Utility method to move a temp file into position by deleting the original and
* swapping in a new copy.
13 years, 6 months
JBoss Tools SVN: r31677 - in trunk: bpel/plugins/org.eclipse.bpel.apache.ode.runtime and 43 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-05-31 07:20:38 -0400 (Tue, 31 May 2011)
New Revision: 31677
Modified:
trunk/bpel/docs/reference/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/
trunk/bpmn/tests/org.eclipse.bpmn2.tests/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/
trunk/forge/plugins/org.jboss.tools.seam.forge/
trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test/
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/
trunk/maven/features/org.jboss.tools.maven.cdi.feature/
trunk/maven/features/org.jboss.tools.maven.hibernate.feature/
trunk/maven/features/org.jboss.tools.maven.jsf.feature/
trunk/maven/features/org.jboss.tools.maven.portlet.feature/
trunk/maven/plugins/org.jboss.tools.maven.project.examples/
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/
trunk/runtime/features/org.jboss.tools.runtime.feature/
trunk/runtime/plugins/org.jboss.tools.runtime/
trunk/runtime/site/
trunk/runtime/tests/org.jboss.tools.runtime.test/
trunk/seam/plugins/org.jboss.tools.seam.base.test/
trunk/seam/tests/org.jboss.tools.seam211GA.core.test/
trunk/seam/tests/org.jboss.tools.seam212GA.core.test/
trunk/seam/tests/org.jboss.tools.seam212GA.ui.test/
trunk/seam/tests/org.jboss.tools.seam220CR1.core.test/
trunk/seam/tests/org.jboss.tools.seam220GA.core.test/
trunk/seam/tests/org.jboss.tools.seam221CR1.core.test/
trunk/seam/tests/org.jboss.tools.seam221CR1.ui.test/
trunk/seam/tests/org.jboss.tools.seam221CR2.core.test/
trunk/seam/tests/org.jboss.tools.seam221CR2.ui.test/
trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/
trunk/tests/plugins/org.jboss.tools.tests.performance/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test/
trunk/usage/features/org.jboss.tools.usage.feature/
trunk/usage/features/org.jboss.tools.usage.test.feature/
trunk/usage/plugins/org.jboss.tools.usage/
trunk/usage/site/
trunk/usage/tests/org.jboss.tools.usage.test/
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/
trunk/vpe/tests/org.jboss.tools.vpe.docbook.test/
Log:
fixed a bunch of svn:ignores (similar to what happend in 3.2.x branch)
Property changes on: trunk/bpel/docs/reference
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime
___________________________________________________________________
Modified: svn:ignore
- bin
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/bpmn/tests/org.eclipse.bpmn2.tests
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.faces.core
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test
___________________________________________________________________
Modified: svn:ignore
- screenshots
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/forge/plugins/org.jboss.tools.seam.forge
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/jbpm/tests/org.jboss.tools.jbpm.ui.bot.test
___________________________________________________________________
Modified: svn:ignore
- screenshots
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/features/org.jboss.tools.maven.cdi.feature
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/features/org.jboss.tools.maven.hibernate.feature
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/features/org.jboss.tools.maven.jsf.feature
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/features/org.jboss.tools.maven.portlet.feature
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/features/org.jboss.tools.runtime.feature
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/site
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/tests/org.jboss.tools.runtime.test
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.base.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam211GA.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam212GA.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam212GA.ui.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam220CR1.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam220GA.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam221CR1.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam221CR1.ui.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam221CR2.core.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/seam/tests/org.jboss.tools.seam221CR2.ui.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/tests/plugins/org.jboss.tools.tests.performance
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/usage/features/org.jboss.tools.usage.feature
___________________________________________________________________
Modified: svn:ignore
- .settings
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/usage/features/org.jboss.tools.usage.test.feature
___________________________________________________________________
Modified: svn:ignore
- .settings
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/usage/plugins/org.jboss.tools.usage
___________________________________________________________________
Modified: svn:ignore
- bin
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/usage/site
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test
___________________________________________________________________
Modified: svn:ignore
- bin
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe.base.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.docbook.test
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
13 years, 6 months