|
From: Bob J. <jac...@us...> - 2002-03-31 19:06:38
|
Update of /cvsroot/jmri/test/jmri/jmrix/loconet In directory usw-pr-cvs1:/tmp/cvs-serv5728/loconet Modified Files: LnSensorAddressTest.java LnSensorManagerTest.java LnSensorTest.java Log Message: remove a bunch of assert deprecation wanrings Index: LnSensorAddressTest.java =================================================================== RCS file: /cvsroot/jmri/test/jmri/jmrix/loconet/LnSensorAddressTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** LnSensorAddressTest.java 2 Mar 2002 20:13:25 -0000 1.1.1.1 --- LnSensorAddressTest.java 31 Mar 2002 19:06:32 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import java.io.*; + import junit.framework.Assert; import junit.framework.Test; import junit.framework.TestCase; *************** *** 59,66 **** a = new LnSensorAddress("LS257D3"); // 0x101F ! assert(a.getLowBits() == 15); ! assert(a.getHighBits() == 32); ! assert(a.getASBit() == 0x40); ! assert(a.isValid()); } --- 60,67 ---- a = new LnSensorAddress("LS257D3"); // 0x101F ! Assert.assertTrue(a.getLowBits() == 15); ! Assert.assertTrue(a.getHighBits() == 32); ! Assert.assertTrue(a.getASBit() == 0x40); ! Assert.assertTrue(a.isValid()); } *************** *** 70,83 **** a = new LnSensorAddress("LS130"); ! assert(a.getLowBits() == 65); ! assert(a.getHighBits() == 0); ! assert(a.getASBit() == 0x00); ! assert(a.isValid()); a = new LnSensorAddress("LS257"); ! assert(a.getLowBits() == 0); ! assert(a.getHighBits() == 1); ! assert(a.getASBit() == 0x40); ! assert(a.isValid()); } --- 71,84 ---- a = new LnSensorAddress("LS130"); ! Assert.assertTrue(a.getLowBits() == 65); ! Assert.assertTrue(a.getHighBits() == 0); ! Assert.assertTrue(a.getASBit() == 0x00); ! Assert.assertTrue(a.isValid()); a = new LnSensorAddress("LS257"); ! Assert.assertTrue(a.getLowBits() == 0); ! Assert.assertTrue(a.getHighBits() == 1); ! Assert.assertTrue(a.getASBit() == 0x40); ! Assert.assertTrue(a.isValid()); } *************** *** 89,95 **** log.debug("0x15, 0x60 shows as "+a.getNumericAddress()+" "+ a.getDS54Address()+" "+a.getBDL16Address()); ! assert(a.getNumericAddress().equals("LS43")); ! assert(a.getDS54Address().equals("LS21A")); ! assert(a.getBDL16Address().equals("LS2C3")); } --- 90,96 ---- log.debug("0x15, 0x60 shows as "+a.getNumericAddress()+" "+ a.getDS54Address()+" "+a.getBDL16Address()); ! Assert.assertTrue(a.getNumericAddress().equals("LS43")); ! Assert.assertTrue(a.getDS54Address().equals("LS21A")); ! Assert.assertTrue(a.getBDL16Address().equals("LS2C3")); } Index: LnSensorManagerTest.java =================================================================== RCS file: /cvsroot/jmri/test/jmri/jmrix/loconet/LnSensorManagerTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** LnSensorManagerTest.java 2 Mar 2002 20:13:25 -0000 1.1.1.1 --- LnSensorManagerTest.java 31 Mar 2002 19:06:32 -0000 1.2 *************** *** 1,8 **** ! /** * LnSensorManagerTest.java * * Description: tests for the jmri.jmrix.loconet.LnSensorManagerTurnout class * @author Bob Jacobsen ! * @version */ --- 1,8 ---- ! /** * LnSensorManagerTest.java * * Description: tests for the jmri.jmrix.loconet.LnSensorManagerTurnout class * @author Bob Jacobsen ! * @version */ *************** *** 10,13 **** --- 10,14 ---- import java.io.*; + import junit.framework.Assert; import junit.framework.Test; import junit.framework.TestCase; *************** *** 23,28 **** LnSensorManager l = new LnSensorManager(); jmri.InstanceManager.setSensorManager(l); ! assert(l == jmri.InstanceManager.sensorManagerInstance()); ! } --- 24,29 ---- LnSensorManager l = new LnSensorManager(); jmri.InstanceManager.setSensorManager(l); ! Assert.assertTrue(l == jmri.InstanceManager.sensorManagerInstance()); ! } *************** *** 33,40 **** // sample turnout object Sensor t = l.newSensor("LS22", "test"); ! // test get ! assert(t == l.getByUserName("test")); ! assert(t == l.getBySystemName("LS22")); } --- 34,41 ---- // sample turnout object Sensor t = l.newSensor("LS22", "test"); ! // test get ! Assert.assertTrue(t == l.getByUserName("test")); ! Assert.assertTrue(t == l.getBySystemName("LS22")); } *************** *** 42,52 **** // create and register the manager object LnSensorManager l = new LnSensorManager(); ! // sample turnout object Sensor t = l.newSensor("LS22", "test"); ! // try to get nonexistant turnouts ! assert(null == l.getByUserName("foo")); ! assert(null == l.getBySystemName("bar")); } --- 43,53 ---- // create and register the manager object LnSensorManager l = new LnSensorManager(); ! // sample turnout object Sensor t = l.newSensor("LS22", "test"); ! // try to get nonexistant turnouts ! Assert.assertTrue(null == l.getByUserName("foo")); ! Assert.assertTrue(null == l.getBySystemName("bar")); } *************** *** 57,61 **** // create and register the manager object LnSensorManager l = new LnSensorManager(); ! // send messages for 21, 22 // notify the Ln that somebody else changed it... --- 58,62 ---- // create and register the manager object LnSensorManager l = new LnSensorManager(); ! // send messages for 21, 22 // notify the Ln that somebody else changed it... *************** *** 66,72 **** m1.setElement(3, 0x38); lnis.sendTestMessage(m1); ! // see if sensor exists ! assert(null != l.getBySystemName("LS43")); } --- 67,73 ---- m1.setElement(3, 0x38); lnis.sendTestMessage(m1); ! // see if sensor exists ! Assert.assertTrue(null != l.getBySystemName("LS43")); } *************** *** 75,100 **** LnSensorManager l = new LnSensorManager(); jmri.InstanceManager.setSensorManager(l); ! // ask for a Sensor, and check type SensorManager t = jmri.InstanceManager.sensorManagerInstance(); ! Sensor o = t.newSensor("LS21", "my name"); ! ! if (log.isDebugEnabled()) log.debug("received sensor value "+o); ! assert( null != (LnSensor)o); ! // make sure loaded into tables if (log.isDebugEnabled()) log.debug("by system name: "+t.getBySystemName("LS21")); if (log.isDebugEnabled()) log.debug("by user name: "+t.getByUserName("my name")); ! ! assert(null != t.getBySystemName("LS21")); ! assert(null != t.getByUserName("my name")); ! } ! ! // from here down is testing infrastructure ! public LnSensorManagerTest(String s) { super(s); --- 76,101 ---- LnSensorManager l = new LnSensorManager(); jmri.InstanceManager.setSensorManager(l); ! // ask for a Sensor, and check type SensorManager t = jmri.InstanceManager.sensorManagerInstance(); ! Sensor o = t.newSensor("LS21", "my name"); ! ! if (log.isDebugEnabled()) log.debug("received sensor value "+o); ! Assert.assertTrue( null != (LnSensor)o); ! // make sure loaded into tables if (log.isDebugEnabled()) log.debug("by system name: "+t.getBySystemName("LS21")); if (log.isDebugEnabled()) log.debug("by user name: "+t.getByUserName("my name")); ! ! Assert.assertTrue(null != t.getBySystemName("LS21")); ! Assert.assertTrue(null != t.getByUserName("my name")); ! } ! ! // from here down is testing infrastructure ! public LnSensorManagerTest(String s) { super(s); *************** *** 106,110 **** junit.swingui.TestRunner.main(testCaseName); } ! // test suite from all defined tests public static Test suite() { --- 107,111 ---- junit.swingui.TestRunner.main(testCaseName); } ! // test suite from all defined tests public static Test suite() { *************** *** 112,116 **** return suite; } ! static org.apache.log4j.Category log = org.apache.log4j.Category.getInstance(LnSensorManagerTest.class.getName()); --- 113,117 ---- return suite; } ! static org.apache.log4j.Category log = org.apache.log4j.Category.getInstance(LnSensorManagerTest.class.getName()); Index: LnSensorTest.java =================================================================== RCS file: /cvsroot/jmri/test/jmri/jmrix/loconet/LnSensorTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** LnSensorTest.java 2 Mar 2002 20:13:25 -0000 1.1.1.1 --- LnSensorTest.java 31 Mar 2002 19:06:32 -0000 1.2 *************** *** 1,8 **** ! /** * LnSensorTest.java * * Description: tests for the jmri.jmrix.loconet.LnSensor class * @author Bob Jacobsen ! * @version */ --- 1,8 ---- ! /** * LnSensorTest.java * * Description: tests for the jmri.jmrix.loconet.LnSensor class * @author Bob Jacobsen ! * @version */ *************** *** 10,13 **** --- 10,14 ---- import java.io.*; + import junit.framework.Assert; import junit.framework.Test; import junit.framework.TestCase; *************** *** 21,29 **** // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS042"); ! // created in UNKNOWN state ! assert(t.getKnownState() == jmri.Sensor.UNKNOWN); } --- 22,30 ---- // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS042"); ! // created in UNKNOWN state ! Assert.assertTrue(t.getKnownState() == jmri.Sensor.UNKNOWN); } *************** *** 32,38 **** // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS043"); ! // notify the Ln that somebody else changed it... LocoNetMessage m = new LocoNetMessage(4); --- 33,39 ---- // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS043"); ! // notify the Ln that somebody else changed it... LocoNetMessage m = new LocoNetMessage(4); *************** *** 42,46 **** m.setElement(3, 0x38); lnis.sendTestMessage(m); ! assert(t.getKnownState() == jmri.Sensor.ACTIVE); m = new LocoNetMessage(4); --- 43,47 ---- m.setElement(3, 0x38); lnis.sendTestMessage(m); ! Assert.assertTrue(t.getKnownState() == jmri.Sensor.ACTIVE); m = new LocoNetMessage(4); *************** *** 50,54 **** m.setElement(3, 0x18); lnis.sendTestMessage(m); ! assert(t.getKnownState() == jmri.Sensor.INACTIVE); } --- 51,55 ---- m.setElement(3, 0x18); lnis.sendTestMessage(m); ! Assert.assertTrue(t.getKnownState() == jmri.Sensor.INACTIVE); } *************** *** 59,65 **** // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS042"); ! t.requestUpdateFromLayout(); // doesn't send a message right now, pending figuring out what --- 60,66 ---- // prepare an interface LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold(); ! LnSensor t = new LnSensor("LS042"); ! t.requestUpdateFromLayout(); // doesn't send a message right now, pending figuring out what *************** *** 68,72 **** // from here down is testing infrastructure ! public LnSensorTest(String s) { super(s); --- 69,73 ---- // from here down is testing infrastructure ! public LnSensorTest(String s) { super(s); *************** *** 78,82 **** junit.swingui.TestRunner.main(testCaseName); } ! // test suite from all defined tests public static Test suite() { --- 79,83 ---- junit.swingui.TestRunner.main(testCaseName); } ! // test suite from all defined tests public static Test suite() { *************** *** 84,88 **** return suite; } ! static org.apache.log4j.Category log = org.apache.log4j.Category.getInstance(LnSensorTest.class.getName()); --- 85,89 ---- return suite; } ! static org.apache.log4j.Category log = org.apache.log4j.Category.getInstance(LnSensorTest.class.getName()); |