import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.ext.jmol.JalviewJmolBinding;
-import jalview.gui.IProgressIndicator;
import jalview.io.DataSourceType;
import jalview.structure.StructureSelectionManager;
@Override
public int[] resizeInnerPanel(String data)
{
- // TODO Auto-generated method stub
return null;
}
@Override
public Map<String, Object> getJSpecViewProperty(String arg0)
{
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- protected IProgressIndicator getIProgressIndicator()
- {
- // no progress indicators on the applet
return null;
}
}
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.ext.jmol.JalviewJmolBinding;
-import jalview.gui.IProgressIndicator;
import jalview.io.DataSourceType;
import java.awt.Container;
}
@Override
- protected IProgressIndicator getIProgressIndicator()
- {
- // no progress indicators on applet (could access javascript for this)
- return null;
- }
-
- @Override
public void updateColours(Object source)
{
-
- // TODO Auto-generated method stub
-
}
@Override
protected JmolAppConsoleInterface createJmolConsole(
Container consolePanel, String buttonsToShow)
{
- // TODO Auto-generated method stub
return null;
}
@Override
public void releaseReferences(Object svl)
{
- // TODO Auto-generated method stub
-
}
@Override
public Map<String, Object> getJSpecViewProperty(String arg0)
{
- // TODO Auto-generated method stub
return null;
}
return chainNames;
}
- protected abstract IProgressIndicator getIProgressIndicator();
+ protected IProgressIndicator getIProgressIndicator()
+ {
+ return null;
+ }
public void notifyNewPickingModeMeasurement(int iatom, String strMeasure)
{
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
- @Test(groups = { "Functional" })
+ @Test(groups = { "External" })
public void testLaunchAndExit()
{
final StructureManager structureManager = new StructureManager(true);
* Test for JAL-1306 - conservation thread should run even when only Quality
* (and not Conservation) is enabled in Preferences
*/
- @Test(groups = { "Functional" })
+ @Test(groups = { "Functional" }, timeOut=2000)
public void testUpdateConservation_qualityOnly()
{
Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
Boolean.FALSE.toString());
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
- AlignmentAnnotation[] anns = af.viewport.getAlignment()
+
+ /*
+ * wait for Conservation thread to complete
+ */
+ AlignViewport viewport = af.getViewport();
+ synchronized (this)
+ {
+ while (viewport.getAlignmentConservationAnnotation() != null)
+ {
+ try
+ {
+ wait(50);
+ } catch (InterruptedException e)
+ {
+ }
+ }
+ }
+ AlignmentAnnotation[] anns = viewport.getAlignment()
.getAlignmentAnnotation();
assertNotNull("No annotations found", anns);
assertEquals("More than one annotation found", 1, anns.length);
/**
* Test that update layout reverts to original (unwrapped) values for endRes
- * and endSeq when switching from wrapped to unwrapped mode (JAL-2739)
+ * when switching from wrapped back to unwrapped mode (JAL-2739)
*/
@Test(groups = "Functional")
public void TestUpdateLayout_endRes()
af.alignPanel.getAlignViewport().setWrapAlignment(true);
af.alignPanel.updateLayout();
- // endRes changes
+ // endRes has changed
assertNotEquals(ranges.getEndRes(), endres);
// unwrap
af.alignPanel.getAlignViewport().setWrapAlignment(false);
af.alignPanel.updateLayout();
- // endRes and endSeq back to original values
+ // endRes back to original value
assertEquals(ranges.getEndRes(), endres);
}
{ "examples/plantfdx.fa", FileFormat.Fasta },
{ "examples/dna_interleaved.phy", FileFormat.Phylip },
{ "examples/2GIS.pdb", FileFormat.PDB },
- { "examples/rf00031_folded.stk", FileFormat.Stockholm },
+ { "examples/RF00031_folded.stk", FileFormat.Stockholm },
{ "examples/testdata/test.rnaml", FileFormat.Rnaml },
{ "examples/testdata/test.aln", FileFormat.Clustal },
{ "examples/testdata/test.pfam", FileFormat.Pfam },
cacheBox.updateCache();
try
{
- // This 1ms delay is essential to prevent the
- // assertion below from executing before
- // cacheBox.updateCache() finishes updating the cache
- Thread.sleep(100);
+ // This delay is to let
+ // cacheBox.updateCache() finish updating the cache
+ Thread.sleep(200);
} catch (InterruptedException e)
{
e.printStackTrace();
for (Field field : fields)
{
field.setAccessible(true);
- if (!copyConstructorIgnores(field.getName()))
+ if (!copyConstructorIgnores(field))
{
changeValue(vs1, field);
}
for (Field field1 : fields)
{
- final Object value1 = field1.get(vs1);
- final Object value2 = field1.get(vs2);
- String msg = "Mismatch in " + field1.getName() + "(" + value1 + "/"
+ if (!copyConstructorIgnores(field1))
+ {
+ final Object value1 = field1.get(vs1);
+ final Object value2 = field1.get(vs2);
+ String msg = "Mismatch in " + field1.getName() + "(" + value1 + "/"
+ value2 + ") - not set in copy constructor?";
- assertEquals(msg, value1, value2);
+ assertEquals(msg, value1, value2);
+ }
}
assertEquals("Hashcode not equals", vs1.hashCode(), vs2.hashCode());
}
/**
- * Add any field names in here that we expect to be ignored by the copy
- * constructor
+ * Add tests here for any fields that we expect to be ignored by
+ * the copy constructor
*
- * @param name
+ * @param field
* @return
*/
- private boolean copyConstructorIgnores(String name)
+ private boolean copyConstructorIgnores(Field field)
{
/*
- * currently none!
+ * just instrumentation added by test coverage while testing
*/
+ String type = field.getClass().toString();
+ if (type.toString().contains("com_atlassian_clover"))
+ {
+ // instrumentation added for test coverage - ignore
+ return true;
+ }
return false;
}
Field[] fields = ViewStyle.class.getDeclaredFields();
for (Field field : fields)
{
- field.setAccessible(true);
- Object oldValue = field.get(vs2);
- changeValue(vs2, field);
- assertFalse("equals method ignores " + field.getName(),
+ if (!copyConstructorIgnores(field))
+ {
+ field.setAccessible(true);
+ Object oldValue = field.get(vs2);
+ changeValue(vs2, field);
+ assertFalse("equals method ignores " + field.getName(),
vs1.equals(vs2));
- if (vs1.hashCode() == vs2.hashCode())
- {
- // uncomment next line to see which fields hashCode ignores
- // System.out.println("hashCode ignores " + field.getName());
+ if (vs1.hashCode() == vs2.hashCode())
+ {
+ // uncomment next line to see which fields hashCode ignores
+ // System.out.println("hashCode ignores " + field.getName());
+ }
+ // restore original value before testing the next field
+ field.set(vs2, oldValue);
}
- // restore original value before testing the next field
- field.set(vs2, oldValue);
}
}
}
Checkstyle for Jalview
----------------------
+See
+https://issues.jalview.org/browse/JAL-1854
http://checkstyle.sourceforge.net/
GNU LGPL
- Help | Eclipse Marketplace
- search for checkstyle
- install eclipse-cs checkstyle plugin
-The current version is 6.19.1 (August 2016).
+Change Log
+----------
+See http://checkstyle.sourceforge.net/releasenotes.html
+Aug 2016 Initial version used is 6.19.1
+Dec 2018 Updated to 8.12.0 (latest on Eclipse Marketplace, 8.15 is latest release)
+ SuppressionCommentFilter relocated (changed in 8.1)
+ FileContentsHolder removed (changed in 8.2)
+ Updates to import-control.xml for code changes (htsjdk, stackoverflowusers)
+
Config
------
Option 2: on demand on selected code
- right-click on a class or package and Checkstyle | Check code with checkstyle
- (or Clear Checkstyle violations to remove checkstyle warnings)
+ - recommended to use this as a QA step when changing or reviewing code
Checkstyle rules
----------------
Tips
----
Sometimes checkstyle needs a kick before it will refresh its findings.
- A whitespace edit in checkstyle.xml usually does this. There may be better ways.
+ Click the 'refresh' icon at top right in Eclipse | Preferences | Checkstyle.
Invalid configuration files may result in checkstyle failing with an error reported
in the Eclipse log file.
- Help | Installation Details | Configuration takes you to a screen with a
+ Eclipse | About | Installation Details | Configuration takes you to a screen with a
'View Error Log' button.
Sometimes checkstyle can fail silently. Try 'touching' (editing) config files, failing
<suppress checks="[a-zA-Z0-9]*" files="[\\/]ext[\\/]edu*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]ext[\\/]vamsas*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]org[\\/]jibble*"/>
+ <suppress checks="[a-zA-Z0-9]*" files="[\\/]org[\\/]stackoverflowusers*"/>
<suppress checks="[a-zA-Z0-9]*" files="[\\/]uk[\\/]ac*"/>
<!--
</module>
<!--
- Allow suppression of rules by comments, e.g.:
- // CHECKSTYLE.OFF: ParameterNumber
- ..method declaration
- // CHECKSTYLE.ON: ParameterNumber
- -->
- <module name="SuppressionCommentFilter">
- <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
- <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
- <property name="checkFormat" value="$1"/>
- </module>
-
- <!--
Check language bundles have the same keys and no duplicates
(ensure Checkstyle is configured to scan non-source files)
-->
<property name="tabWidth" value="4"/>
<!--
- Enables parsing of suppressions comments
- see http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter
+ Allow suppression of rules by comments, e.g.:
+ // CHECKSTYLE.OFF: ParameterNumber
+ ..method declaration
+ // CHECKSTYLE.ON: ParameterNumber
-->
- <module name="FileContentsHolder"/>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
<!-- ****************************** -->
<!-- NAMING STANDARDS -->
<allow pkg="compbio.metadata" class="jalview.gui.WsJobParameters"/>
<allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarna"/>
<allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarnaBinding"/>
+ <allow pkg="org.stackoverflowusers.file" class="jalview.gui.Desktop"/>
<allow pkg="uk.ac.vamsas" class="jalview.gui.VamsasApplication"/>
</subpackage>
<allow pkg="uk.ac.vamsas"/>
<allow pkg="fr.orsay.lri.varna"/>
<allow pkg="MCview"/>
+ <subpackage name="vcf">
+ <allow pkg="htsjdk\.*" regex="true"/>
+ </subpackage>
</subpackage>
<subpackage name="javascript">