From: Chris Jaekl Date: Sat, 13 Dec 2014 02:19:40 +0000 (-0500) Subject: Remove coverage report output that should not really have been committed in the first... X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=c35af9e511e8390a66ca76331c3af43d0f0f7464;p=frank.git Remove coverage report output that should not really have been committed in the first place. --- diff --git a/report/allclasses-frame.html b/report/allclasses-frame.html deleted file mode 100644 index 8f1c1f6..0000000 --- a/report/allclasses-frame.html +++ /dev/null @@ -1,36 +0,0 @@ - - -coverage report - - - -All classes - - - - -
-ExceptionUtils  50% (1/2)
-FrankBundle  100% (4/4)
-FrankException  0% (0/1)
-MismatchedTagsException  0% (0/3)
-MissingInfoException  100% (5/5)
-NextTrips  100% (2/2)
-ParseHandler  75% (9/12)
-ParseResult  89% (8/9)
-ParseUtils  67% (2/3)
-QDBundleFactory  100% (3/3)
-QDException  100% (2/2)
-RequestBroker  83% (5/6)
-Route  100% (10/10)
-RouteSummary  100% (2/2)
-Schedule  100% (7/7)
-Server  100% (5/5)
-StopInfo  100% (9/9)
-StringUtils  50% (1/2)
-Trip  94% (15/16)
-ViewSchedule  67% (4/6)
-XmlParseException  50% (1/2)
-
- - diff --git a/report/index.html b/report/index.html deleted file mode 100644 index 30f922f..0000000 --- a/report/index.html +++ /dev/null @@ -1,62 +0,0 @@ - - -Coverage report - - - - - - - - - -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to<A HREF="overview-summary.html">Non-frame version.</A> - - - diff --git a/report/net/jaekl/frank/FrankBundle.html b/report/net/jaekl/frank/FrankBundle.html deleted file mode 100644 index d44f652..0000000 --- a/report/net/jaekl/frank/FrankBundle.html +++ /dev/null @@ -1,423 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.FrankBundle
100%(4/4)
69%(9/13)
67%(4/6)
79%(15/19)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
3<init>[private]void <init>(java.util.Locale)
34get[public]java.lang.String get(java.lang.String)
11getInst[public, static]net.jaekl.frank.FrankBundle getInst(java.util.Locale)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank;
 2 
 
 3 
 import java.util.Locale;
 4 
 import java.util.MissingResourceException;
 5 
 import java.util.ResourceBundle;
 6 
 import java.util.concurrent.ConcurrentHashMap;
 7 
 
 8 
 import net.jaekl.qd.QDBundleFactory;
 9 
 
 10 
 public class FrankBundle {
 11 
 	public static final String DATA_COLLECTED = "data.collected";
 12 
 	public static final String DESTINATION = "destination";
 13 
 	public static final String ERROR_PAGE = "error.page";
 14 
 	public static final String ETA = "eta";
 15 
 	public static final String FRANK = "frank";
 16 
 	public static final String GPS_OFF = "gps.off";
 17 
 	public static final String GPS_READ = "gps.read";
 18 
 	public static final String MINUTES = "m";	// suffix (abbreviated) for minutes
 19 
 	public static final String REMAIN = "remain";
 20 
 	public static final String ROUTE = "route";
 21 
 	public static final String SECONDS = "s";
 22 
 	public static final String UNEXPECTED_ERROR = "unexpected.error";
 23 
 	
 24 
 	final static String BUNDLE_NAME = "frank";
 25 
 	
 26 Block: 1/1 
 	static ConcurrentHashMap<Locale, FrankBundle> m_bundleMap = new ConcurrentHashMap<Locale, FrankBundle>();
 27 
 	
 28 
 	ResourceBundle m_bundle;
 29 
 	
 30 
 	public static FrankBundle getInst(Locale locale) {
 31 Block: 1/1 
 		FrankBundle result = m_bundleMap.get(locale);
 32 
 		if (null == result) {
 33 Block: 1/1 Branch: 1/1 
 			synchronized(FrankBundle.class) {
 34 
 				result = m_bundleMap.get(locale);
 35 
 				if (null == result) {
 36 Block: 1/1 Branch: 1/1 
 					result = new FrankBundle(locale); 
 37 
 				}
 38 Block: 1/1 Branch: 0/1 
 				m_bundleMap.put(locale, result);
 39 
 			}
 40 
 		}
 41 Block: 1/1 Branch: 1/1 
 		return result;
 42 
 	}
 43 
 	
 44 Block: 1/1 
 	private FrankBundle(Locale locale) {
 45 
 		m_bundle = QDBundleFactory.getInst().getBundle(BUNDLE_NAME, locale); 
 46 
 	}
 47 
 	
 48 
 	public String get(String key) {
 49 
 		try {
 50 Block: 1/1 
 			if (null != m_bundle) {
 51 Block: 1/1 Branch: 1/1 
 				return m_bundle.getString(key);
 52 
 			}
 53 
 		}
 54 Block: 0/1 
 		catch (MissingResourceException e) {
 55 
 			// Make it clear that something has gone wrong.
 56 
 			e.printStackTrace();	
 57 
 			// Fall through to the fallback behaviour below
 58 Block: 0/1 Branch: 0/1 
 		}
 59 Block: 0/1 
 		return "[" + key + "]";
 60 
 	}
 61 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/FrankException.html b/report/net/jaekl/frank/FrankException.html deleted file mode 100644 index 6bf8d52..0000000 --- a/report/net/jaekl/frank/FrankException.html +++ /dev/null @@ -1,155 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.FrankException
0%(0/1)
0%(0/1)
-%
0%(0/2)
-

-

- - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
0<init>[public]void <init>(java.lang.Throwable)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank;
 2 
 
 3 
 import java.lang.Exception;
 4 
 
 5 
 public class FrankException extends Exception {
 6 
 	private static final long serialVersionUID = 1L;
 7 
 
 8 
 	public FrankException(Throwable cause) {
 9 Block: 0/1 
 		super(cause);
 10 
 	}
 11 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/Schedule.html b/report/net/jaekl/frank/Schedule.html deleted file mode 100644 index 3e971d1..0000000 --- a/report/net/jaekl/frank/Schedule.html +++ /dev/null @@ -1,876 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.Schedule
100%(7/7)
88%(21/24)
75%(9/12)
98%(79/81)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
8<init>[public]void <init>(java.util.Locale)
6mapUrl[]java.lang.String mapUrl(double,double)
22trans[]java.lang.String trans(java.lang.String)
11writeHeader[]void writeHeader(java.io.PrintWriter,java.lang.String)
2writePage[]void writePage(java.io.PrintWriter,net.jaekl.frank.octranspo.StopInfo)
2writeScript[]void writeScript(java.io.PrintWriter,java.lang.String,int)
14writeStyle[]void writeStyle(java.io.PrintWriter)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank;
 2 
 
 3 
 import java.io.PrintWriter;
 4 
 import java.text.DateFormat;
 5 
 import java.text.MessageFormat;
 6 
 import java.text.SimpleDateFormat;
 7 
 import java.util.Date;
 8 
 import java.util.Locale;
 9 
 
 10 
 import net.jaekl.frank.octranspo.Route;
 11 
 import net.jaekl.frank.octranspo.StopInfo;
 12 
 import net.jaekl.frank.octranspo.Trip;
 13 
 
 14 
 public class Schedule {
 15 
 	Locale m_locale;
 16 
 	FrankBundle m_bundle;
 17 
 	DateFormat m_hourMinFmt;
 18 
 	DateFormat m_hourMinSecFmt;
 19 
 	
 20 Block: 1/1 
 	public Schedule(Locale locale) {
 21 
 		m_locale = locale;
 22 
 		m_bundle = FrankBundle.getInst(locale);
 23 
 		m_hourMinFmt = new SimpleDateFormat("hh:mma", locale);
 24 
 		m_hourMinSecFmt = new SimpleDateFormat("hh:mm:ssa", locale);
 25 
 	}
 26 
 	
 27 
 	String trans(String key) {
 28 Block: 1/1 
 		return m_bundle.get(key);
 29 
 	}
 30 
 	
 31 
 	String mapUrl(double latitude, double longitude) {
 32 Block: 1/1 
 		return "http://www.openstreetmap.org/?mlat=" + latitude + "&mlon=" + longitude + "&zoom=15";
 33 
 	}
 34 
 	
 35 
 	void writeStyle(PrintWriter pw) {
 36 Block: 1/1 
 		pw.println("<STYLE>");
 37 
 		pw.println("  body {background-color: #F0F0C0; font-size: 1.5em; }");
 38 
 		pw.println("  #trips {border-collapse: collapse; font-size: 1.5em; }");
 39 
 		pw.println("  #trips td, #trips th {border: 1px solid #600000; padding: 3px 3px 3px 3px; text-align: center;}");
 40 
 		pw.println("  #trips th {background-color: #800000; color: #FFFFFF; }");
 41 
 		pw.println("  #trips tr.ghost td {background-color: #C0C0C0;}");
 42 
 		pw.println("</STYLE>");
 43 
 	}
 44 
 	
 45 
 	// Countdown timer that updates time remaining until each bus is expected.
 46 
 	void writeScript(PrintWriter pw, String remainArray, int remainCount) {
 47 Block: 1/1 
 		String min = trans(FrankBundle.MINUTES);
 48 
 		String sec = trans(FrankBundle.SECONDS);
 49 
 		
 50 
 		pw.println("<SCRIPT>");
 51 
 	    pw.println("var start; var interval; var remain;");
 52 
 	    pw.println("window.onload = function() { start = new Date(); interval = setInterval(\"Tick()\", 1000); remain = " + remainArray + "; }");
 53 
 	    pw.println("function Tick() { ");
 54 
 	    pw.println("  var now = new Date(); var delta = Math.floor((now.getTime() - start.getTime()) / 1000); ");
 55 
 	    pw.println("  var secs = delta % 60; var mins = Math.floor(delta / 60);");
 56 
 	    pw.println("  document.getElementById(\"elapsed\").innerHTML = mins + \"" + min + " \" + secs + \"" + sec + "\"");
 57 
 	    pw.println("  for (var i = 0; i < " + remainCount + "; ++i) {");
 58 
 	    pw.println("    var id = \"in_\" + i;");
 59 
 	    pw.println("    var element = document.getElementById(id);");
 60 
 	    pw.println("    var remain_delta = (remain[i] * 60) + 30 - delta;");
 61 
 	    pw.println("    if (remain_delta <= 0) {");
 62 
 	    pw.println("      element.innerHTML = \"----\"");
 63 
 	    pw.println("    } else {");
 64 
 	    pw.println("      element.innerHTML = (Math.floor(remain_delta / 60)) + \"" + trans(min) + "\"");
 65 
 	    pw.println("    }");
 66 
 	    pw.println("  }");
 67 
 	    pw.println("}");
 68 
 	    pw.println("</SCRIPT>");
 69 
 
 70 
 	}
 71 
 	
 72 
 	void writeHeader(PrintWriter pw, String title) {
 73 Block: 1/1 
 		pw.println("<HTML>");
 74 
 		pw.println("<HEAD>");
 75 
 		pw.println("<TITLE>" + title + "</TITLE>");
 76 
 		writeStyle(pw);
 77 
 		pw.println("</HEAD>");
 78 
 	}
 79 
 	
 80 
 	void writePage(PrintWriter pw, StopInfo stopInfo)
 81 
 	{
 82 Block: 1/1 
 		StringBuilder remainArray = new StringBuilder("[ ");
 83 
 		int           remainCount = 0;
 84 
 		
 85 
 		String title = stopInfo.getDescr() + " (" + stopInfo.getStopNo() + ")";
 86 
 		String min = trans(FrankBundle.MINUTES);
 87 
 		
 88 
 		writeHeader(pw, trans(FrankBundle.FRANK) + ": " + title);
 89 
 		
 90 
 		pw.println("<BODY>");
 91 
 		pw.println("  <TABLE ID=\"trips\">");
 92 
 		pw.println("    <TR><TH COLSPAN=\ř\">" + title + "</TH></TR>");
 93 
 		pw.println("    <TR><TH>" +
 94 
 		        trans(FrankBundle.ROUTE) + 
 95 
 				"</TH><TH>" +
 96 
 				trans(FrankBundle.DESTINATION) +
 97 
 				"</TH><TH>" +
 98 
 				trans(FrankBundle.ETA) +
 99 
 				"</TH><TH>" +
 100 
 				trans(FrankBundle.REMAIN) +  
 101 
 				"</TH><TH>" +
 102 
 				trans(FrankBundle.GPS_READ) +
 103 
 				"</TH>");
 104 
 		
 105 Block: 1/1 Branch: 1/1 
 		for (int routeIdx = 0; routeIdx < stopInfo.getNumRoutes(); ++routeIdx) {
 106 Block: 1/1 Branch: 1/1 
 			Route route = stopInfo.getRoute(routeIdx);
 107 
 			for (int tripIdx = 0; tripIdx < route.getNumTrips(); ++tripIdx) {
 108 Block: 1/1 Branch: 1/1 
 				Trip trip = route.getTrip(tripIdx);
 109 
 				boolean isGhost = ((-1) == trip.getAdjAge());
 110 Block: 1/1 
 				if (isGhost) {
 111 
 					// GPS is off.  This bus may not exist.
 112 Block: 0/1 Branch: 0/1 
 					pw.println("    <TR CLASS=\"ghost\">");
 113 
 				} else {
 114 Block: 1/1 Branch: 1/1 
 					pw.println("    <TR>");
 115 
 				}
 116 Block: 1/1 
 				pw.println("      <TD>" + route.getRouteNo() + "</TD>");
 117 
 				pw.println("      <TD>" + trip.getDest() + "</TD>");
 118 
 				pw.println("      <TD>" + m_hourMinFmt.format(trip.getETA()) + "</TD>");
 119 
 				
 120 
 				pw.println("      <TD><SPAN ID=\"in_" + remainCount + "\">"+ trip.getAdjTime()+min+"</SPAN></TD>");
 121 
 				if (remainCount > 0) {
 122 Block: 1/1 Branch: 1/1 
 					remainArray.append(", ");
 123 
 				}
 124 Block: 1/1 Branch: 1/1 
 				remainArray.append(trip.getAdjTime());
 125 
 				remainCount++;
 126 
 				
 127 
 				if (trip.getAdjAge() < 0) {
 128 Block: 0/1 Branch: 0/1 
 					pw.println("      <TD>" + trans(FrankBundle.GPS_OFF) + "</TD>");
 129 
 				}
 130 
 				else {
 131 Block: 1/1 Branch: 1/1 
 					pw.println("      <TD><A HREF=\"" + mapUrl(trip.getLatitude(), trip.getLongitude()) + 
 132 
 							   "\">" + m_hourMinSecFmt.format(trip.getGPSTime()) + "</A></TD>");
 133 
 				}
 134 Block: 1/1 
 				pw.println("    </TR>");
 135 
 			}
 136 
 		}
 137 
 		
 138 Block: 1/1 Branch: 1/1 
 		pw.println("  </TABLE>");
 139 
 		
 140 
 		String dataCollectedFormat = trans(FrankBundle.DATA_COLLECTED);
 141 
 		String dataCollected = MessageFormat.format(dataCollectedFormat, m_hourMinSecFmt.format(new Date()));
 142 
 		pw.println("  <P>" + dataCollected + "</P>");
 143 
 		
 144 
 		remainArray.append(" ]");
 145 
 		writeScript(pw, remainArray.toString(), remainCount);
 146 
 		pw.println("</BODY></HTML>");
 147 
 	}
 148 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/ViewSchedule.html b/report/net/jaekl/frank/ViewSchedule.html deleted file mode 100644 index 66255f7..0000000 --- a/report/net/jaekl/frank/ViewSchedule.html +++ /dev/null @@ -1,755 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.ViewSchedule
67%(4/6)
38%(8/21)
30%(3/10)
43%(20/46)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
3<init>[public]void <init>()
0doGet[public]void doGet(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
0getLocale[]java.util.Locale getLocale(javax.servlet.http.HttpServletRequest)
4getParamInt[]int getParamInt(javax.servlet.http.HttpServletRequest,java.lang.String)
8getParamString[]java.lang.String getParamString(javax.servlet.http.HttpServletRequest,java.lang.String)
3writeErrorPage[]void writeErrorPage(java.io.PrintWriter,java.lang.Throwable,java.util.Locale)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank;
 2 
 
 3 
 import java.io.ByteArrayOutputStream;
 4 
 import java.io.FileInputStream;
 5 
 import java.io.IOException;
 6 
 import java.io.PrintStream;
 7 
 import java.io.PrintWriter;
 8 
 import java.util.Locale;
 9 
 
 10 
 import javax.servlet.ServletException;
 11 
 import javax.servlet.http.HttpServlet;
 12 
 import javax.servlet.http.HttpServletRequest;
 13 
 import javax.servlet.http.HttpServletResponse;
 14 
 
 15 
 import net.jaekl.frank.octranspo.Server;
 16 
 import net.jaekl.frank.octranspo.StopInfo;
 17 
 import net.jaekl.qd.util.ExceptionUtils;
 18 
 
 19 Block: 1/1 
 public class ViewSchedule extends HttpServlet {
 20 
 	private static final long serialVersionUID = 1L;
 21 
 	
 22 
 	static final String BUNDLE_NAME = "frank";
 23 
 	static final String STOP = "stop";
 24 
 	static final String ROUTE = "route";
 25 
 	static final String LANG = "lang";
 26 
 	
 27 
 	int getParamInt(HttpServletRequest req, String paramName) {
 28 Block: 1/1 
 		String valueStr = getParamString(req, paramName);
 29 
 		try {
 30 
 			return Integer.parseInt(valueStr);
 31 
 		}
 32 Block: 1/1 
 		catch (NumberFormatException exc) {
 33 
 			// TODO:  Error page
 34 
 			return 0;
 35 
 		}
 36 
 	}
 37 
 	
 38 
 	String getParamString(HttpServletRequest req, String paramName) {
 39 Block: 1/1 
 		String valueStr = req.getParameter(paramName);
 40 
 		if (null == valueStr|| valueStr.equals("")) {
 41 
 			// TODO:  Error page
 42 Block: 1/1 Branch: 1/2 
 			return null;
 43 
 		}
 44 Block: 1/1 Branch: 1/1 
 		return valueStr;
 45 
 	}
 46 
 	
 47 
 	Locale getLocale(HttpServletRequest req) {
 48 Block: 0/1 
 		Locale result = null;
 49 
 		String lang = getParamString(req, LANG);
 50 
 		if (null != lang) {
 51 Block: 0/1 Branch: 0/1 
 			result = new Locale(lang);
 52 
 		}
 53 Block: 0/1 Branch: 0/1 
 		if (null == result) {
 54 Block: 0/1 Branch: 0/1 
 			result = Locale.getDefault();
 55 
 		}
 56 Block: 0/1 Branch: 0/1 
 		return result;
 57 
 	}
 58 
 
 59 
 	@Override
 60 
 	public void doGet(HttpServletRequest req, HttpServletResponse res)
 61 
 	throws ServletException, IOException
 62 
 	{
 63 Block: 0/1 
 		res.setContentType("text/html");
 64 
 		PrintWriter pw = res.getWriter();
 65 
 		
 66 
 		Locale locale = getLocale(req);
 67 
 		int stop = getParamInt(req, STOP);
 68 
 		int route = getParamInt(req, ROUTE);
 69 
 		
 70 
 		try {
 71 
 			FileInputStream fis = new FileInputStream("apikey.txt");
 72 
 			try {
 73 
 				Server server = new Server("192f31d2", fis);
 74 
 				StopInfo stopInfo = null;
 75 
 				
 76 
 				if (0 == route) {
 77 Block: 0/1 Branch: 0/1 
 					stopInfo = server.getNextTripsForStopAllRoutes(stop);
 78 
 				}
 79 
 				else {
 80 Block: 0/1 Branch: 0/1 
 					stopInfo = server.getNextTripsForStop(stop, route);
 81 
 				}
 82 Block: 0/1 
 				Schedule schedule = new Schedule(locale);
 83 
 				
 84 
 				schedule.writePage(pw, stopInfo);
 85 
 			}
 86 
 			finally {
 87 Block: 0/1 
 				ExceptionUtils.tryClose(fis);
 88 
 			}
 89 
 		}
 90 Block: 0/1 
 		catch (Throwable t) {
 91 
 			writeErrorPage(pw, t, locale);
 92 Block: 0/1 
 		}
 93 Block: 0/1 
 	}
 94 
 	
 95 
 	void writeErrorPage(PrintWriter pw, Throwable t, Locale locale) {
 96 Block: 1/1 
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 97 
 		PrintStream ps = new PrintStream(baos);
 98 
 		FrankBundle bundle = FrankBundle.getInst(locale);
 99 
 		
 100 
 		pw.println("<HTML><HEAD><TITLE>" + 
 101 
 				bundle.get(FrankBundle.FRANK) + ": " +
 102 
 				bundle.get(FrankBundle.ERROR_PAGE) + 
 103 
 				"</TITLE></HEAD>");
 104 
 		pw.println("<BODY><H1>" +
 105 
 				bundle.get(FrankBundle.FRANK) + ": " +
 106 
 				bundle.get(FrankBundle.UNEXPECTED_ERROR) + 
 107 
 				"</H1><P><PRE>");
 108 
 
 109 
 		// Note that, if we cared about security, we would log this stack trace to a
 110 
 		// server log, and only report a cross-reference to the log file back to the 
 111 
 		// end user's browser, to avoid potentially exposing internal info that we 
 112 
 		// don't want to share.
 113 
 		// At least at this point, we don't care (that much), and trade off a 
 114 
 		// potential information leak in favour of reducing our code complexity
 115 
 		// and the administrator's workload.
 116 
 		t.printStackTrace(ps);
 117 
 		String stackTrace = baos.toString(); 
 118 
 		pw.println(stackTrace);
 119 
 				
 120 
 		pw.println("</PRE></P></BODY>");
 121 
 		pw.println("</HTML>");
 122 
 	}
 123 
 	
 124 
 
 125 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/NextTrips.html b/report/net/jaekl/frank/octranspo/NextTrips.html deleted file mode 100644 index 555730c..0000000 --- a/report/net/jaekl/frank/octranspo/NextTrips.html +++ /dev/null @@ -1,161 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.NextTrips
100%(2/2)
100%(2/2)
-%
100%(4/4)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
1<init>[public]void <init>()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 public class NextTrips extends StopInfo {
 4 
 	static final String ROOT_TAG = "GetNextTripsForStopResult";
 5 Block: 1/1 
 	static final String[] INTERNAL = { STOP_NO, STOP_LABEL, ERROR, ROUTES };
 6 
 	static final Object[][] EXTERNAL = { { ROUTE, Route.class} };
 7 
 
 8 
 	public NextTrips() {
 9 Block: 1/1 
 		super(ROOT_TAG, INTERNAL, EXTERNAL);
 10 
 	}
 11 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/Route.html b/report/net/jaekl/frank/octranspo/Route.html deleted file mode 100644 index 3957995..0000000 --- a/report/net/jaekl/frank/octranspo/Route.html +++ /dev/null @@ -1,514 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.Route
100%(10/10)
90%(26/29)
75%(15/20)
100%(31/31)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
7<init>[public]void <init>()
22endContents[public]void endContents(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
9endExternal[public]void endExternal(java.lang.String,java.lang.String,java.lang.String)
4getDirection[public]java.lang.String getDirection()
2getDirectionID[public]int getDirectionID()
8getNumTrips[public]int getNumTrips()
4getRouteHeading[public]java.lang.String getRouteHeading()
8getRouteNo[public]int getRouteNo()
8getTrip[public]net.jaekl.frank.octranspo.Trip getTrip(int)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 import java.util.ArrayList;
 4 
 import net.jaekl.qd.xml.ParseResult;
 5 
 import net.jaekl.qd.xml.XmlParseException;
 6 
 
 7 Block: 1/1 
 public class Route extends ParseResult {
 8 
 	static final String ROUTE = "Route";
 9 
 	
 10 
 	static final String ROUTE_NO = "RouteNo";
 11 
 	static final String DIRECTION_ID = "DirectionID";
 12 
 	static final String DIRECTION = "Direction";
 13 
 	static final String ROUTE_HEADING = "RouteHeading";
 14 
 	static final String ROUTE_LABEL = "RouteLabel";	// What GetNextTripsForStop calls <RouteHeading>	
 15 
 	static final String TRIPS = "Trips";
 16 
 	
 17 
 	static final String TRIP = "Trip";
 18 
 	
 19 Block: 1/1 
 	static final String[] INTERNAL = { ROUTE_NO, DIRECTION_ID, DIRECTION, ROUTE_HEADING, ROUTE_LABEL, TRIPS };
 20 
 	static final Object[][] EXTERNAL = { { TRIP, Trip.class } };
 21 
 	
 22 
 	int m_routeNo;
 23 
 	int m_directionID;
 24 
 	String m_direction;
 25 
 	String m_routeHeading;
 26 
 	ArrayList<Trip> m_trips;
 27 
 
 28 
 	public Route() {
 29 Block: 1/1 
 		super(ROUTE, INTERNAL, EXTERNAL);
 30 
 		m_routeNo = 0;
 31 
 		m_directionID = 0;
 32 
 		m_direction = "";
 33 
 		m_routeHeading = "";
 34 
 		m_trips = new ArrayList<Trip>();
 35 
 	}
 36 
 
 37 Block: 1/1 
 	public int getRouteNo() { return m_routeNo; }
 38 Block: 1/1 
 	public int getDirectionID() { return m_directionID; }
 39 Block: 1/1 
 	public String getDirection() { return m_direction; }
 40 Block: 1/1 
 	public String getRouteHeading() { return m_routeHeading; } 
 41 Block: 1/1 
 	public int getNumTrips() { return m_trips.size(); }
 42 Block: 1/1 
 	public Trip getTrip(int idx) { return new Trip(m_trips.get(idx)); }
 43 
 
 44 
 	@Override
 45 
 	public void endContents(String uri, String localName, String qName, String chars) throws XmlParseException 
 46 
 	{
 47 Block: 1/1 
 		if (ROUTE_NO.equals(localName)) {
 48 Block: 1/1 Branch: 1/1 
 			m_routeNo = Integer.parseInt(chars);
 49 
 		}
 50 Block: 1/1 Branch: 1/1 
 		else if (DIRECTION_ID.equals(localName)) {
 51 Block: 1/1 Branch: 1/1 
 			m_directionID = Integer.parseInt(chars);
 52 
 		}
 53 Block: 1/1 Branch: 1/1 
 		else if (DIRECTION.equals(localName)) {
 54 Block: 1/1 Branch: 1/1 
 			m_direction = chars;
 55 
 		}
 56 Block: 1/1 Branch: 1/1 
 		else if (ROUTE_HEADING.equals(localName) || ROUTE_LABEL.equals(localName)) {
 57 Block: 1/1 Branch: 2/2 
 			m_routeHeading = chars;
 58 
 		}
 59 Block: 1/1 Branch: 1/1 
 	}
 60 
 	
 61 
 	@Override
 62 
 	public void endExternal(String uri, String localName, String qName) throws XmlParseException
 63 
 	{
 64 Block: 1/1 
 		if (localName.equals(TRIP)) {
 65 Block: 1/1 Branch: 1/1 
 			ParseResult[] collected = collectParsedChildren(Trip.class);
 66 
 			for (ParseResult pr : collected) {
 67 Block: 1/1 Branch: 1/1 
 				assert(pr instanceof Trip);
 68 Block: 1/1 Branch: 1/2 
 				m_trips.add((Trip)pr);
 69 
 			}
 70 
 		}
 71 Block: 1/1 Branch: 1/2 
 	}
 72 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/RouteSummary.html b/report/net/jaekl/frank/octranspo/RouteSummary.html deleted file mode 100644 index dfb84a0..0000000 --- a/report/net/jaekl/frank/octranspo/RouteSummary.html +++ /dev/null @@ -1,161 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.RouteSummary
100%(2/2)
100%(2/2)
-%
100%(4/4)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
4<init>[public]void <init>()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 public class RouteSummary extends StopInfo {
 4 
 	static final String ROOT_TAG = "GetRouteSummaryForStopResult";
 5 Block: 1/1 
 	static final String[] INTERNAL = { STOP_NO, DESCRIPTION, ERROR, ROUTES };
 6 
 	static final Object[][] EXTERNAL = { { ROUTE, Route.class} };
 7 
 
 8 
 	public RouteSummary() {
 9 Block: 1/1 
 		super(ROOT_TAG, INTERNAL, EXTERNAL);
 10 
 	}
 11 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/Server.html b/report/net/jaekl/frank/octranspo/Server.html deleted file mode 100644 index 439a6eb..0000000 --- a/report/net/jaekl/frank/octranspo/Server.html +++ /dev/null @@ -1,559 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.Server
100%(5/5)
53%(9/17)
30%(3/10)
78%(21/27)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
3<init>[public]void <init>(java.lang.String,java.io.InputStream)
1getNextTripsForStop[public]net.jaekl.frank.octranspo.StopInfo getNextTripsForStop(int,int)
1getNextTripsForStopAllRoutes[public]net.jaekl.frank.octranspo.StopInfo getNextTripsForStopAllRoutes(int)
1getRouteSummaryForStop[public]net.jaekl.frank.octranspo.StopInfo getRouteSummaryForStop(int)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 import java.io.BufferedReader;
 4 
 import java.io.InputStream;
 5 
 import java.io.InputStreamReader;
 6 
 import java.io.IOException;
 7 
 import java.util.ArrayList;
 8 
 
 9 
 import net.jaekl.frank.FrankException;
 10 
 import net.jaekl.qd.QDException;
 11 
 import net.jaekl.qd.http.RequestBroker;
 12 
 
 13 
 import org.apache.http.NameValuePair;
 14 
 import org.apache.http.message.BasicNameValuePair;
 15 
 
 16 Block: 1/1 
 public class Server
 17 
 {
 18 
 	static final String API_KEY = "apiKey";
 19 
 	static final String APP_ID = "appID";
 20 
 	static final String GATEWAY_URL = "https://api.octranspo1.com/v1.2/";
 21 
 	static final String ROUTE_NO = "routeNo";
 22 
 	static final String STOP_NO = "stopNo";
 23 
 	static final String GET_ROUTE_SUMMARY_FOR_STOP = "GetRouteSummaryForStop";
 24 
 	static final String GET_NEXT_TRIPS_FOR_STOP = "GetNextTripsForStop";
 25 
 	static final String GET_NEXT_TRIPS_FOR_STOP_ALL_ROUTES = "GetNextTripsForStopAllRoutes";
 26 
 
 27 
 	RequestBroker m_broker;
 28 
 	ArrayList<NameValuePair> m_baseParams;
 29 
 
 30 
 	// Constructor
 31 
 	// appID   The appID for our application
 32 
 	// is      InputStream from which to read the apiKey
 33 Block: 1/1 
 	public Server(String appID, InputStream is) throws IOException {
 34 
 		assert (null != appID);
 35 Block: 1/1 Branch: 1/2 
 		assert (null != is);
 36 
 
 37 Block: 1/1 Branch: 1/2 
 		BufferedReader br = new BufferedReader(new InputStreamReader(is));
 38 
 		String apiKey = br.readLine();
 39 
 
 40 
 		m_baseParams = new ArrayList<NameValuePair>();
 41 
 		m_baseParams.add(new BasicNameValuePair(APP_ID, appID));
 42 
 		m_baseParams.add(new BasicNameValuePair(API_KEY, apiKey));
 43 
 
 44 
 		m_broker = new RequestBroker(GATEWAY_URL, m_baseParams);
 45 
 	}
 46 
 
 47 
 	public StopInfo getRouteSummaryForStop(int stopNo) 
 48 
 			throws FrankException
 49 
 	{
 50 
 		try {
 51 Block: 1/1 
 			ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
 52 
 			params.add(new BasicNameValuePair(STOP_NO, Integer.valueOf(stopNo).toString()));
 53 
 			return (StopInfo) m_broker.submitAndParse(GET_ROUTE_SUMMARY_FOR_STOP, params, RouteSummary.class);
 54 
 		}
 55 Block: 0/1 
 		catch (QDException e) {
 56 
 			throw new FrankException(e);
 57 
 		}
 58 
 	}
 59 
 
 60 
 	public StopInfo getNextTripsForStop(int stopNo, int routeNo) 
 61 
 			throws FrankException
 62 
 	{
 63 
 		try {
 64 Block: 1/1 
 			ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
 65 
 			params.add(new BasicNameValuePair(STOP_NO, Integer.valueOf(stopNo).toString()));
 66 
 			params.add(new BasicNameValuePair(ROUTE_NO, Integer.valueOf(routeNo).toString()));
 67 
 			return (StopInfo) m_broker.submitAndParse(GET_NEXT_TRIPS_FOR_STOP, params, NextTrips.class);
 68 
 		}
 69 Block: 0/1 
 		catch (QDException e) {
 70 
 			throw new FrankException(e);
 71 
 		}
 72 
 	}
 73 
 
 74 
 	public StopInfo getNextTripsForStopAllRoutes(int stopNo) 
 75 
 			throws FrankException
 76 
 	{
 77 
 		try {
 78 Block: 1/1 
 			ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
 79 
 			params.add(new BasicNameValuePair(STOP_NO, Integer.valueOf(stopNo).toString()));
 80 
 			return (StopInfo) m_broker.submitAndParse(GET_NEXT_TRIPS_FOR_STOP_ALL_ROUTES, params, RouteSummary.class);
 81 
 		}
 82 Block: 0/1 
 		catch (QDException e) {
 83 
 			throw new FrankException(e);
 84 
 		}
 85 
 	}
 86 
 }
 87 
 
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/StopInfo.html b/report/net/jaekl/frank/octranspo/StopInfo.html deleted file mode 100644 index 4e65791..0000000 --- a/report/net/jaekl/frank/octranspo/StopInfo.html +++ /dev/null @@ -1,528 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.StopInfo
100%(9/9)
83%(24/29)
64%(14/22)
100%(32/32)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
5<init>[public]void <init>(java.lang.String,java.lang.String[],java.lang.Object[][])
11endContents[public]void endContents(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
5endExternal[public]void endExternal(java.lang.String,java.lang.String,java.lang.String)
5getDescr[public]java.lang.String getDescr()
3getError[public]java.lang.String getError()
7getNumRoutes[public]int getNumRoutes()
6getRoute[public]net.jaekl.frank.octranspo.Route getRoute(int)
5getStopNo[public]int getStopNo()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 import java.util.ArrayList;
 4 
 
 5 
 import net.jaekl.qd.xml.ParseResult;
 6 
 import net.jaekl.qd.xml.XmlParseException;
 7 
 
 8 Block: 1/1 
 public class StopInfo extends ParseResult
 9 
 {
 10 
 	// potential child tag names
 11 Block: 1/1 
 	public static String STOP_NO = "StopNo";
 12 
 	public static String DESCRIPTION = "StopDescription";	// Present in RouteSummary
 13 
 	public static String STOP_LABEL = "StopLabel";			// What NextTrips calls StopDescription
 14 
 	public static String ERROR = "Error";
 15 
 	public static String ROUTES = "Routes";
 16 
 	public static String ROUTE = "Route";
 17 
 
 18 
 	// data returned inside our element
 19 
 	int m_stopNo;
 20 
 	String m_descr;
 21 
 	String m_error;
 22 
 	ArrayList<Route> m_routes;
 23 
 
 24 
 	// Constructor
 25 
 	public StopInfo(String rootTagName, String[] internal, Object[][] external) {
 26 Block: 1/1 
 		super(rootTagName, internal, external);
 27 
 
 28 
 		m_stopNo = 0;
 29 
 		m_descr = "";
 30 
 		m_error = "";
 31 
 		m_routes = new ArrayList<Route>();
 32 
 	}
 33 
 
 34 
 	// -----------------------------
 35 
 	// Public methods to access data
 36 
 
 37 Block: 1/1 
 	public int getStopNo() { return m_stopNo; }
 38 Block: 1/1 
 	public String getDescr() { return m_descr; }
 39 Block: 1/1 
 	public String getError() { return m_error; }
 40 Block: 1/1 
 	public int getNumRoutes() { return m_routes.size(); }
 41 Block: 1/1 
 	public Route getRoute(int idx) { return m_routes.get(idx); }
 42 
 
 43 
 	// --------------------------
 44 
 	// ParseResult implementation
 45 
 
 46 
 	@Override
 47 
 	public void endContents(String uri, String localName, String qName, String chars) throws XmlParseException
 48 
 	{
 49 Block: 1/1 
 		assert (null != localName);
 50 
 
 51 Block: 1/1 Branch: 1/2 
 		if (localName.equals(STOP_NO)) {
 52 Block: 1/1 Branch: 1/1 
 			m_stopNo = Integer.parseInt(chars);
 53 
 		}
 54 Block: 1/1 Branch: 1/1 
 		else if (localName.equals(DESCRIPTION) || localName.equals(STOP_LABEL)) {
 55 Block: 1/1 Branch: 2/2 
 			m_descr = chars;
 56 
 		}
 57 Block: 1/1 Branch: 1/1 
 		else if (localName.equals(ERROR)) {
 58 Block: 1/1 Branch: 1/1 
 			m_error = chars;
 59 
 		}
 60 Block: 1/1 Branch: 1/1 
 	}
 61 
 	
 62 
 	@Override
 63 
 	public void endExternal(String uri, String localName, String qName) throws XmlParseException
 64 
 	{
 65 Block: 1/1 
 		if (localName.equals(ROUTE)) {
 66 Block: 1/1 Branch: 1/1 
 			ParseResult[] collected = collectParsedChildren(Route.class);
 67 
 			for (ParseResult pr : collected) {
 68 Block: 1/1 Branch: 1/1 
 				assert (pr instanceof Route);
 69 Block: 1/1 Branch: 1/2 
 				m_routes.add((Route)pr);
 70 
 			}
 71 
 		}
 72 Block: 1/1 Branch: 1/2 
 	}
 73 
 	
 74 
 	
 75 
 }
 76 
 
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/Trip.html b/report/net/jaekl/frank/octranspo/Trip.html deleted file mode 100644 index c2e39ed..0000000 --- a/report/net/jaekl/frank/octranspo/Trip.html +++ /dev/null @@ -1,890 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.frank.octranspo.Trip
94%(15/16)
94%(34/36)
94%(17/18)
95%(58/61)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
13<init>[public]void <init>()
8<init>[public]void <init>(net.jaekl.frank.octranspo.Trip)
81endContents[public]void endContents(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
0endExternal[public]void endExternal(java.lang.String,java.lang.String,java.lang.String)
12getAdjAge[public]double getAdjAge()
12getAdjTime[public]int getAdjTime()
4getBusType[public]java.lang.String getBusType()
8getDest[public]java.lang.String getDest()
4getETA[public]java.util.Date getETA()
4getGPSTime[public]java.util.Date getGPSTime()
8getLatitude[public]double getLatitude()
8getLongitude[public]double getLongitude()
4getSpeed[public]double getSpeed()
4getStart[public]java.util.Date getStart()
4isLastTrip[public]boolean isLastTrip()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.frank.octranspo;
 2 
 
 3 
 import java.text.DateFormat;
 4 
 import java.text.ParseException;
 5 
 import java.text.SimpleDateFormat;
 6 
 import java.util.Date;
 7 
 
 8 
 import net.jaekl.qd.util.ParseUtils;
 9 
 import net.jaekl.qd.xml.ParseResult;
 10 
 import net.jaekl.qd.xml.XmlParseException;
 11 
 
 12 
 public class Trip extends ParseResult {
 13 
 	static final String TRIP = "Trip";
 14 
 	
 15 
 	static final String TRIP_DESTINATION = "TripDestination";
 16 
 	static final String TRIP_START_TIME = "TripStartTime";
 17 
 	static final String ADJUSTED_SCHEDULE_TIME = "AdjustedScheduleTime";
 18 
 	static final String ADJUSTMENT_AGE = "AdjustmentAge";
 19 
 	static final String LAST_TRIP_OF_SCHEDULE = "LastTripOfSchedule";
 20 
 	static final String BUS_TYPE = "BusType";
 21 
 	static final String GPS_SPEED = "GPSSpeed";
 22 
 	static final String LATITUDE = "Latitude";
 23 
 	static final String LONGITUDE = "Longitude";
 24 
 	
 25 Block: 1/1 
 	static final String[] INTERNAL = { TRIP_DESTINATION,
 26 
 		                               TRIP_START_TIME,
 27 
 		                               ADJUSTED_SCHEDULE_TIME,
 28 
 		                               ADJUSTMENT_AGE,
 29 
 		                               LAST_TRIP_OF_SCHEDULE,
 30 
 		                               BUS_TYPE,
 31 
 		                               GPS_SPEED,
 32 
 		                               LATITUDE,
 33 
 		                               LONGITUDE };
 34 
 	static final Object[][] EXTERNAL = {};
 35 
 	
 36 
     String  m_dest;      // destination
 37 
     Date    m_start;     // time at which the trip started / is scheduled to start
 38 
     int     m_adjTime;   // minutes until bus is predicted to arrive
 39 
     double  m_adjAge;    // time since the last GPS data was received, in minutes (possibly fractional)
 40 
     boolean m_lastTrip;  // is this the last scheduled trip of the day?
 41 
     String  m_busType;   // type of bus
 42 
     double  m_speed;     // speed (km/h) when last polled
 43 
     double  m_long;      // longitude
 44 
     double  m_lat;       // latitude
 45 
     
 46 
     DateFormat m_dateFormat;
 47 
     Date       m_constructed;	// DateTime when this object was constructed
 48 
 
 49 
     public Trip() {
 50 Block: 1/1 
     	super(TRIP, INTERNAL, EXTERNAL);
 51 
     	m_dest = "";
 52 
     	m_start = new Date();
 53 
     	m_adjTime = 0;
 54 
     	m_adjAge = 0.0;
 55 
     	m_lastTrip = false;
 56 
     	m_busType = "";
 57 
     	m_speed = 0.0;
 58 
     	m_long = 0.0;
 59 
     	m_lat = 0.0;
 60 
     	
 61 
     	m_dateFormat = new SimpleDateFormat("hh:mm");
 62 
     	m_constructed = new Date();
 63 
     }
 64 
     
 65 
     public Trip(Trip other) {
 66 Block: 1/1 
     	super(TRIP, INTERNAL, EXTERNAL);
 67 
     	m_dest = other.m_dest;
 68 
     	m_start = other.m_start;
 69 
     	m_adjTime = other.m_adjTime;
 70 
     	m_adjAge = other.m_adjAge;
 71 
     	m_lastTrip = other.m_lastTrip;
 72 
     	m_busType = other.m_busType;
 73 
     	m_speed = other.m_speed;
 74 
     	m_long = other.m_long;
 75 
     	m_lat = other.m_lat;
 76 
     	m_constructed = other.m_constructed;
 77 
 	}
 78 
 
 79 Block: 1/1 
 	public String getDest() { return m_dest; }
 80 Block: 1/1 
     public Date getStart() { return m_start; }
 81 Block: 1/1 
     public int getAdjTime() { return m_adjTime; }
 82 Block: 1/1 
     public double getAdjAge() { return m_adjAge; }
 83 Block: 1/1 
     public boolean isLastTrip() { return m_lastTrip; }
 84 Block: 1/1 
     public String getBusType() { return m_busType; }
 85 Block: 1/1 
     public double getSpeed() { return m_speed; }
 86 Block: 1/1 
     public double getLongitude() { return m_long; }
 87 Block: 1/1 
     public double getLatitude() { return m_lat; }
 88 
     
 89 
     // Estimated (Date)Time of Arrival of this trip at the stop 
 90 Block: 1/1 
     public Date getETA() { return new Date(m_constructed.getTime() + (long)(1000 * 60 * m_adjTime)); }
 91 
     
 92 
     // (Date)Time when the GPS for this bus was last read
 93 Block: 1/1 
     public Date getGPSTime() { return new Date(m_constructed.getTime() - (long)(1000 * 60 * m_adjAge)); } 
 94 
 
 95 
     // ---------------------------
 96 
     // ParseResult implementation:
 97 
     
 98 
 	@Override
 99 
 	public void endContents(String uri, String localName, String qName,	String chars) throws XmlParseException 
 100 
 	{
 101 
 		try {
 102 Block: 1/1 
 			if (TRIP_DESTINATION.equals(localName)) {
 103 Block: 1/1 Branch: 1/1 
 				m_dest = chars;
 104 
 			}
 105 Block: 1/1 Branch: 1/1 
 			else if (TRIP_START_TIME.equals(localName)) {
 106 Block: 1/1 Branch: 1/1 
 				m_start = m_dateFormat.parse(chars);
 107 
 			}
 108 Block: 1/1 Branch: 1/1 
 			else if (ADJUSTED_SCHEDULE_TIME.equals(localName)) {
 109 Block: 1/1 Branch: 1/1 
 				m_adjTime = ParseUtils.parseInt(chars);
 110 
 			}
 111 Block: 1/1 Branch: 1/1 
 			else if (ADJUSTMENT_AGE.equals(localName)) {
 112 Block: 1/1 Branch: 1/1 
 				m_adjAge = ParseUtils.parseDouble(chars);
 113 
 			}
 114 Block: 1/1 Branch: 1/1 
 			else if (LAST_TRIP_OF_SCHEDULE.equals(localName)) {
 115 Block: 1/1 Branch: 1/1 
 				m_lastTrip = Boolean.parseBoolean(chars);
 116 
 			}
 117 Block: 1/1 Branch: 1/1 
 			else if (BUS_TYPE.equals(localName)) {
 118 Block: 1/1 Branch: 1/1 
 				m_busType = chars;
 119 
 			}
 120 Block: 1/1 Branch: 1/1 
 			else if (GPS_SPEED.equals(localName)) {
 121 Block: 1/1 Branch: 1/1 
 				m_speed = ParseUtils.parseDouble(chars);
 122 
 			}
 123 Block: 1/1 Branch: 1/1 
 			else if (LONGITUDE.equals(localName)) {
 124 Block: 1/1 Branch: 1/1 
 				m_long = ParseUtils.parseDouble(chars);
 125 
 			}
 126 Block: 1/1 Branch: 1/1 
 			else if (LATITUDE.equals(localName)) {
 127 Block: 1/1 Branch: 1/1 
 				m_lat = ParseUtils.parseDouble(chars);
 128 
 			}
 129 Block: 0/1 
 		} catch (ParseException pe) {
 130 
 			throw new XmlParseException(pe);
 131 Block: 1/1 Branch: 0/1 
 		}
 132 Block: 1/1 
 	}
 133 
 	
 134 
 	@Override
 135 
 	public void endExternal(String uri, String localName, String qName) throws XmlParseException
 136 
 	{
 137 
 		// no externally-parsed children
 138 Block: 0/1 
 	}
 139 
 }
 140 
 
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/octranspo/package-frame.html b/report/net/jaekl/frank/octranspo/package-frame.html deleted file mode 100644 index 27e2836..0000000 --- a/report/net/jaekl/frank/octranspo/package-frame.html +++ /dev/null @@ -1,23 +0,0 @@ - - -coverage report - - - -net.jaekl.frank.octranspo   98% (43/44)
-

-All classes - - - - -
-NextTrips  100% (2/2)
-Route  100% (10/10)
-RouteSummary  100% (2/2)
-Server  100% (5/5)
-StopInfo  100% (9/9)
-Trip  94% (15/16)
-
- - diff --git a/report/net/jaekl/frank/octranspo/package-summary.html b/report/net/jaekl/frank/octranspo/package-summary.html deleted file mode 100644 index 50484c0..0000000 --- a/report/net/jaekl/frank/octranspo/package-summary.html +++ /dev/null @@ -1,83 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.frank.octranspo6
98%(43/44)
84%(97/115)
70%(49/70)
94%(150/159)
-

-Classes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name%method%block%branch%line
NextTrips 100% (2/2) 100% (2/2) - 100% (4/4)
Route 100% (10/10) 90% (26/29) 75% (15/20) 100% (31/31)
RouteSummary 100% (2/2) 100% (2/2) - 100% (4/4)
Server 100% (5/5) 53% (9/17) 30% (3/10) 78% (21/27)
StopInfo 100% (9/9) 83% (24/29) 64% (14/22) 100% (32/32)
Trip 94% (15/16) 94% (34/36) 94% (17/18) 95% (58/61)
-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/frank/package-frame.html b/report/net/jaekl/frank/package-frame.html deleted file mode 100644 index 3f6ff3f..0000000 --- a/report/net/jaekl/frank/package-frame.html +++ /dev/null @@ -1,21 +0,0 @@ - - -coverage report - - - -net.jaekl.frank   83% (15/18)
-

-All classes - - - - -
-FrankBundle  100% (4/4)
-FrankException  0% (0/1)
-Schedule  100% (7/7)
-ViewSchedule  67% (4/6)
-
- - diff --git a/report/net/jaekl/frank/package-summary.html b/report/net/jaekl/frank/package-summary.html deleted file mode 100644 index 5ff0e15..0000000 --- a/report/net/jaekl/frank/package-summary.html +++ /dev/null @@ -1,111 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.frank4
83%(15/18)
64%(38/59)
57%(16/28)
77%(114/148)
-

-Packages
- - - - - - - - - - - - - - - - - - - -
Name#classes%class%method%block%branch%line
net.jaekl.frank.octranspo6 100% (6/6) 98% (43/44) 84% (97/115) 70% (49/70) 94% (150/159)
-

-Classes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name%method%block%branch%line
FrankBundle 100% (4/4) 69% (9/13) 67% (4/6) 79% (15/19)
FrankException 0% (0/1) 0% (0/1) - 0% (0/2)
Schedule 100% (7/7) 88% (21/24) 75% (9/12) 98% (79/81)
ViewSchedule 67% (4/6) 38% (8/21) 30% (3/10) 43% (20/46)
-

-Total (including subpackages)
- - - - - - - - - - - - - - - - -
-#classes%method%block%branch%line
10 94% (58/62) 78% (135/174) 66% (65/98) 86% (264/307)
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/QDBundleFactory.html b/report/net/jaekl/qd/QDBundleFactory.html deleted file mode 100644 index 050181d..0000000 --- a/report/net/jaekl/qd/QDBundleFactory.html +++ /dev/null @@ -1,312 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.QDBundleFactory
100%(3/3)
88%(7/8)
75%(3/4)
100%(11/11)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<init>[private]void <init>()
3getBundle[public]java.util.ResourceBundle getBundle(java.lang.String,java.util.Locale)
5getInst[public, static]net.jaekl.qd.QDBundleFactory getInst()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 // Central spot from which to access ResourceBundles.
 4 
 // This made more sense with earlier versions of Java, where the specification did not 
 5 
 // guarantee that ResourceBundles would be cached.  Java 7 and later cache by default,
 6 
 // but it still seems prudent to centralize accesses to resources here so that we have 
 7 
 // control in case we want to implement our own cache, or override certain behaviours.
 8 
 // 
 9 
 // Note that we rely on the JVM's caching, to avoid unnecessary overhead.
 10 
 // See http://java2go.blogspot.ca/2010/03/dont-be-smart-never-implement-resource.html
 11 
 
 12 
 package net.jaekl.qd;
 13 
 
 14 
 import java.util.Locale;
 15 
 import java.util.ResourceBundle;
 16 
 
 17 
 public class QDBundleFactory {
 18 
 	static volatile QDBundleFactory m_inst;	// singleton instance
 19 
 	
 20 Block: 1/1 
 	private QDBundleFactory() {
 21 
 		// no-op
 22 
 	}
 23 
 	
 24 
 	public static QDBundleFactory getInst() {
 25 Block: 1/1 
 		QDBundleFactory result = m_inst;
 26 
 		if (null == result) {
 27 Block: 1/1 Branch: 1/1 
 			synchronized(QDBundleFactory.class) {
 28 
 				if (null == m_inst) {
 29 Block: 1/1 Branch: 1/1 
 					m_inst = new QDBundleFactory();
 30 
 				}
 31 Block: 1/1 Branch: 0/1 
 				result = m_inst;
 32 
 			}
 33 
 		}
 34 Block: 1/1 Branch: 1/1 
 		return result;
 35 
 	}
 36 
 	
 37 
 	public ResourceBundle getBundle(String baseName, Locale locale) {
 38 Block: 1/1 
 		return ResourceBundle.getBundle(baseName, locale);
 39 
 	}
 40 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/QDException.html b/report/net/jaekl/qd/QDException.html deleted file mode 100644 index b7a7f3b..0000000 --- a/report/net/jaekl/qd/QDException.html +++ /dev/null @@ -1,176 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.QDException
100%(2/2)
100%(2/2)
-%
100%(4/4)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
4<init>[public]void <init>()
1<init>[public]void <init>(java.lang.Throwable)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.qd;
 2 
 
 3 
 public class QDException extends Exception
 4 
 {
 5 
 	private static final long serialVersionUID = 1L;
 6 
 
 7 
 	public QDException() {
 8 Block: 1/1 
 		super();
 9 
 	}
 10 
 	
 11 
 	public QDException(Throwable t) {
 12 Block: 1/1 
 		super(t);
 13 
 	}
 14 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/http/RequestBroker.html b/report/net/jaekl/qd/http/RequestBroker.html deleted file mode 100644 index 7dcf324..0000000 --- a/report/net/jaekl/qd/http/RequestBroker.html +++ /dev/null @@ -1,890 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.http.RequestBroker
83%(5/6)
50%(14/28)
40%(4/10)
53%(31/58)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
9<init>[public]void <init>(java.lang.String,java.util.ArrayList)
0doSubmit[]java.io.InputStream doSubmit(java.lang.String,java.util.ArrayList)
1submit[public]java.lang.String submit(java.lang.String,java.util.ArrayList)
5submitAndParse[public]net.jaekl.qd.xml.ParseResult submitAndParse(java.lang.String,java.util.ArrayList,java.lang.Class)
4submitAndParse[public]net.jaekl.qd.xml.ParseResult submitAndParse(java.lang.String,java.util.ArrayList,java.lang.Class,java.lang.String)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 package net.jaekl.qd.http;
 4 
 
 5 
 import java.io.BufferedReader;
 6 
 import java.io.IOException;
 7 
 import java.io.InputStream;
 8 
 import java.io.InputStreamReader;
 9 
 import java.io.UnsupportedEncodingException;
 10 
 import java.lang.reflect.InvocationTargetException;
 11 
 import java.util.ArrayList;
 12 
 
 13 
 import net.jaekl.qd.QDException;
 14 
 import net.jaekl.qd.util.ExceptionUtils;
 15 
 import net.jaekl.qd.xml.ParseHandler;
 16 
 import net.jaekl.qd.xml.ParseResult;
 17 
 
 18 
 import org.apache.http.HttpEntity;
 19 
 import org.apache.http.HttpResponse;
 20 
 import org.apache.http.NameValuePair;
 21 
 import org.apache.http.client.HttpClient;
 22 
 import org.apache.http.client.config.RequestConfig;
 23 
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 24 
 import org.apache.http.client.methods.HttpPost;
 25 
 import org.apache.http.impl.client.HttpClientBuilder;
 26 
 import org.xml.sax.InputSource;
 27 
 import org.xml.sax.SAXException;
 28 
 import org.xml.sax.XMLReader;
 29 
 import org.xml.sax.helpers.XMLReaderFactory;
 30 
 
 31 Block: 1/1 
 public class RequestBroker
 32 
 {
 33 
 	final String UTF_8 = "UTF-8";
 34 
 	final int TIMEOUT_MSEC = 5000;	// Allow at most 5 seconds before we declare the server to be unresponsive
 35 
 	
 36 
 	String m_gatewayUrl;
 37 
 	ArrayList<NameValuePair> m_baseParams;
 38 
 
 39 
 	public RequestBroker(String gatewayUrl, ArrayList<NameValuePair> baseParams)
 40 Block: 1/1 
 	{
 41 
 		m_gatewayUrl = gatewayUrl;
 42 
 		m_baseParams = new ArrayList<NameValuePair>(baseParams);
 43 
 	}
 44 
 	
 45 
 	// NB:  Caller is responsible for close()ing the returned InputStream
 46 
 	//
 47 
 	InputStream doSubmit(String method, ArrayList<NameValuePair> passedParams) throws QDException
 48 
 	{
 49 Block: 0/1 
 		ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(m_baseParams);
 50 
 		params.addAll(passedParams);
 51 
 		
 52 
 		try {
 53 
 			RequestConfig.Builder requestBuilder = RequestConfig.custom();
 54 
 			requestBuilder = requestBuilder.setConnectTimeout(TIMEOUT_MSEC);
 55 
 			requestBuilder = requestBuilder.setSocketTimeout(TIMEOUT_MSEC);
 56 
 			HttpClientBuilder builder = HttpClientBuilder.create();
 57 
 			builder.setDefaultRequestConfig(requestBuilder.build());
 58 
 			HttpClient httpClient = builder.build(); 
 59 
 			HttpPost httpPost = new HttpPost(m_gatewayUrl + "/" + method + "/");
 60 
 			httpPost.setEntity(new UrlEncodedFormEntity(params, UTF_8));
 61 
 			HttpResponse response = httpClient.execute(httpPost);
 62 
 			HttpEntity entity = response.getEntity();
 63 
 
 64 
 			if (null != entity) {
 65 Block: 0/1 Branch: 0/1 
 				InputStream is = entity.getContent();
 66 
 				return is;
 67 
 			}
 68 
 		}
 69 Block: 0/1 
 		catch (UnsupportedEncodingException uee) {
 70 
 			// We should actually be guaranteed that this never happens, 
 71 
 			// because all JVMs are required to support UTF-8
 72 
 			assert(false);
 73 Block: 0/1 Branch: 0/1 
 			throw new Error(uee);
 74 
 		}
 75 Block: 0/1 
 		catch (IOException ioe) {
 76 
 			throw new QDException(ioe);
 77 Block: 0/1 Branch: 0/1 
 		}
 78 
 		
 79 Block: 0/1 
 		return null;
 80 
 	}
 81 
 
 82 
 	public String submit(String method, ArrayList<NameValuePair> passedParams) throws QDException
 83 
 	{
 84 Block: 1/1 
 		StringBuilder sb = new StringBuilder();
 85 
 		InputStream is = null;
 86 
 
 87 
 		try {
 88 
 			is = doSubmit(method, passedParams);
 89 
 			BufferedReader br = new BufferedReader(new InputStreamReader(is));
 90 
 			String line = br.readLine();
 91 Block: 1/1 
 			while (null != line) {
 92 Block: 1/1 Branch: 1/1 
 				sb.append(line).append("\n");
 93 
 				line = br.readLine();
 94 
 			}
 95 
 		}
 96 Block: 0/1 
 		catch (IOException ioe) {
 97 
 			throw new QDException(ioe);
 98 
 		}
 99 
 		finally {
 100 Block: 1/2 Branch: 1/1 
 			ExceptionUtils.tryClose(is);
 101 
 		}
 102 
 
 103 Block: 1/1 
 		return sb.toString();
 104 
 	}
 105 
 	
 106 
 	public ParseResult submitAndParse(String method, 
 107 
 			  ArrayList<NameValuePair> passedParams, 
 108 
 			  Class<? extends ParseResult> rootParserClass)
 109 
 	throws QDException
 110 
 	{
 111 Block: 1/1 
 		return submitAndParse(method, passedParams, rootParserClass, null);
 112 
 	}
 113 
 	
 114 
 	public ParseResult submitAndParse(String method, 
 115 
 									  ArrayList<NameValuePair> passedParams, 
 116 
 									  Class<? extends ParseResult> rootParserClass,
 117 
 									  String rootTagName)
 118 
 	throws QDException
 119 
 	{
 120 Block: 1/1 
 		ParseResult result = null;
 121 
 		InputStream is = null;
 122 
 		
 123 
 		try {
 124 
 			if (null == rootTagName) {
 125 Block: 1/1 Branch: 1/1 
 				result = (ParseResult) rootParserClass.newInstance();
 126 
 			} 
 127 
 			else {
 128 Block: 0/1 Branch: 0/1 
 				result = (ParseResult) rootParserClass.getDeclaredConstructor(String.class).newInstance(rootTagName);
 129 
 			}
 130 Block: 1/1 
 			is = doSubmit(method, passedParams);
 131 
 			XMLReader reader = XMLReaderFactory.createXMLReader();
 132 
 			ParseHandler ph = new ParseHandler(result);
 133 
 			reader.setContentHandler(ph);
 134 
 			reader.parse(new InputSource(is));
 135 
 		} 
 136 Block: 0/1 
 		catch ( InstantiationException
 137 
 				| InvocationTargetException
 138 
 				| IllegalAccessException
 139 
 				| IOException 
 140 
 				| NoSuchMethodException
 141 
 				| SAXException 
 142 
 				e )
 143 
 		{
 144 
 			throw new QDException(e);
 145 
 		} 
 146 
 		finally {
 147 Block: 0/1 
 			ExceptionUtils.tryClose(is);
 148 
 		}
 149 
 		
 150 Block: 1/1 
 		return result;
 151 
 	}
 152 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/http/package-frame.html b/report/net/jaekl/qd/http/package-frame.html deleted file mode 100644 index 2f2027c..0000000 --- a/report/net/jaekl/qd/http/package-frame.html +++ /dev/null @@ -1,18 +0,0 @@ - - -coverage report - - - -net.jaekl.qd.http   83% (5/6)
-

-All classes - - - - -
-RequestBroker  83% (5/6)
-
- - diff --git a/report/net/jaekl/qd/http/package-summary.html b/report/net/jaekl/qd/http/package-summary.html deleted file mode 100644 index 5eae753..0000000 --- a/report/net/jaekl/qd/http/package-summary.html +++ /dev/null @@ -1,48 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.qd.http1
83%(5/6)
50%(14/28)
40%(4/10)
53%(31/58)
-

-Classes
- - - - - - - - - - - - - - - -
Name%method%block%branch%line
RequestBroker 83% (5/6) 50% (14/28) 40% (4/10) 53% (31/58)
-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/package-frame.html b/report/net/jaekl/qd/package-frame.html deleted file mode 100644 index d236694..0000000 --- a/report/net/jaekl/qd/package-frame.html +++ /dev/null @@ -1,19 +0,0 @@ - - -coverage report - - - -net.jaekl.qd   100% (5/5)
-

-All classes - - - - -
-QDBundleFactory  100% (3/3)
-QDException  100% (2/2)
-
- - diff --git a/report/net/jaekl/qd/package-summary.html b/report/net/jaekl/qd/package-summary.html deleted file mode 100644 index e83749d..0000000 --- a/report/net/jaekl/qd/package-summary.html +++ /dev/null @@ -1,115 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.qd2
100%(5/5)
90%(9/10)
75%(3/4)
100%(15/15)
-

-Packages
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name#classes%class%method%block%branch%line
net.jaekl.qd.http1 100% (1/1) 83% (5/6) 50% (14/28) 40% (4/10) 53% (31/58)
net.jaekl.qd.util3 100% (3/3) 57% (4/7) 88% (21/24) 100% (14/14) 86% (19/22)
net.jaekl.qd.xml5 80% (4/5) 74% (23/31) 80% (74/93) 82% (41/50) 83% (114/137)
-

-Classes
- - - - - - - - - - - - - - - - - - - - - - -
Name%method%block%branch%line
QDBundleFactory 100% (3/3) 88% (7/8) 75% (3/4) 100% (11/11)
QDException 100% (2/2) 100% (2/2) - 100% (4/4)
-

-Total (including subpackages)
- - - - - - - - - - - - - - - - -
-#classes%method%block%branch%line
11 76% (37/49) 76% (118/155) 79% (62/78) 77% (179/232)
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/util/ExceptionUtils.html b/report/net/jaekl/qd/util/ExceptionUtils.html deleted file mode 100644 index 54f408a..0000000 --- a/report/net/jaekl/qd/util/ExceptionUtils.html +++ /dev/null @@ -1,201 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.util.ExceptionUtils
50%(1/2)
83%(5/6)
100%(2/2)
86%(6/7)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
0<init>[public]void <init>()
8tryClose[public, static]void tryClose(java.io.Closeable)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.qd.util;
 2 
 
 3 
 import java.io.Closeable;
 4 
 import java.io.IOException;
 5 
 
 6 
 import net.jaekl.qd.QDException;
 7 
 
 8 Block: 0/1 
 public class ExceptionUtils {
 9 
 	public static void tryClose(Closeable closeable) throws QDException {
 10 
 		try {
 11 Block: 1/1 
 			if (null != closeable) {
 12 Block: 1/1 Branch: 1/1 
 				closeable.close();
 13 
 			}
 14 
 		}
 15 Block: 1/1 
 		catch (IOException ioe) {
 16 
 			throw new QDException(ioe);
 17 Block: 1/1 Branch: 1/1 
 		}
 18 Block: 1/1 
 	}
 19 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/util/ParseUtils.html b/report/net/jaekl/qd/util/ParseUtils.html deleted file mode 100644 index 557169e..0000000 --- a/report/net/jaekl/qd/util/ParseUtils.html +++ /dev/null @@ -1,262 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.util.ParseUtils
67%(2/3)
91%(10/11)
100%(8/8)
91%(10/11)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
0<init>[public]void <init>()
44parseDouble[public, static]double parseDouble(java.lang.String)
17parseInt[public, static]int parseInt(java.lang.String)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.qd.util;
 2 
 
 3 Block: 0/1 
 public class ParseUtils {
 4 
 	// Attempt to parse the string as a double.
 5 
 	// Treat errors as a zero value.
 6 
 	public static double parseDouble(String string) {
 7 Block: 1/1 
 		if ((null == string) || ("".equals(string))) {
 8 Block: 1/1 Branch: 2/2 
 			return 0.0;
 9 
 		}
 10 
 		try {
 11 Block: 1/1 Branch: 1/1 
 			return Double.parseDouble(string);
 12 
 		}
 13 Block: 1/1 
 		catch (NumberFormatException exc) {
 14 
 			return 0.0;
 15 
 		}
 16 
 	}
 17 
 	
 18 
 	public static int parseInt(String string) {
 19 Block: 1/1 
 		if ((null == string) || ("".equals(string))) {
 20 Block: 1/1 Branch: 2/2 
 			return 0;
 21 
 		}
 22 
 		try {
 23 Block: 1/1 Branch: 1/1 
 			return Integer.parseInt(string);
 24 
 		}
 25 Block: 1/1 
 		catch (NumberFormatException exc) {
 26 
 			return 0;
 27 
 		}
 28 
 		
 29 
 	}
 30 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/util/StringUtils.html b/report/net/jaekl/qd/util/StringUtils.html deleted file mode 100644 index 57edcc4..0000000 --- a/report/net/jaekl/qd/util/StringUtils.html +++ /dev/null @@ -1,156 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.util.StringUtils
50%(1/2)
86%(6/7)
100%(4/4)
75%(3/4)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
0<init>[public]void <init>()
18areEqual[public, static]boolean areEqual(java.lang.String,java.lang.String)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.qd.util;
 2 
 
 3 Block: 0/1 
 public class StringUtils {
 4 
 	public static boolean areEqual(String a, String b) {
 5 Block: 1/1 
 		if (null == a) {
 6 Block: 1/1 Branch: 1/1 
 			return (null == b);
 7 
 		}
 8 Block: 1/1 Branch: 1/1 
 		return a.equals(b);
 9 
 	}
 10 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/util/package-frame.html b/report/net/jaekl/qd/util/package-frame.html deleted file mode 100644 index 106ba8d..0000000 --- a/report/net/jaekl/qd/util/package-frame.html +++ /dev/null @@ -1,20 +0,0 @@ - - -coverage report - - - -net.jaekl.qd.util   57% (4/7)
-

-All classes - - - - -
-ExceptionUtils  50% (1/2)
-ParseUtils  67% (2/3)
-StringUtils  50% (1/2)
-
- - diff --git a/report/net/jaekl/qd/util/package-summary.html b/report/net/jaekl/qd/util/package-summary.html deleted file mode 100644 index 8203e3f..0000000 --- a/report/net/jaekl/qd/util/package-summary.html +++ /dev/null @@ -1,62 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.qd.util3
57%(4/7)
88%(21/24)
100%(14/14)
86%(19/22)
-

-Classes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name%method%block%branch%line
ExceptionUtils 50% (1/2) 83% (5/6) 100% (2/2) 86% (6/7)
ParseUtils 67% (2/3) 91% (10/11) 100% (8/8) 91% (10/11)
StringUtils 50% (1/2) 86% (6/7) 100% (4/4) 75% (3/4)
-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/MismatchedTagsException.html b/report/net/jaekl/qd/xml/MismatchedTagsException.html deleted file mode 100644 index 7a540c2..0000000 --- a/report/net/jaekl/qd/xml/MismatchedTagsException.html +++ /dev/null @@ -1,217 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.xml.MismatchedTagsException
0%(0/3)
0%(0/3)
-%
0%(0/6)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
0<init>[public]void <init>(java.lang.String,java.lang.String)
0getActual[public]java.lang.String getActual()
0getExpected[public]java.lang.String getExpected()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 package net.jaekl.qd.xml;
 4 
 
 5 
 
 6 
 public class MismatchedTagsException extends XmlParseException
 7 
 {
 8 
 	private static final long serialVersionUID = 1L;
 9 
 
 10 
 	String m_expected;
 11 
 	String m_actual;
 12 
 
 13 
 	public MismatchedTagsException(String expected, String actual) {
 14 Block: 0/1 
 		super();
 15 
 		m_expected = expected;
 16 
 		m_actual = actual;
 17 
 	}
 18 
 
 19 Block: 0/1 
 	public String getExpected() { return m_expected; }
 20 Block: 0/1 
 	public String getActual() { return m_actual; }
 21 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/MissingInfoException.html b/report/net/jaekl/qd/xml/MissingInfoException.html deleted file mode 100644 index bdfb71a..0000000 --- a/report/net/jaekl/qd/xml/MissingInfoException.html +++ /dev/null @@ -1,359 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.xml.MissingInfoException
100%(5/5)
100%(11/11)
100%(4/4)
100%(19/19)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
3<init>[public]void <init>(java.lang.String)
2addMissingAttribute[public]void addMissingAttribute(java.lang.String)
2addMissingChild[public]void addMissingChild(java.lang.String)
3getMessage[public]java.lang.String getMessage()
4getTagName[public]java.lang.String getTagName()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 package net.jaekl.qd.xml;
 4 
 
 5 
 import java.util.ArrayList;
 6 
 
 7 
 public class MissingInfoException extends XmlParseException
 8 
 {
 9 
 	private static final long serialVersionUID = 1L;
 10 
 
 11 
 	String m_tagName;
 12 
 	ArrayList<String> m_missingAttributes;
 13 
 	ArrayList<String> m_missingChildTags;
 14 
 
 15 
 	public MissingInfoException(String tagName) {
 16 Block: 1/1 
 		super();
 17 
 		m_tagName = tagName;
 18 
 		m_missingAttributes = new ArrayList<String>();
 19 
 		m_missingChildTags = new ArrayList<String>();
 20 
 	}
 21 
 
 22 
 	public void addMissingAttribute(String name) {
 23 Block: 1/1 
 		m_missingAttributes.add(name);
 24 
 	}
 25 
 
 26 
 	public void addMissingChild(String name) {
 27 Block: 1/1 
 		m_missingChildTags.add(name);
 28 
 	}
 29 
 
 30 Block: 1/1 
 	public String getTagName() { return m_tagName; }
 31 
 	
 32 
 	@Override
 33 
 	public String getMessage() {
 34 Block: 1/1 
 		StringBuilder sb = new StringBuilder();
 35 
 		
 36 
 		sb.append("Tag:  \"" + getTagName() + "\"");
 37 
 		
 38 
 		for (String attr : m_missingAttributes) {
 39 Block: 1/1 Branch: 1/1 
 			sb.append("\n  Attribute:  \"" + attr + "\"");
 40 
 		}
 41 
 		
 42 Block: 1/1 Branch: 1/1 
 		for (String child : m_missingChildTags) {
 43 Block: 1/1 Branch: 1/1 
 			sb.append("\n  Child tag:  \"" + child + "\"");
 44 
 		}
 45 Block: 1/1 Branch: 1/1 
 		return sb.toString();
 46 
 	}
 47 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/ParseHandler.html b/report/net/jaekl/qd/xml/ParseHandler.html deleted file mode 100644 index f104550..0000000 --- a/report/net/jaekl/qd/xml/ParseHandler.html +++ /dev/null @@ -1,781 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.xml.ParseHandler
75%(9/12)
80%(24/30)
100%(12/12)
79%(33/42)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
12<init>[public]void <init>(net.jaekl.qd.xml.ParseResult)
204characters[public]void characters(char[],int,int)
12endDocument[public]void endDocument()
235endElement[public]void endElement(java.lang.String,java.lang.String,java.lang.String)
48endPrefixMapping[public]void endPrefixMapping(java.lang.String)
0ignorableWhitespace[public]void ignorableWhitespace(char[],int,int)
0processingInstruction[public]void processingInstruction(java.lang.String,java.lang.String)
12setDocumentLocator[public]void setDocumentLocator(org.xml.sax.Locator)
0skippedEntity[public]void skippedEntity(java.lang.String)
12startDocument[public]void startDocument()
235startElement[public]void startElement(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.Attributes)
48startPrefixMapping[public]void startPrefixMapping(java.lang.String,java.lang.String)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 package net.jaekl.qd.xml;
 4 
 
 5 
 import java.util.Stack;
 6 
 
 7 
 import org.xml.sax.Attributes;
 8 
 import org.xml.sax.ContentHandler;
 9 
 import org.xml.sax.Locator;
 10 
 import org.xml.sax.SAXException;
 11 
 
 12 
 public class ParseHandler implements ContentHandler
 13 
 {
 14 
 	Stack<ParseResult> m_stack;
 15 
 
 16 Block: 1/1 
 	public ParseHandler(ParseResult root) {
 17 
 		m_stack = new Stack<ParseResult>();
 18 
 		m_stack.push(root);
 19 
 	}
 20 
 
 21 
 	@Override 
 22 
 	public void characters(char[] ch, int start, int length) throws SAXException
 23 
 	{
 24 Block: 1/1 
 		if (m_stack.isEmpty()) {
 25 Block: 1/1 Branch: 1/1 
 			return;
 26 
 		}
 27 
 		
 28 
 		try {
 29 Block: 1/1 Branch: 1/1 
 			m_stack.peek().characters(ch, start, length);
 30 
 		}
 31 Block: 0/1 
 		catch (XmlParseException xpe) {
 32 
 			throw new SAXException(xpe);
 33 
 		}
 34 Block: 1/1 
 	}
 35 
 
 36 
 	@Override 
 37 
 	public void endElement(String uri, String localName, String qName) throws SAXException
 38 
 	{
 39 
 		try {
 40 Block: 1/1 
 			if (m_stack.isEmpty()) {
 41 Block: 1/1 Branch: 1/1 
 				return;
 42 
 			}
 43 
 			
 44 Block: 1/1 Branch: 1/1 
 			boolean pop = m_stack.peek().endElement(uri, localName, qName);
 45 
 			if (pop) {
 46 Block: 1/1 Branch: 1/1 
 				m_stack.pop();
 47 
 
 48 
 				if (m_stack.isEmpty()) {
 49 Block: 1/1 Branch: 1/1 
 					return;
 50 
 				}
 51 
 				
 52 Block: 1/1 Branch: 1/1 
 				m_stack.peek().endExternal(uri, localName, qName);
 53 
 			}
 54 
 		}
 55 Block: 0/1 
 		catch (XmlParseException xpe) {
 56 
 			throw new SAXException(xpe);
 57 Block: 1/1 Branch: 1/1 
 		}
 58 Block: 1/1 
 	}
 59 
 
 60 
 	@Override
 61 
 	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
 62 
 	{
 63 
 		try {
 64 Block: 1/1 
 			ParseResult current = m_stack.peek();
 65 
 			ParseResult next = current.startElement(uri, localName, qName, attributes);
 66 
 			if (next != current) {
 67 Block: 1/1 Branch: 1/1 
 				m_stack.push(next);
 68 
 			}
 69 
 		}
 70 Block: 0/1 
 		catch (XmlParseException xpe) {
 71 
 			throw new SAXException(xpe);
 72 Block: 1/1 Branch: 1/1 
 		}
 73 Block: 1/1 
 	}
 74 
 
 75 
 	@Override
 76 
 	public void endDocument() throws SAXException {
 77 Block: 1/1 
 		if (! m_stack.isEmpty()) {
 78 Block: 1/1 Branch: 1/1 
 			String missingTag = m_stack.peek().getTagName();
 79 
 			throw new SAXException(new MissingInfoException(missingTag));
 80 
 		}
 81 Block: 1/1 Branch: 1/1 
 	}
 82 
 
 83 
 	@Override
 84 
 	public void endPrefixMapping(String prefix) throws SAXException {
 85 
 		// no-op
 86 Block: 1/1 
 	}
 87 
 
 88 
 	@Override
 89 
 	public void ignorableWhitespace(char[] ch, int start, int length)
 90 
 	throws SAXException 
 91 
 	{
 92 
 		// no-op
 93 Block: 0/1 
 	}
 94 
 
 95 
 	@Override
 96 
 	public void processingInstruction(String target, String data)
 97 
 	throws SAXException 
 98 
 	{
 99 
 		// no-op
 100 Block: 0/1 
 	}
 101 
 
 102 
 	@Override
 103 
 	public void setDocumentLocator(Locator locator) {
 104 
 		// no-op
 105 Block: 1/1 
 	}
 106 
 
 107 
 	@Override
 108 
 	public void skippedEntity(String name) throws SAXException {
 109 
 		// no-op
 110 Block: 0/1 
 	}
 111 
 
 112 
 	@Override
 113 
 	public void startDocument() throws SAXException {
 114 
 		// no-op
 115 Block: 1/1 
 	}
 116 
 
 117 
 	@Override
 118 
 	public void startPrefixMapping(String prefix, String uri)
 119 
 	throws SAXException 
 120 
 	{
 121 
 		// no-op
 122 Block: 1/1 
 	}
 123 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/ParseResult.html b/report/net/jaekl/qd/xml/ParseResult.html deleted file mode 100644 index c96b93a..0000000 --- a/report/net/jaekl/qd/xml/ParseResult.html +++ /dev/null @@ -1,978 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.xml.ParseResult
89%(8/9)
81%(38/47)
74%(25/34)
91%(60/66)
-

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
1<clinit>[static]void <clinit>()
45<init>[public]void <init>(java.lang.String,java.lang.String[],java.lang.Object[][])
195characters[public]void characters(char[],int,int)
20collectParsedChildren[protected]net.jaekl.qd.xml.ParseResult[] collectParsedChildren(java.lang.Class)
216endElement[public]boolean endElement(java.lang.String,java.lang.String,java.lang.String)
1getTagName[public]java.lang.String getTagName()
0haveSeenMyTag[public]boolean haveSeenMyTag()
255startElement[public]net.jaekl.qd.xml.ParseResult startElement(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.Attributes)
31validate[public]void validate()
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 // Copyright (C) 2004, 2014 Christian Jaekl
 2 
 
 3 
 // Abstract class representing the result of parsing an XML Element.
 4 
 // A class derived from this one will know how to parse a subtree inside an XML file, and 
 5 
 // will contain the result of that parse within itself when the parse has completed.
 6 
 //
 7 
 // Note that this code will need to be augmented and fixed if XML namespace support is desired.
 8 
 
 9 
 package net.jaekl.qd.xml;
 10 
 
 11 
 import java.util.ArrayList;
 12 
 import java.util.HashMap;
 13 
 import java.util.HashSet;
 14 
 import java.util.Iterator;
 15 
 import java.util.Stack;
 16 
 
 17 
 import org.xml.sax.Attributes;
 18 
 
 19 Block: 1/1 
 public abstract class ParseResult
 20 
 {
 21 
 	Stack<String> m_current;									// Name of the element that we're currently inside
 22 
 	StringBuilder m_chars;										// character content of m_current.peek()
 23 
 	ArrayList<ParseResult> m_childParsers;						// Set of all child parsers
 24 
 	boolean m_haveSeenMyTag;									// Have I encountered my own (root) tag yet?
 25 
 
 26 
 	String m_tagName;											// Name of the (root) element tag that I'm parsing
 27 
 	HashSet<String> m_internal;									// Tags that we will store as members of this class instance
 28 
 	HashMap<String,Class<? extends ParseResult>> m_external;	// Tags that we will store as child ParseResult-derived objects
 29 
 
 30 
 	@SuppressWarnings("unchecked")
 31 
 	public ParseResult(String tagName, String[] internalMemberTags, Object[][] externalParserTags)
 32 Block: 1/1 
 	{
 33 
 		m_current = new Stack<String>();
 34 
 		m_chars = new StringBuilder();
 35 
 		m_childParsers = new ArrayList<ParseResult>();
 36 
 		m_haveSeenMyTag = false;
 37 
 		
 38 
 		m_tagName = tagName;
 39 
 		m_internal = new HashSet<String>();
 40 
 		m_external = new HashMap<String, Class<? extends ParseResult>>();
 41 
 
 42 
 		for (String internalTag : internalMemberTags) {
 43 Block: 1/1 Branch: 1/1 
 			m_internal.add(internalTag);
 44 
 		}
 45 
 
 46 Block: 1/1 Branch: 1/1 
 		for (int idx = 0; idx < externalParserTags.length; ++idx) {
 47 Block: 1/1 Branch: 1/1 
 			String externalTag = (String)externalParserTags[idx][0];
 48 
 			Class<? extends ParseResult>  parserClass = (Class<? extends ParseResult>)externalParserTags[idx][1];
 49 
 			m_external.put(externalTag, parserClass);
 50 
 		}
 51 Block: 1/1 Branch: 1/1 
 	}
 52 
 
 53 
 	public abstract void endContents(String uri, String localName, String qName, String chars) throws XmlParseException;
 54 
 	public abstract void endExternal(String uri, String localName, String qName) throws XmlParseException;
 55 
 	
 56 Block: 1/1 
 	public String getTagName() { return m_tagName; }
 57 Block: 0/1 
 	public boolean haveSeenMyTag() { return m_haveSeenMyTag; }
 58 
 
 59 
 	public void characters(char[] ch, int start, int length) throws XmlParseException
 60 
 	{
 61 Block: 1/1 
 		m_chars.append(ch, start, length);
 62 
 	}
 63 
 	
 64 
 	protected ParseResult[] collectParsedChildren(Class<? extends ParseResult> cls) {
 65 Block: 1/1 
 		ArrayList<ParseResult> collection = new ArrayList<ParseResult>();
 66 
 		Iterator<ParseResult> iter = m_childParsers.iterator();
 67 Block: 1/1 
 		while (iter.hasNext()) {
 68 Block: 1/1 Branch: 1/1 
 			ParseResult pr = iter.next();
 69 
 			if (pr.getClass().isAssignableFrom(cls)) {
 70 Block: 1/1 Branch: 1/1 
 				collection.add(pr);
 71 
 				iter.remove();
 72 
 			}
 73 Block: 1/1 Branch: 0/1 
 		}
 74 
 		
 75 Block: 1/1 Branch: 1/1 
 		ParseResult[] result = new ParseResult[collection.size()];
 76 
 		return collection.toArray(result);
 77 
 	}
 78 
 
 79 
 	// returns true if this ParseResult's context has ended with this endElement() call
 80 
 	public boolean endElement(String uri, String localName, String qName) throws XmlParseException
 81 
 	{
 82 Block: 1/1 
 		assert (null != localName);
 83 
 		
 84 Block: 1/1 Branch: 1/2 
 		boolean isInternal = m_internal.contains(localName);
 85 
 
 86 
 		if (! m_haveSeenMyTag) {
 87 
 			// We're in some unrecognised prologue.  Ignore it and move on.
 88 Block: 1/1 Branch: 1/1 
 			return false;
 89 
 		}
 90 
 		
 91 Block: 1/1 Branch: 1/1 
 		if (m_tagName.equals(localName)) {
 92 Block: 1/1 Branch: 1/1 
 			validate();
 93 
 			return true;
 94 
 		}
 95 
 		
 96 Block: 1/1 Branch: 1/1 
 		if (!isInternal) {
 97 
 			// Unrecognized tag.  Ignore it.
 98 Block: 1/1 Branch: 1/1 
 			return false;
 99 
 		}
 100 
 		
 101 Block: 1/1 Branch: 1/1 
 		String tag = m_current.pop();
 102 
 		if ( ! tag.equals(localName) ) {
 103 Block: 0/1 Branch: 0/1 
 			throw new MismatchedTagsException(tag, localName);
 104 
 		}
 105 
 		
 106 Block: 1/1 Branch: 1/1 
 		String chars = m_chars.toString();
 107 
 		endContents(uri, localName, qName, chars);
 108 
 		
 109 
 		return false;
 110 
 	}
 111 
 	
 112 
 	// returns either itself, or a new ParseResult-derived object, whichever should handle parsing the inside of this element
 113 
 	public ParseResult startElement(String uri, String localName, String qName, Attributes attributes) 
 114 
 			throws XmlParseException
 115 
 	{
 116 Block: 1/1 
 		assert (null != localName);
 117 
 
 118 Block: 1/1 Branch: 1/2 
 		m_chars.setLength(0);
 119 
 		
 120 
 		if (! m_haveSeenMyTag) {
 121 
 			// Have we opened our own (root) tag yet?
 122 
 			
 123 Block: 1/1 Branch: 1/1 
 			if (m_tagName.equals(localName)) {
 124 Block: 1/1 Branch: 1/1 
 				m_haveSeenMyTag = true;
 125 
 				return this;
 126 
 			}
 127 
 			else {
 128 
 				// One of two things has happened here.
 129 
 				// Either (a) we've got some sort of wrapper here, and have not yet reach our own tag, 
 130 
 				//     or (b) we're parsing XML that doesn't match expectations.
 131 
 				// In either case, we're going to ignore this tag, and scan forward looking for our own root.
 132 Block: 1/1 Branch: 1/1 
 				return this;
 133 
 			}
 134 
 		}
 135 
 
 136 Block: 1/1 Branch: 1/1 
 		if (m_internal.contains(localName)) {
 137 Block: 1/1 Branch: 1/1 
 			m_current.push(localName);
 138 
 			return this;
 139 
 		}
 140 
 
 141 Block: 1/1 Branch: 1/1 
 		Class<? extends ParseResult> parserClass = m_external.get(localName);
 142 
 		if (null != parserClass) {
 143 
 			try {
 144 Block: 1/1 Branch: 1/1 
 				ParseResult childParser = (ParseResult) parserClass.newInstance();
 145 
 				m_childParsers.add(childParser);
 146 
 				return childParser.startElement(uri, localName, qName, attributes);
 147 
 			}
 148 Block: 0/1 
 			catch (IllegalAccessException iae) {
 149 
 				throw new XmlParseException(iae);
 150 
 			}
 151 Block: 0/1 
 			catch (InstantiationException ie) {
 152 
 				throw new XmlParseException(ie);
 153 
 			}
 154 
 		}
 155 
 		
 156 
 		// Not a recognized tag.  Ignore it, rather than complaining. 
 157 Block: 1/1 Branch: 1/1 
 		return this;
 158 
 	}
 159 
 	
 160 
 	public void validate() throws XmlParseException
 161 
 	{
 162 
 		// Default implementation is a no-op.
 163 
 		// Override if you want to validate on endElement()
 164 Block: 1/1 
 	}
 165 
 }
 166 
 
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/XmlParseException.html b/report/net/jaekl/qd/xml/XmlParseException.html deleted file mode 100644 index 94ba0aa..0000000 --- a/report/net/jaekl/qd/xml/XmlParseException.html +++ /dev/null @@ -1,191 +0,0 @@ - - -tests coverage - - - - - - - - - -
-Frames -No Frames -
-

- - - - - - - - - - - - - - - -
 %method%block%branch%line
net.jaekl.qd.xml.XmlParseException
50%(1/2)
50%(1/2)
-%
50%(2/4)
-

-

- - - - - - - - - - - - - - - - - - - -
hit countmethod namemethod modifiersmethod signature
3<init>[public]void <init>()
0<init>[public]void <init>(java.lang.Throwable)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 1 
 package net.jaekl.qd.xml;
 2 
 
 3 
 import net.jaekl.qd.QDException;
 4 
 
 5 
 public class XmlParseException extends QDException 
 6 
 {
 7 
 	private static final long serialVersionUID = 1L;
 8 
 
 9 Block: 1/1 
 	public XmlParseException() {
 10 
 		// no-op
 11 
 	}
 12 
 	
 13 
 	public XmlParseException(Throwable t) {
 14 Block: 0/1 
 		super(t);
 15 
 	}
 16 
 
 17 
 }
-

-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/net/jaekl/qd/xml/package-frame.html b/report/net/jaekl/qd/xml/package-frame.html deleted file mode 100644 index b2f92f2..0000000 --- a/report/net/jaekl/qd/xml/package-frame.html +++ /dev/null @@ -1,22 +0,0 @@ - - -coverage report - - - -net.jaekl.qd.xml   74% (23/31)
-

-All classes - - - - -
-MismatchedTagsException  0% (0/3)
-MissingInfoException  100% (5/5)
-ParseHandler  75% (9/12)
-ParseResult  89% (8/9)
-XmlParseException  50% (1/2)
-
- - diff --git a/report/net/jaekl/qd/xml/package-summary.html b/report/net/jaekl/qd/xml/package-summary.html deleted file mode 100644 index 492a571..0000000 --- a/report/net/jaekl/qd/xml/package-summary.html +++ /dev/null @@ -1,76 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
net.jaekl.qd.xml5
74%(23/31)
80%(74/93)
82%(41/50)
83%(114/137)
-

-Classes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name%method%block%branch%line
MismatchedTagsException 0% (0/3) 0% (0/3) - 0% (0/6)
MissingInfoException 100% (5/5) 100% (11/11) 100% (4/4) 100% (19/19)
ParseHandler 75% (9/12) 80% (24/30) 100% (12/12) 79% (33/42)
ParseResult 89% (8/9) 81% (38/47) 74% (25/34) 91% (60/66)
XmlParseException 50% (1/2) 50% (1/2) - 50% (2/4)
-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/overview-frame.html b/report/overview-frame.html deleted file mode 100644 index 3c499f1..0000000 --- a/report/overview-frame.html +++ /dev/null @@ -1,33 +0,0 @@ - - -coverage report - - - -Coverage report
- - - - -
-Overview
-All classes -
-

- - - - - - - -
All packages
-net.jaekl.frank
-net.jaekl.frank.octranspo
-net.jaekl.qd
-net.jaekl.qd.http
-net.jaekl.qd.util
-net.jaekl.qd.xml
-
- - diff --git a/report/overview-summary.html b/report/overview-summary.html deleted file mode 100644 index b3792ff..0000000 --- a/report/overview-summary.html +++ /dev/null @@ -1,90 +0,0 @@ - - -coverage report - - - - -Coverage report -

- - - - - - - - - - - - - - - - - -
 #classes%method%block%branch%line
Overall statistics21
86%(95/111)
77%(253/329)
72%(127/176)
82%(443/539)
-

-Packages
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name#classes%method%block%branch%line
net.jaekl.frank4 83% (15/18) 64% (38/59) 57% (16/28) 77% (114/148)
net.jaekl.frank.octranspo6 98% (43/44) 84% (97/115) 70% (49/70) 94% (150/159)
net.jaekl.qd2 100% (5/5) 90% (9/10) 75% (3/4) 100% (15/15)
net.jaekl.qd.http1 83% (5/6) 50% (14/28) 40% (4/10) 53% (31/58)
net.jaekl.qd.util3 57% (4/7) 88% (21/24) 100% (14/14) 86% (19/22)
net.jaekl.qd.xml5 74% (23/31) 80% (74/93) 82% (41/50) 83% (114/137)
-

Report generated 11/12/14 11:31 PM
- - diff --git a/report/sorttable.js b/report/sorttable.js deleted file mode 100644 index 6d2bf5f..0000000 --- a/report/sorttable.js +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -addEvent(window, "load", sortables_init); - -var SORT_COLUMN_INDEX; - -function sortables_init() { - // Find all tables with class sortable and make them sortable - if (!document.getElementsByTagName) return; - tbls = document.getElementsByTagName("table"); - for (ti=0;ti 0) { - var firstRow = table.rows[0]; - } - if (!firstRow) return; - - // We have a first row: assume it's the header, and make its contents clickable links - for (var i=0;i' + - txt+'   '; - } -} - -function ts_getInnerText(el) { - if (typeof el == "string") return el; - if (typeof el == "undefined") { return el }; - if (el.innerText) return el.innerText; //Not needed but it is faster - var str = ""; - - var cs = el.childNodes; - var l = cs.length; - for (var i = 0; i < l; i++) { - switch (cs[i].nodeType) { - case 1: //ELEMENT_NODE - str += ts_getInnerText(cs[i]); - break; - case 3: //TEXT_NODE - str += cs[i].nodeValue; - break; - } - } - return str; -} - -function ts_resortTable(lnk,clid) { - // get the span - var span; - for (var ci=0;ci