public void setUp() { E = new Event(2,4); if (E == null); { } }
public void test_Event_addEventAssignment2() { Event e = new Event(2,2); EventAssignment ea = new EventAssignment(2,3); ea.setVariable( "f"); ea.setMath(libsbml.parseFormula("a-n")); int i = e.addEventAssignment(ea); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( e.getNumEventAssignments() == 0 ); ea = null; e = null; }
public void test_Event_addEventAssignment1() { Event e = new Event(2,2); EventAssignment ea = new EventAssignment(2,2); int i = e.addEventAssignment(ea); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); ea.setVariable( "f"); i = e.addEventAssignment(ea); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); ea.setMath(libsbml.parseFormula("a-n")); i = e.addEventAssignment(ea); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( e.getNumEventAssignments() == 1 ); ea = null; e = null; }
public void test_Event_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,4); sbmlns.addNamespaces(xmlns); Event object1 = new Event(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_EVENT ); assertTrue( object1.getMetaId() == "" ); assertTrue( object1.getNotes() == null ); assertTrue( object1.getAnnotation() == null ); assertTrue( object1.getLevel() == 2 ); assertTrue( object1.getVersion() == 4 ); assertTrue( object1.getNamespaces() != null ); assertTrue( object1.getNamespaces().getLength() == 2 ); object1 = null; }
public void test_L3_Event_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); Event e = new Event(sbmlns); assertTrue( e.getTypeCode() == libsbml.SBML_EVENT ); assertTrue( e.getMetaId() == "" ); assertTrue( e.getNotes() == null ); assertTrue( e.getAnnotation() == null ); assertTrue( e.getLevel() == 3 ); assertTrue( e.getVersion() == 1 ); assertTrue( e.getNamespaces() != null ); assertTrue( e.getNamespaces().getLength() == 2 ); assertTrue( e.getId() == "" ); assertTrue( e.getName() == "" ); assertTrue( e.getUseValuesFromTriggerTime() == true ); assertEquals( false, e.isSetId() ); assertEquals( false, e.isSetName() ); assertEquals( false, e.isSetUseValuesFromTriggerTime() ); e = null; }
public void test_Event_createEventAssignment() { Event e = new Event(2,2); EventAssignment ea = e.createEventAssignment(); assertTrue( e.getNumEventAssignments() == 1 ); assertTrue( (ea).getLevel() == 2 ); assertTrue( (ea).getVersion() == 2 ); e = null; }
public void tearDown() { E = null; }
internal static HandleRef getCPtrAndDisown(Event obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
public void test_Model_addEvent4() { Model m = new Model(2,2); Event e = new Event(2,2); Trigger t = new Trigger(2,2); e.setId( "e"); e.setTrigger(t); e.createEventAssignment(); Event e1 = new Event(2,2); e1.setId( "e"); e1.setTrigger(t); e1.createEventAssignment(); int i = m.addEvent(e); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumEvents() == 1 ); i = m.addEvent(e1); assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID ); assertTrue( m.getNumEvents() == 1 ); e = null; e1 = null; m = null; }
public void test_Model_addEvent1() { Model m = new Model(2,2); Event e = new Event(2,2); Trigger t = new Trigger(2,2); int i = m.addEvent(e); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); e.setTrigger(t); i = m.addEvent(e); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); e.createEventAssignment(); i = m.addEvent(e); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumEvents() == 1 ); e = null; m = null; }
public void test_internal_consistency_check_99910() { SBMLDocument d = new SBMLDocument(2,4); long errors; Event e = new Event(2,4); Model m = d.createModel(); d.setLevelAndVersion(1,2,false); Compartment c = m.createCompartment(); c.setId("cc"); c.setConstant(false); m.addEvent(e); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
/** * Adds a copy of the given Event object to this Model. * * @param e the Event object to add * * @return integer value indicating success/failure of the * function. The possible values * returned by this function are: * @li @link libsbmlcs.libsbml.LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink * @li @link libsbmlcs.libsbml.LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH @endlink * @li @link libsbmlcs.libsbml.LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH @endlink * @li @link libsbmlcs.libsbml.LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID @endlink * @li @link libsbmlcs.libsbml.LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT @endlink * @li @link libsbmlcs.libsbml.LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink * * * * @note This method should be used with some caution. The fact that this * method @em copies the object passed to it means that the caller will be * left holding a physically different object instance than the one contained * inside this object. Changes made to the original object instance (such as * resetting attribute values) will <em>not affect the instance in this * object</em>. In addition, the caller should make sure to free the * original object if it is no longer being used, or else a memory leak will * result. Please see other methods on this class (particularly a * corresponding method whose name begins with the word <code>create</code>) * for alternatives that do not lead to these issues. * * * * @see createEvent() */ public int addEvent(Event e) { int ret = libsbmlPINVOKE.Model_addEvent(swigCPtr, Event.getCPtr(e)); return ret; }
public void test_Event_full() { ASTNode math1 = libsbml.parseFormula("0"); Trigger trigger = new Trigger(2,4); ASTNode math = libsbml.parseFormula("0"); Event e = new Event(2,4); EventAssignment ea = new EventAssignment(2,4); ea.setVariable( "k"); ea.setMath(math); trigger.setMath(math1); e.setTrigger(trigger); e.setId( "e1"); e.setName( "Set k2 to zero when P1 <= t"); e.addEventAssignment(ea); assertTrue( e.getNumEventAssignments() == 1 ); assertNotEquals(e.getEventAssignment(0),ea); math = null; e = null; }
public void test_Event_copyConstructor() { Event o1 = new Event(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); Event o2 = new Event(o1); assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_Event_clone() { Event o1 = new Event(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); Event o2 = o1.clone(); assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_Event_assignmentOperator() { Event o1 = new Event(2,4); o1.setId("c"); assertTrue( o1.getId() == "c" ); Event o2 = new Event(2,4); o2 = o1; assertTrue( o2.getId() == "c" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_L3_Event_hasRequiredElements() { Event e = new Event(3,1); assertEquals( false, e.hasRequiredElements() ); Trigger t = new Trigger(3,1); e.setTrigger(t); assertEquals( true, e.hasRequiredElements() ); e = null; }
public void test_L3_Event_hasRequiredAttributes() { Event e = new Event(3,1); assertEquals( true, e.hasRequiredAttributes() ); Delay d = e.createDelay(); assertEquals( false, e.hasRequiredAttributes() ); e.setUseValuesFromTriggerTime(true); assertEquals( true, e.hasRequiredAttributes() ); e = null; }
public void test_Event_addEventAssignment3() { Event e = new Event(2,2); int i = e.addEventAssignment(null); assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED ); assertTrue( e.getNumEventAssignments() == 0 ); e = null; }
public void test_Event_setTimeUnits2() { string units = "second"; Event e = new Event(2,1); int i = e.setTimeUnits(units); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue(( units == e.getTimeUnits() )); assertEquals( true, e.isSetTimeUnits() ); i = e.unsetTimeUnits(); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( false, e.isSetTimeUnits() ); e = null; }
public void test_internal_consistency_check_99905_trigger() { SBMLDocument d = new SBMLDocument(2,4); long errors; Trigger trigger = new Trigger(2,4); Event e = new Event(2,4); Model m = d.createModel(); d.setLevelAndVersion(2,2,false); trigger.setSBOTerm(5); e.setTrigger(trigger); m.addEvent(e); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_Event_setTimeUnits3() { string units = "1second"; Event e = new Event(2,1); int i = e.setTimeUnits(units); assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE ); assertEquals( false, e.isSetTimeUnits() ); i = e.unsetTimeUnits(); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( false, e.isSetTimeUnits() ); e = null; }
public void test_internal_consistency_check_99911_event() { SBMLDocument d = new SBMLDocument(2,4); long errors; Event e = new Event(2,4); Model m = d.createModel(); d.setLevelAndVersion(2,1,false); e.setSBOTerm(2); m.addEvent(e); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_Event_setTimeUnits4() { Event e = new Event(2,1); int i = e.setTimeUnits(""); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( false, e.isSetTimeUnits() ); e = null; }
public void test_Model_addEvent2() { Model m = new Model(2,2); Event e = new Event(2,1); Trigger t = new Trigger(2,1); e.setTrigger(t); e.createEventAssignment(); int i = m.addEvent(e); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( m.getNumEvents() == 0 ); e = null; m = null; }
public void test_Event_setUseValuesFromTriggerTime1() { Event e = new Event(2,4); int i = e.setUseValuesFromTriggerTime(false); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( e.getUseValuesFromTriggerTime() == false ); i = e.setUseValuesFromTriggerTime(true); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( e.getUseValuesFromTriggerTime() == true ); e = null; }
internal static HandleRef getCPtr(Event obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public void test_Event_setUseValuesFromTriggerTime2() { Event e = new Event(2,2); int i = e.setUseValuesFromTriggerTime(false); assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE ); e = null; }
/** * Copy constructor; creates a copy of this Event. * * @param orig the object to copy. * * @throws @if python ValueError @else SBMLConstructorException @endif * Thrown if the argument @p orig is @c null. */ public Event(Event orig) : this(libsbmlPINVOKE.new_Event__SWIG_2(Event.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
public void test_Event_setUseValuesFromTriggerTime() { Event object1 = new Event(2,4); object1.setUseValuesFromTriggerTime(false); assertTrue( object1.getUseValuesFromTriggerTime() == false ); object1.setUseValuesFromTriggerTime(true); assertTrue( object1.getUseValuesFromTriggerTime() == true ); object1 = null; }