Search in sources :

Example 6 with JSONException

use of com.oracle.truffle.tools.utils.json.JSONException in project graal by oracle.

the class GraalChannelTest method testReleaseNoBases.

@Test
public void testReleaseNoBases() throws Exception {
    Path p = dataFile("data/rel-no-bases.json");
    try (InputStream is = Files.newInputStream(p)) {
        JSONObject o = new JSONObject(new JSONTokener(is));
        ReleaseEntry e = channel.jsonToRelease("19.3.3-ee-jdk11", o);
        assertNull(e);
        fail("JSONexception expected.");
    } catch (JSONException ex) {
    // OK
    }
}
Also used : Path(java.nio.file.Path) JSONTokener(com.oracle.truffle.tools.utils.json.JSONTokener) JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) InputStream(java.io.InputStream) JSONException(com.oracle.truffle.tools.utils.json.JSONException) Test(org.junit.Test)

Aggregations

JSONException (com.oracle.truffle.tools.utils.json.JSONException)6 JSONObject (com.oracle.truffle.tools.utils.json.JSONObject)4 JSONTokener (com.oracle.truffle.tools.utils.json.JSONTokener)3 InputStreamReader (java.io.InputStreamReader)2 ArrayList (java.util.ArrayList)2 IncompatibleException (org.graalvm.component.installer.IncompatibleException)2 Version (org.graalvm.component.installer.Version)2 Command (com.oracle.truffle.tools.chromeinspector.commands.Command)1 JSONArray (com.oracle.truffle.tools.utils.json.JSONArray)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 PrintWriter (java.io.PrintWriter)1 Reader (java.io.Reader)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 Path (java.nio.file.Path)1 Map (java.util.Map)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 ComponentInfo (org.graalvm.component.installer.model.ComponentInfo)1 HttpConnectionException (org.graalvm.component.installer.remote.ProxyConnectionFactory.HttpConnectionException)1