Improve error reporting. New error page that gives a bit more of an explanation...
[frank.git] / test / net / jaekl / frank / StyleTest.java
1 package net.jaekl.frank;
2
3 import java.io.ByteArrayOutputStream;
4 import java.io.IOException;
5 import java.io.PrintWriter;
6
7 import junit.framework.Assert;
8
9 import org.junit.After;
10 import org.junit.Before;
11 import org.junit.Test;
12
13 public class StyleTest {
14         ByteArrayOutputStream m_baos;
15         PrintWriter m_pw;
16         
17         @Before
18         public void setUp() {
19                 m_baos = new ByteArrayOutputStream();
20                 m_pw = new PrintWriter(m_baos);
21         }
22         
23         @After
24         public void tearDown() throws IOException {
25                 if (null != m_baos) {
26                         m_baos.close();
27                 }
28         }
29         
30         // Should develop something here that is a bit smarter about what 
31         // it's looking for, and less brittle than a simple compare-against-master...
32         @Test
33         public void test_writeStyle() {
34                 String actual;
35
36                 m_baos.reset();
37                 
38                 Style style = new Style();
39                 style.writeStyle(m_pw);
40                 m_pw.flush();
41                 
42                 actual = m_baos.toString();
43                 Assert.assertEquals(Style.CSS + "\n", actual);
44         }
45 }