diff truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineSingleThreadedTest.java @ 22325:414e82b9fc35

Release 0.9 is out, let's remove deprecated elements from the API
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Fri, 23 Oct 2015 20:23:00 +0200
parents dcb70d90c11d
children 906a5f6e07cc
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineSingleThreadedTest.java	Fri Oct 23 20:22:44 2015 +0200
+++ b/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineSingleThreadedTest.java	Fri Oct 23 20:23:00 2015 +0200
@@ -24,10 +24,9 @@
 
 import com.oracle.truffle.api.source.Source;
 import com.oracle.truffle.api.vm.PolyglotEngine;
+import java.io.File;
 import java.io.IOException;
 import java.io.StringReader;
-import java.net.URI;
-import java.net.URISyntaxException;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -47,23 +46,20 @@
         t.join();
     }
 
-    @SuppressWarnings("deprecation")
     @Test(expected = IllegalStateException.class)
-    public void evalURI() throws IOException, URISyntaxException {
-        tvm.eval(new URI("http://unknown.js"));
+    public void evalURI() throws IOException {
+        tvm.eval(Source.fromURL(new File(".").toURI().toURL(), "wrong.test"));
     }
 
-    @SuppressWarnings("deprecation")
     @Test(expected = IllegalStateException.class)
     public void evalString() throws IOException {
-        tvm.eval("text/javascript", "1 + 1");
+        tvm.eval(Source.fromText("1 + 1", "wrong.test").withMimeType("text/javascript"));
     }
 
-    @SuppressWarnings("deprecation")
     @Test(expected = IllegalStateException.class)
     public void evalReader() throws IOException {
         try (StringReader sr = new StringReader("1 + 1")) {
-            tvm.eval("text/javascript", sr);
+            tvm.eval(Source.fromReader(sr, "wrong.test").withMimeType("text/javascript"));
         }
     }