1 package com.puppycrawl.tools.checkstyle.checks; 2 3 import java.io.File ; 4 5 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 6 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 7 import com.puppycrawl.tools.checkstyle.api.Configuration; 8 9 public class TranslationCheckTest 10 extends BaseCheckTestCase 11 { 12 protected DefaultConfiguration createCheckerConfig( 13 Configuration aCheckConfig) 14 { 15 final DefaultConfiguration dc = new DefaultConfiguration("root"); 16 dc.addChild(aCheckConfig); 17 return dc; 18 } 19 20 public void testTranslation() 21 throws Exception 22 { 23 final Configuration checkConfig = createCheckConfig(TranslationCheck.class); 24 final String [] expected = { 25 "0: Key 'only.english' missing." 26 }; 27 final File [] propertyFiles = new File [] { 28 new File (getPath("messages_de.properties")), 29 new File (getPath("messages.properties")) 30 }; 31 verify( 32 createChecker(checkConfig), 33 propertyFiles, 34 getPath("messages_de.properties"), 35 expected); 36 } 37 38 45 } 46 | Popular Tags |