Upgrade to Debian Jessie and JDK 7.
authorChris Jaekl <chris@ringo.jaekl.net>
Sat, 22 Aug 2015 03:24:06 +0000 (12:24 +0900)
committerChris Jaekl <chris@ringo.jaekl.net>
Sat, 22 Aug 2015 03:24:06 +0000 (12:24 +0900)
15 files changed:
WEB-INF/web.xml
go.sh
test/net/jaekl/frank/ForceUtf8EncodingFilterTest.java
test/net/jaekl/frank/ScheduleTest.java
test/net/jaekl/frank/ServletRequestMock.java
test/net/jaekl/frank/StyleTest.java
test/net/jaekl/frank/octranspo/ServerTest.java
test/net/jaekl/qd/http/HttpServletRequestMock.java
test/net/jaekl/qd/http/RequestBrokerTest.java
test/net/jaekl/qd/util/ExceptionUtilsTest.java
test/net/jaekl/qd/util/InputStreamWrapperTest.java
test/net/jaekl/qd/util/ParseUtilsTest.java
test/net/jaekl/qd/util/StringUtilsTest.java
test/net/jaekl/qd/xml/MissingInfoExceptionTest.java
test/net/jaekl/qd/xml/ParseResultTest.java

index e07bdc1..837bfb4 100644 (file)
            <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>
diff --git a/go.sh b/go.sh
index 43eefcd..b853754 100755 (executable)
--- a/go.sh
+++ b/go.sh
@@ -5,4 +5,4 @@ find "${WEB_ROOT}/prod" -name "*.java" | xargs javac -classpath ${WEB_ROOT}/prod
 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}"
index 602b35f..9a34be0 100644 (file)
@@ -6,7 +6,7 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 
index 7f30680..6c81937 100644 (file)
@@ -6,7 +6,7 @@ import java.io.PrintWriter;
 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;
index 5458d8a..65bf383 100644 (file)
@@ -7,9 +7,13 @@ 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.ServletInputStream;
 import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 
 public class ServletRequestMock implements ServletRequest {
        String m_encodingName;
@@ -25,7 +29,7 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @Override
-       public Enumeration<?> getAttributeNames() {
+       public Enumeration<String> getAttributeNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -78,7 +82,7 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @Override
-       public Enumeration<?> getLocales() {
+       public Enumeration<Locale> getLocales() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -90,13 +94,13 @@ public class ServletRequestMock implements ServletRequest {
        }
 
        @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;
        }
@@ -192,4 +196,46 @@ public class ServletRequestMock implements ServletRequest {
                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;
+       }
+
 }
index f08f649..53c9229 100644 (file)
@@ -4,9 +4,8 @@ import java.io.ByteArrayOutputStream;
 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;
 
index ef90944..1062567 100644 (file)
@@ -7,7 +7,7 @@ import java.text.SimpleDateFormat;
 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;
@@ -17,6 +17,7 @@ import org.apache.http.message.BasicNameValuePair;
 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" 
@@ -221,24 +222,24 @@ public class ServerTest {
                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
@@ -275,24 +276,24 @@ public class ServerTest {
                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);
        }
 
 }
index 456bc82..2c65c8e 100644 (file)
@@ -4,15 +4,24 @@ import java.io.BufferedReader;
 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;
@@ -28,7 +37,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getAttributeNames() {
+       public Enumeration<String> getAttributeNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -82,7 +91,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getLocales() {
+       public Enumeration<Locale> getLocales() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -102,7 +111,7 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @Override
-       public Enumeration<?> getParameterNames() {
+       public Enumeration<String> getParameterNames() {
                // TODO Auto-generated method stub
                return null;
        }
@@ -230,13 +239,13 @@ public class HttpServletRequestMock implements HttpServletRequest {
        }
 
        @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;
        }
@@ -350,4 +359,79 @@ public class HttpServletRequestMock implements HttpServletRequest {
                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
+               
+       }
+
 }
index 307fe90..b287348 100644 (file)
@@ -2,7 +2,7 @@ package net.jaekl.qd.http;
 
 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;
index c1361ba..b0a3e3e 100644 (file)
@@ -5,7 +5,7 @@ package net.jaekl.qd.util;
 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;
index 9db2252..d399ce5 100644 (file)
@@ -6,8 +6,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.nio.charset.Charset;
 
-import junit.framework.Assert;
-
+import org.junit.Assert;
 import org.junit.Test;
 
 public class InputStreamWrapperTest {
index 0f8d33f..cd3eaf5 100644 (file)
@@ -1,10 +1,11 @@
 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() {
@@ -14,7 +15,7 @@ public class ParseUtilsTest {
                
                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);
                }
        }
 
index b57f657..0a0d078 100644 (file)
@@ -1,7 +1,6 @@
 package net.jaekl.qd.util;
 
-import junit.framework.Assert;
-
+import org.junit.Assert;
 import org.junit.Test;
 
 public class StringUtilsTest {
index 32b5ad8..8ce63bd 100644 (file)
@@ -1,6 +1,6 @@
 package net.jaekl.qd.xml;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import org.junit.Test;
 
index 040308d..41fd0ff 100644 (file)
@@ -6,7 +6,7 @@ import java.io.ByteArrayInputStream;
 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;