зеркало из 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() {
|
public static Enumeration listRoots() {
|
||||||
System.out.println("FileSystemRegistry::listRoots() not implemented.");
|
Vector roots = new Vector();
|
||||||
return new Vector().elements();
|
roots.addElement("");
|
||||||
|
return roots.elements();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ casper.test.begin("unit tests", 7 + gfxTests.length, function(test) {
|
||||||
function basicUnitTests() {
|
function basicUnitTests() {
|
||||||
casper.waitForText("DONE", function() {
|
casper.waitForText("DONE", function() {
|
||||||
var content = this.getPageContent();
|
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');
|
test.pass('main unit tests');
|
||||||
} else {
|
} else {
|
||||||
this.debugPage();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче