Commit fa0fcddf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

depreacted field are not present in the output

parent 223d7bc7
Pipeline #10031 passed with stage
in 8 minutes and 42 seconds
......@@ -6,6 +6,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Set;
......@@ -293,11 +294,23 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
assertTrue(str.contains(former2));
for (NoteField field : NoteField.values()) {
boolean deprecated = false;
try {
Field f = NoteField.class.getField(field.name());
if (f.isAnnotationPresent(Deprecated.class))
deprecated = true;
} catch (NoSuchFieldException | SecurityException e) {
}
if (!deprecated) {
if (field.getClazz().isAssignableFrom(element.getClass())
|| CellDesignerElement.class.isAssignableFrom(field.getClazz())) {
assertTrue("Export string doesn't contain info about: " + field.getCommonName(),
str.indexOf(field.getCommonName()) >= 0);
}
}
}
......@@ -318,7 +331,7 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
for (NoteField field : NoteField.values()) {
if (field.getClazz().isAssignableFrom(element.getClass())
|| CellDesignerElement.class.isAssignableFrom(field.getClazz())) {
assertFalse("Export string contain info about: " + field.getCommonName()+". But shouldn't",
assertFalse("Export string contain info about: " + field.getCommonName() + ". But shouldn't",
str.indexOf(field.getCommonName()) >= 0);
}
......@@ -369,8 +382,10 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
Node node = super.getNodeFromXmlString("<notes>\n" +
"Name: L-cystine\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), (R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), 3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n" +
"Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), (R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), 3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n"
+
"Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+
"SemanticZoomLevelVisibility: 5\n" +
"Charge: 0\n" +
"</notes>\n" +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment