<url-pattern>/ViewSchedule</url-pattern>
</servlet-mapping>
- <filter-mapping>
- <filter-name>ForceUtf8Encoding</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
<filter>
<filter-name>ForceUtf8Encoding</filter-name>
<filter-class>net.jaekl.frank.ForceUtf8EncodingFilter</filter-class>
</filter>
+ <filter-mapping>
+ <filter-name>ForceUtf8Encoding</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<!--
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
cp -r ${WEB_ROOT}/prod/* ${WEB_ROOT}/WEB-INF/classes/
find "${WEB_ROOT}/prod" -name '*.class' -exec rm {} \;
echo Launching...
-java -jar /usr/share/java/jenkins-winstone.jar --httpPort=8002 "${WEB_ROOT}"
+java -Djsse.enableSNIExtension=false -jar /usr/share/java/jenkins-winstone.jar --httpPort=8002 "${WEB_ROOT}"
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
import java.util.Date;
import java.util.Locale;
-import junit.framework.Assert;
+import org.junit.Assert;
import net.jaekl.frank.octranspo.RouteMock;
import net.jaekl.frank.octranspo.RouteSummaryMock;
import java.util.Locale;
import java.util.Map;
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
public class ServletRequestMock implements ServletRequest {
String m_encodingName;
}
@Override
- public Enumeration<?> getAttributeNames() {
+ public Enumeration<String> getAttributeNames() {
// TODO Auto-generated method stub
return null;
}
}
@Override
- public Enumeration<?> getLocales() {
+ public Enumeration<Locale> getLocales() {
// TODO Auto-generated method stub
return null;
}
}
@Override
- public Map<?, ?> getParameterMap() {
+ public Map<String, String[]> getParameterMap() {
// TODO Auto-generated method stub
return null;
}
@Override
- public Enumeration<?> getParameterNames() {
+ public Enumeration<String> getParameterNames() {
// TODO Auto-generated method stub
return null;
}
m_encodingName = arg0;
}
+ @Override
+ public AsyncContext getAsyncContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public DispatcherType getDispatcherType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isAsyncStarted() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isAsyncSupported() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public AsyncContext startAsync() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
import java.io.IOException;
import java.io.PrintWriter;
-import junit.framework.Assert;
-
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Date;
-import junit.framework.Assert;
+import org.junit.Assert;
import net.jaekl.frank.FrankException;
import net.jaekl.qd.QDException;
import net.jaekl.qd.http.RequestBrokerMock;
import org.junit.Test;
public class ServerTest {
+ private static final double TINY_DELTA = 0.00000000001;
private static final String ROUTE_SUMMARY_FOR_STOP =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
expectedDate = hourMinFormat.parse("11:10");
Assert.assertEquals(expectedDate, trip.getStart());
Assert.assertEquals(20, trip.getAdjTime());
- Assert.assertEquals(0.18, trip.getAdjAge());
+ Assert.assertEquals(0.18, trip.getAdjAge(), TINY_DELTA);
Assert.assertEquals(false, trip.isLastTrip());
Assert.assertEquals("4LA - DEH", trip.getBusType());
- Assert.assertEquals(50.0, trip.getSpeed());
- Assert.assertEquals(45.352026, trip.getLatitude());
- Assert.assertEquals(-75.649993, trip.getLongitude());
+ Assert.assertEquals(50.0, trip.getSpeed(), TINY_DELTA);
+ Assert.assertEquals(45.352026, trip.getLatitude(), TINY_DELTA);
+ Assert.assertEquals(-75.649993, trip.getLongitude(), TINY_DELTA);
trip = route.getTrip(2);
Assert.assertEquals("Ottawa Rockcliffe", trip.getDest());
expectedDate = hourMinFormat.parse("12:00");
Assert.assertEquals(expectedDate, trip.getStart());
Assert.assertEquals(71, trip.getAdjTime());
- Assert.assertEquals(-1.0, trip.getAdjAge());
+ Assert.assertEquals(-1.0, trip.getAdjAge(), TINY_DELTA);
Assert.assertEquals(false, trip.isLastTrip());
Assert.assertEquals("4E - DEH", trip.getBusType());
- Assert.assertEquals(0.0, trip.getSpeed());
- Assert.assertEquals(0.0, trip.getLatitude());
- Assert.assertEquals(0.0, trip.getLongitude());
+ Assert.assertEquals(0.0, trip.getSpeed(), TINY_DELTA);
+ Assert.assertEquals(0.0, trip.getLatitude(), TINY_DELTA);
+ Assert.assertEquals(0.0, trip.getLongitude(), TINY_DELTA);
}
@Test
expectedDate = hourMinFormat.parse("11:40");
Assert.assertEquals(expectedDate, trip.getStart());
Assert.assertEquals(2, trip.getAdjTime());
- Assert.assertEquals(0.55, trip.getAdjAge());
+ Assert.assertEquals(0.55, trip.getAdjAge(), TINY_DELTA);
Assert.assertEquals(false, trip.isLastTrip());
Assert.assertEquals("4E - DEH", trip.getBusType());
- Assert.assertEquals(35.7, trip.getSpeed());
- Assert.assertEquals(45.392965, trip.getLatitude());
- Assert.assertEquals(-75.682561, trip.getLongitude());
+ Assert.assertEquals(35.7, trip.getSpeed(), TINY_DELTA);
+ Assert.assertEquals(45.392965, trip.getLatitude(), TINY_DELTA);
+ Assert.assertEquals(-75.682561, trip.getLongitude(), TINY_DELTA);
trip = route.getTrip(2);
Assert.assertEquals("Ottawa Rockcliffe", trip.getDest());
expectedDate = hourMinFormat.parse("12:20");
Assert.assertEquals(expectedDate, trip.getStart());
Assert.assertEquals(37, trip.getAdjTime());
- Assert.assertEquals(-1.0, trip.getAdjAge());
+ Assert.assertEquals(-1.0, trip.getAdjAge(), TINY_DELTA);
Assert.assertEquals(false, trip.isLastTrip());
Assert.assertEquals("4E - DEH", trip.getBusType());
- Assert.assertEquals(0.0, trip.getSpeed());
- Assert.assertEquals(0.0, trip.getLatitude());
- Assert.assertEquals(0.0, trip.getLongitude());
+ Assert.assertEquals(0.0, trip.getSpeed(), TINY_DELTA);
+ Assert.assertEquals(0.0, trip.getLatitude(), TINY_DELTA);
+ Assert.assertEquals(0.0, trip.getLongitude(), TINY_DELTA);
}
}
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import javax.servlet.http.Part;
public class HttpServletRequestMock implements HttpServletRequest {
Map<String, String[]> m_paramMap;
}
@Override
- public Enumeration<?> getAttributeNames() {
+ public Enumeration<String> getAttributeNames() {
// TODO Auto-generated method stub
return null;
}
}
@Override
- public Enumeration<?> getLocales() {
+ public Enumeration<Locale> getLocales() {
// TODO Auto-generated method stub
return null;
}
}
@Override
- public Enumeration<?> getParameterNames() {
+ public Enumeration<String> getParameterNames() {
// TODO Auto-generated method stub
return null;
}
}
@Override
- public Enumeration<?> getHeaderNames() {
+ public Enumeration<String> getHeaderNames() {
// TODO Auto-generated method stub
return null;
}
@Override
- public Enumeration<?> getHeaders(String arg0) {
+ public Enumeration<String> getHeaders(String arg0) {
// TODO Auto-generated method stub
return null;
}
return false;
}
+ @Override
+ public AsyncContext getAsyncContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public DispatcherType getDispatcherType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isAsyncStarted() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isAsyncSupported() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public AsyncContext startAsync() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean authenticate(HttpServletResponse arg0) throws IOException,
+ ServletException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Part getPart(String arg0) throws IOException, IllegalStateException,
+ ServletException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Collection<Part> getParts() throws IOException,
+ IllegalStateException, ServletException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void login(String arg0, String arg1) throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void logout() throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
}
import java.util.ArrayList;
-import junit.framework.Assert;
+import org.junit.Assert;
import net.jaekl.qd.QDException;
import net.jaekl.qd.xml.ParseResult;
import net.jaekl.qd.xml.XmlParseException;
import java.io.Closeable;
import java.io.IOException;
-import junit.framework.Assert;
+import org.junit.Assert;
import net.jaekl.qd.QDException;
import org.junit.Test;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.junit.Test;
public class InputStreamWrapperTest {
package net.jaekl.qd.util;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
public class ParseUtilsTest {
+ private final double TINY_DELTA = 0.0000000001;
@Test
public void testParseDouble() {
for (int i = 0; i < inputs.length; ++i) {
actual = ParseUtils.parseDouble(inputs[i]);
- Assert.assertEquals(expected[i], actual);
+ Assert.assertEquals(expected[i], actual, TINY_DELTA);
}
}
package net.jaekl.qd.util;
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.junit.Test;
public class StringUtilsTest {
package net.jaekl.qd.xml;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.junit.Test;
import org.xml.sax.InputSource;