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 4155 Details for
Bug 12359
[resources] Tests and the libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for core.tests.resources
org.eclipse.core.tests.resources-30981-diff.txt (text/plain), 2.63 KB, created by
Rafael Chaves
on 2003-03-14 17:54:46 EST
(
hide
)
Description:
patch for core.tests.resources
Filename:
MIME Type:
Creator:
Rafael Chaves
Created:
2003-03-14 17:54:46 EST
Size:
2.63 KB
patch
obsolete
>Index: src/org/eclipse/core/tests/internal/localstore/RefreshLocalTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/RefreshLocalTest.java,v >retrieving revision 1.8 >diff -u -r1.8 RefreshLocalTest.java >--- src/org/eclipse/core/tests/internal/localstore/RefreshLocalTest.java 20 Feb 2003 22:50:54 -0000 1.8 >+++ src/org/eclipse/core/tests/internal/localstore/RefreshLocalTest.java 27 Feb 2003 16:48:32 -0000 >@@ -11,9 +11,12 @@ > package org.eclipse.core.tests.internal.localstore; > > import java.io.File; >+import java.io.IOException; > > import junit.framework.Test; > import junit.framework.TestSuite; >+ >+import org.eclipse.core.boot.BootLoader; > import org.eclipse.core.internal.resources.*; > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; >@@ -222,7 +225,7 @@ > IFile file = project.getFile("file"); > File target = file.getLocation().toFile(); > ensureExistsInWorkspace(file, true); >- ensureDoesNotExistInFileSystem(file); >+ ensureDoesNotExistInFileSystem(file); > assertTrue("1.0", file.exists()); > file.refreshLocal(IResource.DEPTH_INFINITE, null); > assertTrue("1.1", !file.exists()); >@@ -235,5 +238,41 @@ > folder.refreshLocal(IResource.DEPTH_INFINITE, null); > assertTrue("2.1", folder.exists()); > assertTrue("2.2", ((Resource) folder).countResources(IResource.DEPTH_INFINITE, false) == (getTree(target).length + 1)); >+} >+/** >+ * Tests if files with names that are invalid segments are properly rejected - does not run on Windows. >+ */ >+public void testDiscoverFileWithInvalidName() { >+ >+ if (BootLoader.getOS().equals(BootLoader.OS_WIN32)) >+ return; >+ >+ /* initialize common objects */ >+ IProject project = projects[0]; >+ >+ /* test root deletion */ >+ IFile file = project.getFile("file.txt"); >+ File target = file.getLocation().toFile(); >+ ensureExistsInFileSystem(file); >+ >+ File fileWithInvalidName = new File(project.getLocation().toFile(), "a\\b"); >+ try { >+ assertTrue("0.1", fileWithInvalidName.createNewFile()); >+ } catch (IOException e) { >+ fail("0.2", e); >+ } >+ assertTrue("1.0", !file.exists()); >+ try { >+ project.refreshLocal(IResource.DEPTH_INFINITE, getMonitor()); >+ fail("2.0 - should have failed"); >+ } catch (CoreException ce) { >+ IStatus status = ce.getStatus(); >+ assertTrue("2.1", status.isMultiStatus()); >+ IStatus[] children = status.getChildren(); >+ assertEquals("2.2", 1, children.length); >+ assertTrue("2.3", children[0] instanceof ResourceStatus); >+ assertEquals("2.4", IResourceStatus.INVALID_RESOURCE_NAME, children[0].getCode()); >+ } >+ assertTrue("3.0", file.exists()); > } > }
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 12359
:
4146
|
4155
|
4171