зеркало из https://github.com/mozilla/pluotsorbet.git
Merge pull request #574 from yxl/listRoots
Implement FileSystemRegistry.listRoots.
This commit is contained in:
Коммит
376252ece1
|
@ -18,8 +18,9 @@ public class FileSystemRegistry {
|
|||
}
|
||||
|
||||
public static Enumeration listRoots() {
|
||||
System.out.println("FileSystemRegistry::listRoots() not implemented.");
|
||||
return new Vector().elements();
|
||||
Vector roots = new Vector();
|
||||
roots.addElement("");
|
||||
return roots.elements();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ casper.test.begin("unit tests", 7 + gfxTests.length, function(test) {
|
|||
function basicUnitTests() {
|
||||
casper.waitForText("DONE", function() {
|
||||
var content = this.getPageContent();
|
||||
if (content.contains("DONE: 71085 pass, 0 fail, 180 known fail, 0 unknown pass")) {
|
||||
if (content.contains("DONE: 71087 pass, 0 fail, 180 known fail, 0 unknown pass")) {
|
||||
test.pass('main unit tests');
|
||||
} else {
|
||||
this.debugPage();
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package javax.microedition.io.file;
|
||||
|
||||
import gnu.testlet.TestHarness;
|
||||
import gnu.testlet.Testlet;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import javax.microedition.io.Connector;
|
||||
|
||||
public class TestFileSystemRegistry implements Testlet {
|
||||
|
||||
public void test(TestHarness th) {
|
||||
try {
|
||||
testListRoots(th);
|
||||
} catch (Throwable e) {
|
||||
th.todo(false, "Unexpected exception: " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void testListRoots(TestHarness th) throws IOException {
|
||||
Enumeration rootEnum = FileSystemRegistry.listRoots();
|
||||
th.check(rootEnum != null);
|
||||
while (rootEnum.hasMoreElements()) {
|
||||
String root = (String)rootEnum.nextElement();
|
||||
FileConnection fc = (FileConnection)Connector.open("file:///" + root);
|
||||
th.check(fc != null);
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче