testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
String s = MessageManager.getString("label.add_annotations_for");
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ String expected = "<html><style> p.ttip {width: 350; text-align: left; word-wrap: break-word;}</style><p class=\"ttip\">"
+ s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
assertEquals(expected, menu.getToolTipText());
}
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
String s = MessageManager.getString("label.add_annotations_for");
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ String expected = "<html><style> p.ttip {width: 350; text-align: left; word-wrap: break-word;}</style><p class=\"ttip\">"
+ s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
assertEquals(expected, menu.getToolTipText());
}
SequenceI seq = new Sequence("s1", "MAKLKRFQSSTLL");
seq.setDescription("SeqDesc");
- sar.createSequenceAnnotationReport(sb, seq, true, true, null);
-
/*
* positional features are ignored
*/
seq.addSequenceFeature(new SequenceFeature("Domain", "Ferredoxin", 5,
10, 1f, null));
- assertEquals("<i><br>SeqDesc</i>", sb.toString());
+ sar.createSequenceAnnotationReport(sb, seq, true, true, null);
+ assertEquals("<i>SeqDesc</i>", sb.toString());
/*
* non-positional feature
null));
sb.setLength(0);
sar.createSequenceAnnotationReport(sb, seq, true, true, null);
- String expected = "<i><br>SeqDesc<br>Type1 ; Nonpos Score=1.0</i>";
+ String expected = "<i>SeqDesc<br>Type1 ; Nonpos Score=1.0</i>";
assertEquals(expected, sb.toString());
/*
*/
sb.setLength(0);
sar.createSequenceAnnotationReport(sb, seq, true, false, null);
- assertEquals("<i><br>SeqDesc</i>", sb.toString());
+ assertEquals("<i>SeqDesc</i>", sb.toString());
/*
* add non-pos feature with score inside min-max range for feature type
sb.setLength(0);
sar.createSequenceAnnotationReport(sb, seq, true, true, fr);
- expected = "<i><br>SeqDesc<br>Metal ; Desc<br>Type1 ; Nonpos</i>";
+ expected = "<i>SeqDesc<br>Metal ; Desc<br>Type1 ; Nonpos</i>";
assertEquals(expected, sb.toString());
/*
assertEquals(expected, sb.toString()); // unchanged!
/*
- * 'clinical_significance' attribute only included when
- * used for feature colouring
+ * 'clinical_significance' attribute is only included in description
+ * when used for feature colouring
*/
SequenceFeature sf2 = new SequenceFeature("Variant", "Havana", 0, 0,
5f, null);
seq.addSequenceFeature(sf2);
sb.setLength(0);
sar.createSequenceAnnotationReport(sb, seq, true, true, fr);
- expected = "<i><br>SeqDesc<br>Metal ; Desc<br>Type1 ; Nonpos<br>Variant ; Havana</i>";
+ expected = "<i>SeqDesc<br>Metal ; Desc<br>Type1 ; Nonpos<br>Variant ; Havana</i>";
assertEquals(expected, sb.toString());
/*
fc.setAttributeName("clinical_significance");
fr.setColour("Variant", fc);
sar.createSequenceAnnotationReport(sb, seq, true, true, fr);
- expected = "<i><br>SeqDesc<br>UNIPROT P30419<br>PDB 3iu1<br>Metal ; Desc<br>"
+ expected = "<i>SeqDesc<br>UNIPROT P30419<br>PDB 3iu1<br>Metal ; Desc<br>"
+ "Type1 ; Nonpos<br>Variant ; Havana; clinical_significance=benign</i>";
assertEquals(expected, sb.toString());
// with showNonPositionalFeatures = false
sb.setLength(0);
sar.createSequenceAnnotationReport(sb, seq, true, false, fr);
- expected = "<i><br>SeqDesc<br>UNIPROT P30419<br>PDB 3iu1</i>";
+ expected = "<i>SeqDesc<br>UNIPROT P30419<br>PDB 3iu1</i>";
+ assertEquals(expected, sb.toString());
+
+ /*
+ * long feature description is truncated with ellipsis
+ */
+ sb.setLength(0);
+ sf2.setDescription(
+ "This is a very long description which should be truncated");
+ sar.createSequenceAnnotationReport(sb, seq, false, true, fr);
+ expected = "<i>SeqDesc<br>Metal ; Desc<br>Type1 ; Nonpos<br>Variant ; This is a very long description which sh...; clinical_significance=benign</i>";
assertEquals(expected, sb.toString());
// see other tests for treatment of status and html