Improve error reporting. New error page that gives a bit more of an explanation...
[frank.git] / test / net / jaekl / frank / ScheduleTest.java
index 2fc9ac2a5f84f09bf189840648f0b3fb7df50ede..7f3068031af593085b2819f870a2fa6acefbfea7 100644 (file)
@@ -17,15 +17,8 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class ScheduleTest {
-       static final String EXPECTED_STYLE = "<STYLE>\n" + 
-                       "  body {background-color: #F0F0C0; font-size: 1.5em; }\n" + 
-                       "  #trips {border-collapse: collapse; font-size: 1.5em; }\n" + 
-                       "  #trips td, #trips th {border: 1px solid #600000; padding: 3px 3px 3px 3px; text-align: center;}\n" + 
-                       "  #trips th {background-color: #800000; color: #FFFFFF; }\n" + 
-                       "  #trips tr.ghost td {background-color: #C0C0C0;}\n" + 
-                       "</STYLE>\n";
        static final String TITLE_PREFIX = "<HTML>\n<HEAD>\n<TITLE>";
-       static final String TITLE_SUFFIX = "</TITLE>\n" + EXPECTED_STYLE + "</HEAD>\n";
+       static final String TITLE_SUFFIX = "</TITLE>\n" + Style.CSS + "\n</HEAD>\n";
        
        
        ByteArrayOutputStream m_baos;
@@ -44,25 +37,6 @@ public class ScheduleTest {
                }
        }
        
-       // Confirm that writeStyle's output does not vary with the locale
-       @Test
-       public void test_writeStyle() {
-               String actual;
-
-               Locale[] locales = { Locale.CANADA, Locale.CANADA_FRENCH, Locale.JAPAN };
-               
-               for (Locale locale : locales) {
-                       m_baos.reset();
-                       
-                       Schedule schedule = new Schedule(locale);
-                       schedule.writeStyle(m_pw);
-                       m_pw.flush();
-                       
-                       actual = m_baos.toString();
-                       Assert.assertEquals(EXPECTED_STYLE, actual);
-               }
-       }
-       
        @Test
        public void test_writeHeader() {
                Locale[] locales = { Locale.CANADA, Locale.CANADA_FRENCH, Locale.JAPAN };
@@ -102,7 +76,7 @@ public class ScheduleTest {
                
                String actual = m_baos.toString();
                
-               Assert.assertTrue(actual.contains(EXPECTED_STYLE));
+               Assert.assertTrue(actual.contains(Style.CSS));
                
                String expectedTitle = TITLE_PREFIX + "Frank: " + stopName + " (" + stopNo + ")" + TITLE_SUFFIX;
                Assert.assertTrue(actual.contains(expectedTitle));
@@ -178,7 +152,7 @@ public class ScheduleTest {
                
                // Some rudimentary validation of the result.
                // Should really go through more permutations, and examine them more closely, here.
-               Assert.assertTrue(actual.contains(EXPECTED_STYLE));
+               Assert.assertTrue(actual.contains(Style.CSS));
                
                String expectedTitle = TITLE_PREFIX + "Frank: " + stopName + " (" + stopNo + ")" + TITLE_SUFFIX;
                Assert.assertTrue(actual.contains(expectedTitle));