Example #1
0
		/**
		 * Test mode happens if a "testdir=directoryname" is given
		 * otherwise it is normal mode 
		 * normal mode means it is on an aircraft getting pings from transponders.
		 */

		public static int Main (string[] args)
		{
			
			Trace.Listeners.Add(new TextWriterTraceListener("./cds.log"));
			Trace.AutoFlush = true;

			CollisionDetectionSystemClass cds = new CollisionDetectionSystemClass ();

			try {
				if (args.Length == 0) {
					cds.Start();
				} else {
					if (args[0].ToLower().StartsWith("testdir")) {
						cds.Start(StringUtility.getArgValue(args[0]));
					}  else {
							Console.WriteLine ("Usage: CollisionDetectionSystem testdir=testDirectoryName to run in test mode");
						} 

				}
				Console.WriteLine ("completed successfully");
				return 0;
			} catch (Exception e){
				Console.WriteLine ("ooops, sorry, I ended with error:  " + e.GetBaseException ());
				return -1;
			}
			finally {
				Trace.WriteLine ("completed.");
				Trace.Flush ();
			}

		}
        public void startTest()
        {
            CollisionDetectionSystemClass cds = new CollisionDetectionSystemClass ();
            String path = System.IO.Directory.GetCurrentDirectory ();

            path = path.Split (new String[]{ "UnitTesting\\" }, StringSplitOptions.None) [0] +
                "SystemTesting\\TestData\\SystemTests\\TestFiles\\1";
            String argument = "testdir=" + path;

            cds.Start (StringUtility.getArgValue(argument));

            Assert.True(true);
        }
        public void startTest()
        {
            CollisionDetectionSystemClass cds = new CollisionDetectionSystemClass ();
            String systemTestPath = TestHelper.buildTestDir ("3");

            cds.Start (StringUtility.getArgValue(systemTestPath));

            /*
            * TODO: eventually we should be able to check for # of radar and audio events thrown # match that back to what is expected.
            */
            //I know, this test will not fail, but if the above test fails with catastrophic system error, test will fail

            Assert.True(true);
        }
Example #4
0
        /**
         * Test mode happens if a "testdir=directoryname" is given
         * otherwise it is normal mode
         * normal mode means it is on an aircraft getting pings from transponders.
         */
        public static int Main(string[] args)
        {
            CollisionDetectionSystemClass system = new CollisionDetectionSystemClass ();

            try {
                if (args.Length == 0) {
                    system.Start();
                } else {
                    if (args[0].StartsWith("testdir")) {
                        system.Start(StringUtility.getArgValue(args[0]));
                    } else {
                        if (args[0].StartsWith("testdir")) {
                            system.Start(StringUtility.getArgValue(args[0]));
                        } else {
                            System.Console.WriteLine ("Usage: CollisionDetecionSystem testdir=testDirectoryName to run in test mode");
                        }
                    }
                }
                return 0;
            } catch (Exception e){
                System.Console.WriteLine ("ooops, sorry, I ended with error:  " + e.GetBaseException ());
                return -1;
            }
        }
        public void sendDataTestMac()
        {
            CollisionDetectionSystemClass system = new CollisionDetectionSystemClass ();
            String path = System.IO.Directory.GetCurrentDirectory ();

            path = path.Split (new String[]{ "UnitTesting/" }, StringSplitOptions.None) [0] +
                "SystemTesting/TestData/SystemTests/TestFiles/1";
            String argument = "testdir=" + path;

            system.Start (StringUtility.getArgValue(argument));
            //unit.Start (StringUtility.getArgValue(argument));

            Assert.True(true);
        }