View Javadoc

1   /*
2    * Copyright 2013 University of Glasgow.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package broadwick.data;
17  
18  import com.google.common.collect.Table;
19  import java.util.Map;
20  import lombok.extern.slf4j.Slf4j;
21  import org.junit.After;
22  import org.junit.AfterClass;
23  import org.junit.Before;
24  import org.junit.BeforeClass;
25  import org.junit.Test;
26  import static org.junit.Assert.*;
27  import org.junit.ClassRule;
28  import org.junit.Rule;
29  import org.junit.rules.TestRule;
30  import org.junit.rules.TestWatcher;
31  import org.junit.runner.Description;
32  import org.junit.runners.model.Statement;
33  import org.slf4j.MarkerFactory;
34  
35  /**
36   * Test cases for broadwick.data.DataReader class.
37   */
38  @Slf4j
39  public class DataReaderTest {
40      
41      public DataReaderTest() {
42      }
43      
44      @BeforeClass
45      public static void setUpClass() {
46      }
47      
48      @AfterClass
49      public static void tearDownClass() {
50      }
51      
52      @Before
53      public void setUp() {
54      }
55      
56      @After
57      public void tearDown() {
58      }
59  
60      @ClassRule // the magic is done here
61      public static TestRule classWatchman = new TestWatcher() {
62          @Override
63          protected void starting(Description description) {
64              log.info(MarkerFactory.getMarker("TEST"), "    Running tests from {} ...", description.getClassName());
65          }
66  
67      };
68      @Rule
69      public TestRule watchman = new TestWatcher() {
70          @Override
71          public Statement apply(Statement base, Description description) {
72              log.info(MarkerFactory.getMarker("TEST"), "        Running {} ...", description.getMethodName());
73              return base;
74          }
75  
76      };
77      /**
78       * Test of readDataSection method, of class DataReader.
79       */
80      @Test
81      public void testReadDataSection() {
82          System.out.println("readDataSection");
83          DataReader instance = null;
84          instance.readDataSection();
85          // TODO review the generated test code and remove the default call to fail.
86          fail("The test case is a prototype.");
87      }
88  
89      /**
90       * Test of close method, of class DataReader.
91       */
92      @Test
93      public void testClose() {
94          System.out.println("close");
95          DataReader instance = null;
96          instance.close();
97          // TODO review the generated test code and remove the default call to fail.
98          fail("The test case is a prototype.");
99      }
100 
101     /**
102      * Test of updateSectionDefiniton method, of class DataReader.
103      */
104     @Test
105     public void testAddElement() {
106         System.out.println("addElement");
107         String elementName = "";
108         int elementIndex = 0;
109         Map<String, Integer> elements = null;
110         StringBuilder errors = null;
111         boolean recordErrors = false;
112         String sectionName = "";
113         DataReader instance = null;
114         instance.updateSectionDefiniton(elementName, elementIndex, elements, errors, recordErrors, sectionName);
115         // TODO review the generated test code and remove the default call to fail.
116         fail("The test case is a prototype.");
117     }
118 
119     /**
120      * Test of getLookup method, of class DataReader.
121      */
122     @Test
123     public void testGetLookup() {
124         System.out.println("getLookup");
125         DataReader instance = null;
126         Lookup expResult = null;
127         Lookup result = instance.getLookup();
128         assertEquals(expResult, result);
129         // TODO review the generated test code and remove the default call to fail.
130         fail("The test case is a prototype.");
131     }
132     
133 }