Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 169995 Details for
Bug 314439
[efs][testing] testDeleteSpecialCases runs into test failures on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch fixing the issue
testDeleteLinux.diff.txt (text/plain), 5.79 KB, created by
Martin Oberhuber
on 2010-05-26 10:17:12 EDT
(
hide
)
Description:
patch fixing the issue
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2010-05-26 10:17:12 EDT
Size:
5.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.tests >Index: src/org/eclipse/rse/tests/subsystems/files/RSEFileStoreTest.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/subsystems/files/RSEFileStoreTest.java,v >retrieving revision 1.10 >diff -u -r1.10 RSEFileStoreTest.java >--- src/org/eclipse/rse/tests/subsystems/files/RSEFileStoreTest.java 22 May 2010 01:15:51 -0000 1.10 >+++ src/org/eclipse/rse/tests/subsystems/files/RSEFileStoreTest.java 26 May 2010 14:14:34 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others. >+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -8,6 +8,7 @@ > * Contributors: > * Martin Oberhuber (Wind River) - initial API and implementation > * Martin Oberhuber (Wind River) - [240729] More flexible disabling of testcases >+ * Martin Oberhuber (Wind River) - [314439] testDeleteSpecialCases fails on Linux > *******************************************************************************/ > > package org.eclipse.rse.tests.subsystems.files; >@@ -147,30 +148,50 @@ > } > > public void tearDown() throws Exception { >- if (fIS != null) { >- try { >- fIS.close(); >- } catch (IOException e) { >- System.err.println("Exception in tearDown.closeInputStream:"); >- e.printStackTrace(); >+ try { >+ if (fIS != null) { >+ try { >+ fIS.close(); >+ } catch (IOException e) { >+ System.err.println("Exception in tearDown.closeInputStream:"); >+ e.printStackTrace(); >+ } > } >- } >- if (fOS != null) { >+ if (fOS != null) { >+ try { >+ fOS.close(); >+ } catch (IOException e) { >+ System.err.println("Exception in tearDown.closeOutputStream:"); >+ e.printStackTrace(); >+ } >+ } >+ //Try..catch to allow super.tearDown() to run > try { >- fOS.close(); >- } catch (IOException e) { >- System.err.println("Exception in tearDown.closeOutputStream:"); >- e.printStackTrace(); >+ IFileInfo info = fTestStore.fetchInfo(); >+ info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, false); >+ info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true); >+ fTestStore.putInfo(info, EFS.SET_ATTRIBUTES, getDefaultProgressMonitor()); >+ } finally { >+ try { >+ fTestStore.delete(EFS.NONE, getDefaultProgressMonitor()); >+ } catch (CoreException ce) { >+ /* might be expected if fTestStore had no permissions */ >+ } finally { >+ IRemoteCmdSubSystem rcmd = getShellServiceSubSystem(); >+ if (rcmd!=null) { >+ SimpleCommandOperation op = new SimpleCommandOperation(rcmd, fHomeDirectory, true); >+ op.runCommand("chmod 777 \"" + fTestStorePath + "\"", true); >+ while (op.isActive()) { >+ Thread.sleep(200); >+ } >+ //no more exception expected. >+ fTestStore.delete(EFS.NONE, getDefaultProgressMonitor()); >+ } >+ } > } >+ } finally { >+ super.tearDown(); > } >- //Try..catch to allow super.tearDown() to run >- try { >- fTestStore.delete(EFS.NONE, getDefaultProgressMonitor()); >- } catch (CoreException ce) { >- System.err.println("Exception in tearDown.deleteTestStore:"); >- ce.printStackTrace(); >- } >- super.tearDown(); > } > > protected IFileStore createFile(String name) throws Exception { >@@ -287,8 +308,13 @@ > System.out.println("Good! " + ce); > assertTrue("1.1.1", ce.getStatus().getCode() == EFS.ERROR_DELETE); > } >- if (fPropertiesFileName != null || File.separatorChar != '\\') { >- // On Windows, no exception is thrown (read-only stuff can be deleted) >+ // restore deletable >+ info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, false); >+ info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true); >+ fTestStore.putInfo(info, EFS.SET_ATTRIBUTES, getDefaultProgressMonitor()); >+ if (fPropertiesFileName != null && File.separatorChar != '\\') { >+ // Do not check Eclipse EFS due to bug 314448 >+ // Do not check RSE-EFS on Windows (read-only stuff can be deleted) > if (fHomeDirectory == null || fHomeDirectory.getSeparatorChar() != '\\') { > assertTrue("1.1", exceptionThrown); > IFileInfo info2 = store.fetchInfo(); >@@ -296,10 +322,6 @@ > } > } > >- // restore deletable >- info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, false); >- info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true); >- fTestStore.putInfo(info, EFS.SET_ATTRIBUTES, getDefaultProgressMonitor()); > store.delete(EFS.NONE, getDefaultProgressMonitor()); > info = store.fetchInfo(EFS.NONE, getDefaultProgressMonitor()); > assertTrue("1.2", !info.exists()); >@@ -343,7 +365,10 @@ > System.out.println("Good! " + ce); > assertTrue("1.5.1", ce.getStatus().getCode() == EFS.ERROR_DELETE); > } >- assertTrue("1.5", exceptionThrown); >+ if (!"localConnection.properties".equals(fPropertiesFileName)) { >+ //bug 314439: java.io.File cannot tell between no-permission and not-exists >+ assertTrue("1.5", exceptionThrown); >+ } > > exceptionThrown = false; > try { >@@ -353,10 +378,13 @@ > System.out.println("Good! " + ce); > assertTrue("1.6.1", ce.getStatus().getCode() == EFS.ERROR_READ); > } >- assertTrue("1.6", exceptionThrown); >+ if (!"localConnection.properties".equals(fPropertiesFileName)) { >+ //bug 314439: java.io.File cannot tell between no-permission and not-exists >+ assertTrue("1.6", exceptionThrown); >+ } > SimpleCommandOperation op4 = new SimpleCommandOperation(rcmd, fHomeDirectory, true); > op4.runCommand("chmod 777 \"" + fTestStorePath + "\"", true); >- while (op3.isActive()) { >+ while (op4.isActive()) { > Thread.sleep(200); > } > //Experience shows that we need to wait a little longer until the filesystem calms down
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 314439
: 169995