4 import java.io.IOException;
5 import java.net.URISyntaxException;
6 import java.util.TreeMap;
8 import org.junit.Assert;
12 public class BioJsHTMLOutputTest
16 public void getJalviewAlignmentAsJsonString()
18 BioJsHTMLOutput bioJsHtmlOutput = new BioJsHTMLOutput(null, null);
19 String bjsTemplate = null;
22 bioJsHtmlOutput.updateBioJS();
23 bjsTemplate = BioJsHTMLOutput.getBioJsTemplateAsString();
24 // System.out.println(bjsTemplate);
25 } catch (IOException e)
29 Assert.assertNotNull(bjsTemplate);
32 @Test(expected = NullPointerException.class)
33 public void expectedNullPointerException()
35 BioJsHTMLOutput bjs = new BioJsHTMLOutput(null, null);
38 bjs.updateBioJSVersionsInfo(null);
39 } catch (URISyntaxException e)
41 Assert.fail("Expception occured while testing!");
47 public void getBioJsMSAVersions()
49 BioJsHTMLOutput bjs = new BioJsHTMLOutput(null, null);
50 TreeMap<String, File> versions = null;
54 .updateBioJSVersionsInfo(BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
55 } catch (URISyntaxException e)
57 Assert.fail("Expception occured while testing!");
60 Assert.assertNotNull("No versions found", versions);
61 Assert.assertTrue("One or more Templates required", versions.size() > 0);
63 .println("Number of discovered versions : "
65 for (String v : versions.keySet())
67 System.out.println("version : " + v);
68 System.out.println("File : " + versions.get(v));
71 System.out.println("\nCurrent latest version : "
72 + BioJsHTMLOutput.getCurrentBJSTemplateFile());
73 Assert.assertNotNull("Latest BioJsMSA version NOT found!",
74 BioJsHTMLOutput.getCurrentBJSTemplateFile());