+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
+ * Copyright (C) 2015 The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.io;
import static org.testng.AssertJUnit.assertNotNull;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.json.binding.biojson.v1.ColourSchemeMapper;
import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ZappoColourScheme;
import java.io.IOException;
import java.util.ArrayList;
for (Sequence seq : seqs)
{
- seq.setDatasetSequence(seq);
+ seq.createDatasetSequence();
expectedSeqs.put(seq.getName(), seq);
}
grpSeqs.add(seqs[2]);
grpSeqs.add(seqs[3]);
grpSeqs.add(seqs[4]);
- ColourSchemeI scheme = JSONFile.getJalviewColorScheme("zappo");
SequenceGroup seqGrp = new SequenceGroup(grpSeqs, "JGroup:1883305585",
- scheme, true, true, false, 21, 29);
+ null, true, true, false, 21, 29);
+ ColourSchemeI scheme = ColourSchemeMapper.getJalviewColourScheme(
+ "zappo", seqGrp);
+ seqGrp.cs = scheme;
seqGrp.setShowNonconserved(false);
seqGrp.setDescription(null);
jf.getColumnSelection(), AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
af.getViewport().setShowSequenceFeatures(jf.isShowSeqFeatures());
- af.changeColour(jf.getColourScheme());
+ String colourSchemeName = jf.getGlobalColourScheme();
+ ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme(
+ colourSchemeName, alignment);
+ af.changeColour(cs);
af.getViewport().setFeaturesDisplayed(jf.getDisplayedFeatures());
formatAdapter = new AppletFormatAdapter(af.alignPanel, exportSettings);
passedCount = 0;
}
- @AfterTest
+ @AfterTest(alwaysRun = true)
public void tearDown() throws Exception
{
testJsonFile = null;
@Test(groups = { "Functional" })
public void colorSchemeTest()
{
- Assert.assertNotNull(testJsonFile.getColourScheme(),
+ Assert.assertNotNull(testJsonFile.getGlobalColourScheme(),
"Colourscheme is null, parsing failed!");
- Assert.assertTrue(
- testJsonFile.getColourScheme() instanceof ZappoColourScheme,
+ Assert.assertEquals(testJsonFile.getGlobalColourScheme(), "Zappo",
"Zappo colour scheme expected!");
}
+ actualGrp.getStartRes());
System.out.println(expectedGrp.getEndRes() + " | "
+ actualGrp.getEndRes());
+ System.out.println(expectedGrp.cs + " | " + actualGrp.cs);
if (expectedGrp.getName().equals(actualGrp.getName())
&& expectedGrp.getColourText() == actualGrp.getColourText()
&& expectedGrp.getDisplayBoxes() == actualGrp.getDisplayBoxes()
&& expectedGrp.getIgnoreGapsConsensus() == actualGrp
.getIgnoreGapsConsensus()
- && expectedGrp.cs.equals(actualGrp.cs)
+ && (expectedGrp.cs.getClass().equals(actualGrp.cs.getClass()))
&& expectedGrp.getSequences().size() == actualGrp
.getSequences().size()
&& expectedGrp.getStartRes() == actualGrp.getStartRes()