From d0daeb9399f3effac613d8df8431eaebf01a851a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 2 Jul 2014 15:35:09 -0700 Subject: [PATCH] JAL-1333 test suite for key functionality of java interface to chimera --- test/jalview/ext/rbvi/chimera/AllTests.java | 13 +++++++ test/jalview/ext/rbvi/chimera/ChimeraConnect.java | 39 +++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 test/jalview/ext/rbvi/chimera/AllTests.java create mode 100644 test/jalview/ext/rbvi/chimera/ChimeraConnect.java diff --git a/test/jalview/ext/rbvi/chimera/AllTests.java b/test/jalview/ext/rbvi/chimera/AllTests.java new file mode 100644 index 0000000..1d14751 --- /dev/null +++ b/test/jalview/ext/rbvi/chimera/AllTests.java @@ -0,0 +1,13 @@ +package jalview.ext.rbvi.chimera; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +@SuiteClasses( +{}) +public class AllTests +{ + +} diff --git a/test/jalview/ext/rbvi/chimera/ChimeraConnect.java b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java new file mode 100644 index 0000000..658c9c6 --- /dev/null +++ b/test/jalview/ext/rbvi/chimera/ChimeraConnect.java @@ -0,0 +1,39 @@ +package jalview.ext.rbvi.chimera; + +import static org.junit.Assert.*; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.Test; + +import ext.edu.ucsf.rbvi.strucviz2.*; + +public class ChimeraConnect +{ + + @Test + public void test() + { + StructureManager csm; + ext.edu.ucsf.rbvi.strucviz2.ChimeraManager cm = new ChimeraManager(csm = new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true)); + assertTrue("Couldn't launch chimera",cm.launchChimera(csm.getChimeraPaths())); + + int n=0; + while (n++<100) + { + try { + Thread.sleep(1000); + } catch (Exception q) + { + + } + Collection cms = cm.getChimeraModels(); + for (ChimeraModel cmod :cms) { + System.out.println(cmod.getModelName()); + } + } + cm.exitChimera(); + } + +} -- 1.7.10.2