use of org.nextprot.api.core.domain.MainNames in project nextprot-api by calipho-sib.
the class MainNamesDaoTest method testMapContentForIsoformShort.
@Test
public void testMapContentForIsoformShort() {
Map<String, MainNames> namesMap = this.mainNamesDao.getMainNamesMap();
MainNames names = namesMap.get("NX_12345-1");
assertEquals("NX_12345-1", names.getAccession());
assertEquals("https://www.nextprot.org/entry/NX_12345-1", names.getUrl());
assertEquals("Short", names.getName());
assertEquals(1, names.getGeneNameList().size());
assertEquals("GENE1", names.getGeneNameList().get(0));
}
use of org.nextprot.api.core.domain.MainNames in project nextprot-api by calipho-sib.
the class MainNamesDaoTest method testMapContentForIsoformLong.
@Test
public void testMapContentForIsoformLong() {
Map<String, MainNames> namesMap = this.mainNamesDao.getMainNamesMap();
MainNames names = namesMap.get("NX_12345-2");
assertEquals("NX_12345-2", names.getAccession());
assertEquals("https://www.nextprot.org/entry/NX_12345-2", names.getUrl());
assertEquals("Long", names.getName());
assertEquals(1, names.getGeneNameList().size());
assertEquals("GENE1", names.getGeneNameList().get(0));
}
use of org.nextprot.api.core.domain.MainNames in project nextprot-api by calipho-sib.
the class MainNamesDaoTest method testMapContentForMasterWithMulitpleGeneNames.
@Test
public void testMapContentForMasterWithMulitpleGeneNames() {
Map<String, MainNames> namesMap = this.mainNamesDao.getMainNamesMap();
MainNames names = namesMap.get("NX_12347");
assertEquals(3, names.getGeneNameList().size());
assertEquals("GENE3", names.getGeneNameList().get(0));
assertEquals("GENE4", names.getGeneNameList().get(1));
assertEquals("GENE5", names.getGeneNameList().get(2));
}
use of org.nextprot.api.core.domain.MainNames in project nextprot-api by calipho-sib.
the class ConsistencyResourceTest method shouldFindANameForEveryAllEntriesAndIsoformsAndMemoryUsed.
@Test
public void shouldFindANameForEveryAllEntriesAndIsoformsAndMemoryUsed() {
int isoCnt = 0;
int masCnt = 0;
System.gc();
Runtime rt = Runtime.getRuntime();
long usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
System.out.println("Memory used before getting map: " + usedMB);
//
Map<String, MainNames> namesMap = mainNamesService.findIsoformOrEntryMainName();
//
System.gc();
usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
System.out.println("Memory used after getting map: " + usedMB);
for (String ac : namesMap.keySet()) {
MainNames n = namesMap.get(ac);
Assert.assertTrue(n.getName().length() > 0);
if (n.getAccession().contains("-"))
isoCnt++;
else
masCnt++;
}
System.out.println("Mas cnt:" + masCnt);
System.out.println("Iso cnt:" + isoCnt);
}
use of org.nextprot.api.core.domain.MainNames in project nextprot-api by calipho-sib.
the class MainNamesDaoTest method testMapContentForIsoformWithNumericName.
@Test
public void testMapContentForIsoformWithNumericName() {
Map<String, MainNames> namesMap = this.mainNamesDao.getMainNamesMap();
MainNames names = namesMap.get("NX_12346-1");
assertEquals("Iso 1", names.getName());
}
Aggregations