public void testGenerateClassNamesMultiple() throws Exception { Model model = Model.getInstanceByName("testmodel"); String classNames = " Company Department "; String expected = "org.intermine.model.testmodel.Company org.intermine.model.testmodel.Department"; assertEquals(expected, ItemHelper.generateClassNames(classNames, model)); }
@ForgeSubscribe public void onEntityLivingDeath(LivingDeathEvent event) { if (event.source.getDamageType().equals("player")) { ItemHelper.dropBottlecap((EntityPlayer) event.source.getSourceOfDamage(), event.entityLiving); } if (event.source.getSourceOfDamage() instanceof EntityArrow) { if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity != null) { if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity instanceof EntityPlayer) { ItemHelper.dropBottlecap( (EntityPlayer) ((EntityArrow) event.source.getSourceOfDamage()).shootingEntity, event.entityLiving); } } } }
public void testConvertReferenceList() throws Exception { org.intermine.model.fulldata.ReferenceList resRefList = ItemHelper.convert(referenceList); resRefList.proxyItem(departmentProxy); // referencelists are simple objects so don't have .equals() on id like InterMineObjects // need to check each field assertEquals(dbReferenceList.getName(), resRefList.getName()); assertEquals(dbReferenceList.getFieldProxy("item"), resRefList.getFieldProxy("item")); assertEquals(dbReferenceList.getRefIds(), resRefList.getRefIds()); }
public void testConvertFromDbItem() throws Exception { assertEquals(item, ItemHelper.convert(dbItem)); }
public void testGenerateClassNamesSingle() throws Exception { Model model = Model.getInstanceByName("testmodel"); assertEquals( "org.intermine.model.testmodel.Company", ItemHelper.generateClassNames("Company", model)); }
public void testGenerateClassNamesEmpty() throws Exception { Model model = Model.getInstanceByName("testmodel"); assertEquals("", ItemHelper.generateClassNames("", model)); }
public void testGenerateClassNamesNull() throws Exception { assertNull(ItemHelper.generateClassNames(null, null)); }