/* test.java * Author: Fan Zhang * a small program to test class target, public method getnetwork */ import java.io.*; public class test{ public static void main(String args[]) { given g = new given(); target[] t; System.out.print("\nSource_Machine_Name\t"); System.out.print("Port\t"); System.out.print("Target_Machine_Name\t"); System.out.print("Port\t"); System.out.println("Metric\n"); /* check to make sure we have at least 2 args to the prog. */ if(args.length != 2) { System.out.println("Usage: java router filename portnumber \n"); } else{ try { /* read the configuration file and return the result * in the object t */ t = g.getnetwork(args[0],Integer.parseInt(args[1])) ; System.out.println("got " + t.length + " entries" ); /* loop around, once for each entry in returned array */ for(int i=0; i