private static void deserializeElectronContainerFields(Resource rdfObject, IElectronContainer bond) { deserializeChemObjectFields(rdfObject, bond); Statement count = rdfObject.getProperty(CDK.HASELECTRONCOUNT); if (count != null) bond.setElectronCount(count.getInt()); }
private static void deserializeElectronContainerFields(Resource rdfObject, IElectronContainer bond) { deserializeChemObjectFields(rdfObject, bond); Statement count = rdfObject.getProperty(CDK.HASELECTRONCOUNT); if (count != null) bond.setElectronCount(count.getInt()); }
/** * The electron count of an LP is always exactly 2. */ @Test @Override public void testSetElectronCount_Integer() { IElectronContainer ec = (IElectronContainer) newChemObject(); ec.setElectronCount(3); Assert.assertEquals(2, ec.getElectronCount().intValue()); ec.setElectronCount(null); Assert.assertEquals(2, ec.getElectronCount().intValue()); }
/** * The electron count of a single electron is always exactly 1. */ @Test @Override public void testSetElectronCount_Integer() { IElectronContainer ec = (IElectronContainer) newChemObject(); ec.setElectronCount(3); Assert.assertEquals(1, ec.getElectronCount().intValue()); ec.setElectronCount(null); Assert.assertEquals(1, ec.getElectronCount().intValue()); } }
@Test public void testSetElectronCount_Integer() { IElectronContainer ec = (IElectronContainer) newChemObject(); ec.setElectronCount(3); Assert.assertEquals(3, ec.getElectronCount().intValue()); }
@Test @Override public void testClone() throws Exception { IElectronContainer ec = (IElectronContainer) newChemObject(); ec.setElectronCount(2); Object clone = ec.clone(); Assert.assertNotNull(clone); Assert.assertTrue(clone instanceof IElectronContainer); }