X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Ftest%2FJalviewJSTest.java;fp=utils%2Ftest%2FJalviewJSTest.java;h=3e08024f3aef6281f072dcf18b46ed6bd81a7a18;hb=83a7efc57926ebf046f95de5291eb439563eb953;hp=d81e392115014fd92fb973ac047e0dc6fa166522;hpb=3e591f9bc92caedd17b9e6b368f6ef2185dc702c;p=jalview.git diff --git a/utils/test/JalviewJSTest.java b/utils/test/JalviewJSTest.java index d81e392..3e08024 100644 --- a/utils/test/JalviewJSTest.java +++ b/utils/test/JalviewJSTest.java @@ -1,7 +1,6 @@ package test; -import jalview.gui.Desktop; import jalview.gui.JvOptionPane; -import jalview.util.MessageManager; +import jalview.util.JSONUtils; import java.awt.BorderLayout; import java.awt.ComponentOrientation; @@ -31,6 +30,8 @@ import javax.swing.SwingConstants; import javax.swing.WindowConstants; import javax.swing.border.TitledBorder; +import org.json.simple.parser.ParseException; + /** * A class with a main method entry point for ad hoc tests of JalviewJS * behaviour. The J2S transpiler should generate an html entry point for this @@ -40,9 +41,36 @@ public class JalviewJSTest extends JPanel { public static void main(String[] args) { - new JalviewJSTest().doTest5(); + new JalviewJSTest().doTest6(); } + void doTest6() + { + /* + * check for transpiler fix associated with JSONParser yylex.java use of charAt() + * instead of codePointAt(); moved here from PDBFTSRestClient + */ + + String s = "e"; + char c = 'c'; + char f = 'f'; + s += c | f; + int x = c & f; + int y = 2 & c; + int z = c ^ 5; + String result = s + x + y + z; + System.out.println("Expected " + "e103982102, found " + result); + try + { + Map jsonObj = (Map) JSONUtils + .parse("{\"a\":3}"); + System.out.println(jsonObj); + } catch (ParseException e) + { + e.printStackTrace(); + } + } + /** * Dialog message truncation */ @@ -259,10 +287,12 @@ private ImageIcon getImage(String name) { ImageIcon icon = new ImageIcon(getClass().getResource(name)); while(icon.getImageLoadStatus() == MediaTracker.LOADING) - try { - Thread.sleep(10); - } catch (InterruptedException e) { - } + { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + } + } return icon; } }