Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
22324:ad67d348e361 | 22325:414e82b9fc35 |
---|---|
22 */ | 22 */ |
23 package com.oracle.truffle.api.test.vm; | 23 package com.oracle.truffle.api.test.vm; |
24 | 24 |
25 import com.oracle.truffle.api.source.Source; | 25 import com.oracle.truffle.api.source.Source; |
26 import com.oracle.truffle.api.vm.PolyglotEngine; | 26 import com.oracle.truffle.api.vm.PolyglotEngine; |
27 import java.io.File; | |
27 import java.io.IOException; | 28 import java.io.IOException; |
28 import java.io.StringReader; | 29 import java.io.StringReader; |
29 import java.net.URI; | |
30 import java.net.URISyntaxException; | |
31 import org.junit.Before; | 30 import org.junit.Before; |
32 import org.junit.Test; | 31 import org.junit.Test; |
33 | 32 |
34 public class EngineSingleThreadedTest { | 33 public class EngineSingleThreadedTest { |
35 PolyglotEngine tvm; | 34 PolyglotEngine tvm; |
45 }; | 44 }; |
46 t.start(); | 45 t.start(); |
47 t.join(); | 46 t.join(); |
48 } | 47 } |
49 | 48 |
50 @SuppressWarnings("deprecation") | |
51 @Test(expected = IllegalStateException.class) | 49 @Test(expected = IllegalStateException.class) |
52 public void evalURI() throws IOException, URISyntaxException { | 50 public void evalURI() throws IOException { |
53 tvm.eval(new URI("http://unknown.js")); | 51 tvm.eval(Source.fromURL(new File(".").toURI().toURL(), "wrong.test")); |
54 } | 52 } |
55 | 53 |
56 @SuppressWarnings("deprecation") | |
57 @Test(expected = IllegalStateException.class) | 54 @Test(expected = IllegalStateException.class) |
58 public void evalString() throws IOException { | 55 public void evalString() throws IOException { |
59 tvm.eval("text/javascript", "1 + 1"); | 56 tvm.eval(Source.fromText("1 + 1", "wrong.test").withMimeType("text/javascript")); |
60 } | 57 } |
61 | 58 |
62 @SuppressWarnings("deprecation") | |
63 @Test(expected = IllegalStateException.class) | 59 @Test(expected = IllegalStateException.class) |
64 public void evalReader() throws IOException { | 60 public void evalReader() throws IOException { |
65 try (StringReader sr = new StringReader("1 + 1")) { | 61 try (StringReader sr = new StringReader("1 + 1")) { |
66 tvm.eval("text/javascript", sr); | 62 tvm.eval(Source.fromReader(sr, "wrong.test").withMimeType("text/javascript")); |
67 } | 63 } |
68 } | 64 } |
69 | 65 |
70 @Test(expected = IllegalStateException.class) | 66 @Test(expected = IllegalStateException.class) |
71 public void evalSource() throws IOException { | 67 public void evalSource() throws IOException { |