Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/TruffleVMSingleThreadedTest.java @ 22104:cf19259edf87
TruffleVM.eval and Source.withMimeType
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 24 Aug 2015 08:46:21 +0200 |
parents | 9c8c0937da41 |
children | dc83cc1f94f2 ffadd23c63c8 |
comparison
equal
deleted
inserted
replaced
22103:7646278cca8a | 22104:cf19259edf87 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
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 java.io.*; | 26 import java.io.*; |
26 import java.net.*; | 27 import java.net.*; |
27 | 28 |
28 import org.junit.*; | 29 import org.junit.*; |
29 | 30 |
43 }; | 44 }; |
44 t.start(); | 45 t.start(); |
45 t.join(); | 46 t.join(); |
46 } | 47 } |
47 | 48 |
49 @SuppressWarnings("deprecation") | |
48 @Test(expected = IllegalStateException.class) | 50 @Test(expected = IllegalStateException.class) |
49 public void evalURI() throws IOException, URISyntaxException { | 51 public void evalURI() throws IOException, URISyntaxException { |
50 tvm.eval(new URI("http://unknown.js")); | 52 tvm.eval(new URI("http://unknown.js")); |
51 } | 53 } |
52 | 54 |
55 @SuppressWarnings("deprecation") | |
53 @Test(expected = IllegalStateException.class) | 56 @Test(expected = IllegalStateException.class) |
54 public void evalString() throws IOException { | 57 public void evalString() throws IOException { |
55 tvm.eval("text/javascript", "1 + 1"); | 58 tvm.eval("text/javascript", "1 + 1"); |
56 } | 59 } |
57 | 60 |
61 @SuppressWarnings("deprecation") | |
58 @Test(expected = IllegalStateException.class) | 62 @Test(expected = IllegalStateException.class) |
59 public void evalReader() throws IOException { | 63 public void evalReader() throws IOException { |
60 try (StringReader sr = new StringReader("1 + 1")) { | 64 try (StringReader sr = new StringReader("1 + 1")) { |
61 tvm.eval("text/javascript", sr); | 65 tvm.eval("text/javascript", sr); |
62 } | 66 } |
63 } | 67 } |
64 | 68 |
65 @Test(expected = IllegalStateException.class) | 69 @Test(expected = IllegalStateException.class) |
70 public void evalSource() throws IOException { | |
71 tvm.eval(Source.fromText("", "Empty")); | |
72 } | |
73 | |
74 @Test(expected = IllegalStateException.class) | |
66 public void findGlobalSymbol() { | 75 public void findGlobalSymbol() { |
67 tvm.findGlobalSymbol("doesNotExists"); | 76 tvm.findGlobalSymbol("doesNotExists"); |
68 } | 77 } |
69 } | 78 } |