import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
+import jalview.api.AlignViewportI;
import java.util.ArrayList;
import java.util.List;
import jalview.schemes.PIDColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.util.MapList;
+import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.ViewportRanges;
+import jalview.workers.AlignCalcManager;
public class AlignViewportTest
{
AlignmentI al;
- AlignViewport testee;
+ AlignmentViewport testee;
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- Jalview.main(new String[] { "-nonews", "-props",
+ Jalview.main(new String[] {
+ //"-jabaws", "none",
+ "-nonews", "-props",
"test/jalview/testProps.jvprops" });
/*
* remove any sequence mappings left lying around by other tests
*/
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
ssm.resetAll();
}
* mappings
*/
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
List<AlignedCodonFrame> sequenceMappings = ssm.getSequenceMappings();
assertEquals(2, sequenceMappings.size());
assertTrue(sequenceMappings.contains(acf1));
@Test(groups = { "Functional" })
public void testDeregisterMapping_withNoReference()
{
- Desktop d = Desktop.instance;
+ Desktop d = Desktop.getInstance();
assertNotNull(d);
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
ssm.resetAll();
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(
@Test(groups = { "Functional" })
public void testDeregisterMapping_withReference()
{
- Desktop d = Desktop.instance;
+ Desktop d = Desktop.getInstance();
assertNotNull(d);
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
+ .getStructureSelectionManager(Desktop.getInstance());
ssm.resetAll();
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(
@Test(groups = { "Functional" }, timeOut=2000)
public void testUpdateConservation_qualityOnly()
{
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
+ Cache.setPropertyNoSave("SHOW_ANNOTATIONS",
Boolean.TRUE.toString());
- Cache.applicationProperties.setProperty("SHOW_QUALITY",
+ Cache.setPropertyNoSave("SHOW_QUALITY",
Boolean.TRUE.toString());
- Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+ Cache.setPropertyNoSave("SHOW_CONSERVATION",
Boolean.FALSE.toString());
- Cache.applicationProperties.setProperty("SHOW_OCCUPANCY",
+ Cache.setPropertyNoSave("SHOW_OCCUPANCY",
Boolean.FALSE.toString());
- Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+ Cache.setPropertyNoSave("SHOW_IDENTITY",
Boolean.FALSE.toString());
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
{
synchronized (this)
{
- while (viewport.getCalcManager().isWorking())
+ System.out.print("waiting...");
+ int n = 3;
+ while (--n >= 0 || viewport.getCalcManager().isWorking())
{
try
{
+ System.out.print(((AlignCalcManager) viewport.getCalcManager()).getQueueLength());
wait(50);
} catch (InterruptedException e)
{
}
}
+ System.out.println("...done");
}
}
/*
* test for JAL-2283: don't inadvertently turn on colour by conservation
*/
- Cache.applicationProperties.setProperty("DEFAULT_COLOUR_PROT", "None");
- Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+ Cache.setPropertyNoSave("DEFAULT_COLOUR_PROT", "None");
+ Cache.setPropertyNoSave("SHOW_CONSERVATION",
Boolean.TRUE.toString());
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
{
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
- AlignViewport av = af.getViewport();
+ AlignViewportI av = af.getViewport();
SequenceGroup sg1 = new SequenceGroup();
SequenceGroup sg2 = new SequenceGroup();
SequenceGroup sg3 = new SequenceGroup();
jalview.bin.Cache.setProperty("SHOW_OCCUPANCY", Boolean.FALSE.toString());
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
- AlignViewport av = af.getViewport();
- Assert.assertNull(av.getAlignmentGapAnnotation(), "Preference did not disable occupancy row.");
+ AlignViewportI av = af.getViewport();
+ Assert.assertNull(av.getAlignmentGapAnnotation(),
+ "Preference did not disable occupancy row.");
int c = 0;
for (AlignmentAnnotation aa : av.getAlignment().findAnnotations(null,
null, "Occupancy"))
af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
av = af.getViewport();
- Assert.assertNotNull(av.getAlignmentGapAnnotation(), "Preference did not enable occupancy row.");
+ Assert.assertNotNull(av.getAlignmentGapAnnotation(),
+ "Preference did not enable occupancy row.");
c = 0;
for (AlignmentAnnotation aa : av.getAlignment().findAnnotations(null,
null, av.getAlignmentGapAnnotation().label))
AlignViewport testme = af.getViewport();
waitForCalculations(testme);
SequenceI cons = testme.getConsensusSeq();
- assertEquals("A-C", cons.getSequenceAsString());
+ String s = cons.getSequenceAsString();
+ System.out.println("s is " + s);
+
+ assertEquals("A-C", s);
}
@Test(groups = { "Functional" })