Upgrade to Debian Jessie and JDK 7.
[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 org.junit.After;
8 import org.junit.Assert;
9 import org.junit.Before;
10 import org.junit.Test;
11
12 public class StyleTest {
13         ByteArrayOutputStream m_baos;
14         PrintWriter m_pw;
15         
16         @Before
17         public void setUp() {
18                 m_baos = new ByteArrayOutputStream();
19                 m_pw = new PrintWriter(m_baos);
20         }
21         
22         @After
23         public void tearDown() throws IOException {
24                 if (null != m_baos) {
25                         m_baos.close();
26                 }
27         }
28         
29         // Should develop something here that is a bit smarter about what 
30         // it's looking for, and less brittle than a simple compare-against-master...
31         @Test
32         public void test_writeStyle() {
33                 String actual;
34
35                 m_baos.reset();
36                 
37                 Style style = new Style();
38                 style.writeStyle(m_pw);
39                 m_pw.flush();
40                 
41                 actual = m_baos.toString();
42                 Assert.assertEquals(Style.CSS + "\n", actual);
43         }
44 }