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.config; 17 18 import lombok.extern.slf4j.Slf4j; 19 import org.junit.After; 20 import org.junit.AfterClass; 21 import org.junit.Before; 22 import org.junit.BeforeClass; 23 import org.junit.ClassRule; 24 import org.junit.Rule; 25 import org.junit.rules.TestRule; 26 import org.junit.rules.TestWatcher; 27 import org.junit.runner.Description; 28 import org.junit.runners.model.Statement; 29 import org.slf4j.MarkerFactory; 30 31 /** 32 * Test cases for broadwick.config.ConfigValidator class. 33 */ 34 @Slf4j 35 public class ConfigValidatorTest { 36 37 public ConfigValidatorTest() { 38 } 39 40 @BeforeClass 41 public static void setUpClass() { 42 } 43 44 @AfterClass 45 public static void tearDownClass() { 46 } 47 48 @Before 49 public void setUp() { 50 } 51 52 @After 53 public void tearDown() { 54 } 55 56 @ClassRule // the magic is done here 57 public static TestRule classWatchman = new TestWatcher() { 58 @Override 59 protected void starting(Description description) { 60 log.info(MarkerFactory.getMarker("TEST"), " Running tests from {} ...", description.getClassName()); 61 } 62 63 }; 64 @Rule 65 public TestRule watchman = new TestWatcher() { 66 @Override 67 public Statement apply(Statement base, Description description) { 68 log.info(MarkerFactory.getMarker("TEST"), " Running {} ...", description.getMethodName()); 69 return base; 70 } 71 72 }; 73 // @Test 74 // public void testValidate() { 75 // System.out.println("validate"); 76 // ConfigValidator instance = null; 77 // ConfigValidationErrors expResult = null; 78 // ConfigValidationErrors result = instance.validate(); 79 // assertEquals(expResult, result); 80 // // TODO review the generated test code and remove the default call to fail. 81 // fail("The test case is a prototype."); 82 // } 83 // @Test 84 // public void testGetValidatedProject() { 85 // System.out.println("getValidatedProject"); 86 // ConfigValidator instance = null; 87 // Project expResult = null; 88 // Project result = instance.getValidatedProject(); 89 // assertEquals(expResult, result); 90 // // TODO review the generated test code and remove the default call to fail. 91 // fail("The test case is a prototype."); 92 // } 93 }