зеркало из https://github.com/mozilla/pluotsorbet.git
Implement FileSystemRegistry.listRoots.
This commit is contained in:
Родитель
0c6fec8042
Коммит
665e776257
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче