r1971 - in trunk/i18n-maven-plugin/src: main/java/org/nuiton/i18n/plugin/parser main/java/org/nuiton/i18n/plugin/parser/impl test/java/org/nuiton/i18n/plugin/parser test/java/org/nuiton/i18n/plugin/parser/impl
Author: tchemit Date: 2012-08-29 21:38:52 +0200 (Wed, 29 Aug 2012) New Revision: 1971 Url: http://nuiton.org/repositories/revision/i18n/1971 Log: fixes #2288: Add a acceptKeyFormat in parsers mojo to filter which incoming keys can be kept Added: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserStruts2Mojo.java trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/Struts2JspFileParserTest.java Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractFileParser.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractI18nParserMojo.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/AbstractParserXmlMojo.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserValidationMojo.java trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserXmlUserMojo.java trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/SourceEntryTest.java trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/JavaFileParserTest.java Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractFileParser.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractFileParser.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractFileParser.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -30,8 +30,9 @@ import java.io.File; import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; - /** * A abstract implementation of a {@link FileParser} with no logic. * @@ -53,15 +54,19 @@ private final String encoding; + protected final Pattern acceptKeyPattern; + protected AbstractFileParser(Log log, String encoding, SortedProperties oldParser, + Pattern acceptKeyPattern, boolean showTouchedFiles) { this.log = log; this.oldParser = oldParser; this.showTouchedFiles = showTouchedFiles; this.encoding = encoding; result = new SortedProperties(encoding); + this.acceptKeyPattern = acceptKeyPattern; } public boolean isShowTouchedFiles() { @@ -104,6 +109,13 @@ * @param key the i18n key to register */ protected void registerKey(String key) { + if (acceptKeyPattern != null) { + Matcher matcher = acceptKeyPattern.matcher(key); + if (!matcher.matches()) { + return; + } + } + Object value = oldParser.get(key); if (value == null) { // nouvelle clef du parser, on utilise la clef comme valeur @@ -112,6 +124,9 @@ // register result getResult().put(key, value); + // one key found in file, so file is marked as touched + setTouched(true); + //old code with event // String keyModified = key; // for (ParserEvent event : events) { Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractI18nParserMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractI18nParserMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/AbstractI18nParserMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -34,6 +34,7 @@ import java.io.File; import java.io.IOException; import java.util.List; +import java.util.regex.Pattern; /** * Abstract implementation for parsing goal. @@ -55,10 +56,11 @@ protected abstract File getDefaultBasedir(); /** + * @param acceptPattern optional pattern to accept incoming keys * @return a new file parser to be used in the parser consumer parserExecutor * @since 1.2 */ - public abstract FileParser newFileParser(); + public abstract FileParser newFileParser(Pattern acceptPattern); /** * @param entry the incoming source entry to attach to the file updater @@ -108,6 +110,18 @@ @Parameter(property = "i18n.force", defaultValue = "false") protected boolean force; + /** + * A regex pattern to accept incoming keys. + * + * Only incoming keys which match the pattern will be kept. + * + * @since 2.5 + */ + @Parameter(property = "i18n.acceptKeyFormat") + protected String acceptKeyFormat; + + protected Pattern acceptPattern; + private SortedProperties result; protected SortedProperties oldParser; @@ -160,6 +174,10 @@ } } + if (acceptKeyFormat != null) { + acceptPattern = Pattern.compile(acceptKeyFormat); + } + parserExecutor = new ParserExecutor(this); } @@ -225,7 +243,7 @@ String fileName = entry.getBasedir().getAbsolutePath() + File.separator + file1; File file = new File(fileName); - parserExecutor.addFile(newFileParser(), file); + parserExecutor.addFile(newFileParser(acceptPattern), file); } } Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/AbstractParserXmlMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/AbstractParserXmlMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/AbstractParserXmlMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -60,6 +60,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import java.util.regex.Pattern; /** * Abstract xml parser mojo. @@ -166,7 +167,7 @@ } @Override - public final FileParser newFileParser() { + public final FileParser newFileParser(Pattern acceptPattern) { DocumentBuilder builder; try { @@ -312,13 +313,14 @@ public XmlFileParser(Log log, String encoding, SortedProperties oldParser, + Pattern acceptKeyPattern, boolean showTouchedFiles, String rules, XPath xpath, DocumentBuilder builder, Map<String, String> namespaces, boolean verbose) { - super(log, encoding, oldParser, showTouchedFiles); + super(log, encoding, oldParser, acceptKeyPattern, showTouchedFiles); this.xpath = xpath; this.rules = rules; this.builder = builder; @@ -408,7 +410,7 @@ key = extract(key); if (key != null) { - setTouched(true); +// setTouched(true); registerKey(key); } } Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserGWTJavaMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -45,7 +45,9 @@ import java.io.InputStreamReader; import java.io.LineNumberReader; import java.util.HashSet; +import java.util.List; import java.util.Set; +import java.util.regex.Pattern; /** * To detect from GWT java files new I18n keys, says content of patterns : @@ -142,11 +144,12 @@ } @Override - public FileParser newFileParser() { + public FileParser newFileParser(Pattern acceptPattern) { return new GWTJavaFileParser(getLog(), encoding, oldParser, + acceptPattern, isShowTouchedFiles() ); } @@ -157,8 +160,9 @@ public GWTJavaFileParser(Log log, String encoding, SortedProperties oldParser, + Pattern acceptKeyPattern, boolean showTouchedFiles) { - super(log, encoding, oldParser, showTouchedFiles); + super(log, encoding, oldParser, acceptKeyPattern,showTouchedFiles); } @@ -218,8 +222,8 @@ return; } - // one key found in file, so file is marked as touched - setTouched(true); +// // one key found in file, so file is marked as touched +// setTouched(true); // Found a i18n key, register it. if (getLog().isDebugEnabled()) { getLog().debug(file.getName() + " detected key = " + key); Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserJavaMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -44,6 +44,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.LineNumberReader; +import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -108,11 +109,12 @@ } @Override - public FileParser newFileParser() { + public FileParser newFileParser(Pattern acceptPattern) { return new JavaFileParser(getLog(), encoding, oldParser, + acceptPattern, isShowTouchedFiles() ); } @@ -130,8 +132,9 @@ public JavaFileParser(Log log, String encoding, SortedProperties oldParser, + Pattern acceptKeyPattern, boolean showTouchedFiles) { - super(log, encoding, oldParser, showTouchedFiles); + super(log, encoding, oldParser, acceptKeyPattern, showTouchedFiles); } public Pattern getI18nPattern() { @@ -170,8 +173,8 @@ if (getLog().isDebugEnabled()) { getLog().debug(file.getName() + " detected key = " + key); } - // one key found in file, so file is marked as touched - setTouched(true); +// // one key found in file, so file is marked as touched +// setTouched(true); // register key registerKey(key); Added: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserStruts2Mojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserStruts2Mojo.java (rev 0) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserStruts2Mojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -0,0 +1,212 @@ +package org.nuiton.i18n.plugin.parser.impl; + +/* + * #%L + * I18n :: Maven Plugin + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2007 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.nuiton.i18n.plugin.parser.AbstractFileParser; +import org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo; +import org.nuiton.i18n.plugin.parser.FileParser; +import org.nuiton.i18n.plugin.parser.I18nSourceEntry; +import org.nuiton.i18n.plugin.parser.ParserException; +import org.nuiton.i18n.plugin.parser.SourceEntry; +import org.nuiton.io.FileUpdater; +import org.nuiton.io.MirroredFileUpdater; +import org.nuiton.io.SortedProperties; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * To parse struts2 jsp and obtain all keys. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.5 + */ +@Mojo(name = "parserStruts2", defaultPhase = LifecyclePhase.GENERATE_RESOURCES) +public class ParserStruts2Mojo extends AbstractI18nParserMojo { + + public static final String DEFAULT_INCLUDES = "**/*.jsp"; + + /** Root directory of the default entry. */ + @Parameter(property = "i18n.defaultBasedir", defaultValue = "${basedir}/src/main/webapp") + protected File defaultBasedir; + + /** + * Default included files to process (ant-like expression). + * <p/> + * <strong>Note:</strong> default value is **\/*.jsp + */ + @Parameter(property = "i18n.defaultIncludes", defaultValue = DEFAULT_INCLUDES, required = true) + protected String defaultIncludes; + + /** + * Defines the file name of the getter where to put detected i18n keys + * while getter phase. + * + * @since 2.0 + */ + @Parameter(property = "i18n.outputGetter", defaultValue = "struts2.getter") + protected String outputGetter; + + /** Exploded war Build directory (used to know if files in sources are up-to-date). */ + @Parameter(property = "i18n.explodedWarPath", defaultValue = "${project.build.directory}/${project.artifactId}-{project.version}") + protected File explodedWarPath; + + @Override + public String[] getDefaultIncludes() { + return new String[]{defaultIncludes}; + } + + @Override + public String[] getDefaultExcludes() { + return I18nSourceEntry.EMPTY_STRING_ARRAY; + } + + @Override + public File getDefaultBasedir() { + return defaultBasedir; + } + + @Override + public FileUpdater newFileUpdater(SourceEntry entry) { + return new MirroredFileUpdater("", "", entry.getBasedir(), explodedWarPath) { + + @Override + public File getMirrorFile(File f) { + String file = + f.getAbsolutePath().substring(prefixSourceDirecotory); + return new File(destinationDirectory + File.separator + file); + } + }; + } + + @Override + protected String getOutGetter() { + return outputGetter; + } + + @Override + public FileParser newFileParser(Pattern acceptPattern) { + + return new Struts2JspFileParser(getLog(), + encoding, + oldParser, + acceptPattern, + isShowTouchedFiles() + ); + } + + protected static class Struts2JspFileParser extends AbstractFileParser { + + /** + * Pattern used to detect i18n keys. + * + * @since 2.3 + */ + protected final Pattern i18nPattern = + Pattern.compile("(?:%\\{getText\\(\\\"|text name=\\\"|key=\\\")(.*?)\""); + + protected final Pattern i18nPattern2 = + Pattern.compile("(?:text\\s*name='|key=')(.*?)'"); + + public Struts2JspFileParser(Log log, + String encoding, + SortedProperties oldParser, + Pattern acceptKeyPattern, + boolean showTouchedFiles) { + super(log, encoding, oldParser, acceptKeyPattern, showTouchedFiles); + } + + public Pattern getI18nPattern() { + return i18nPattern; + } + + @Override + public void parseFile(File file) throws IOException { + String line = null; + LineNumberReader lnr = new LineNumberReader(new InputStreamReader( + new FileInputStream(file), getEncoding())); + try { + while ((line = lnr.readLine()) != null) { + parseLine(file, line); + } + } catch (Exception e) { + if (line != null) { + getLog().error( + "could not parse line (" + lnr.getLineNumber() + ") '" + + line + "' of file " + file); + } + throw new ParserException(e); + } finally { + lnr.close(); + } + } + + @Override + public void parseLine(File file, String line) throws IOException { + + Matcher matcher = i18nPattern.matcher(line); + + boolean match = false; + while (matcher.find()) { + match = true; + String key = matcher.group(1); + if (getLog().isDebugEnabled()) { + getLog().debug(file.getName() + " detected key = " + key); + } + // register key + registerKey(key); + } + + if (!match) { + + // try with second pattern + matcher = i18nPattern2.matcher(line); + + while (matcher.find()) { + String key = matcher.group(1); + if (getLog().isDebugEnabled()) { + getLog().debug(file.getName() + " detected key = " + key); + } +// // one key found in file, so file is marked as touched +// setTouched(true); + + // register key + registerKey(key); + } + } + } + } + +} \ No newline at end of file Property changes on: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserStruts2Mojo.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserValidationMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserValidationMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserValidationMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -154,6 +154,7 @@ return new XmlFileParser(getLog(), encoding, oldParser, + acceptPattern, showTouchedFiles, rules, xpath, Modified: trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserXmlUserMojo.java =================================================================== --- trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserXmlUserMojo.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/main/java/org/nuiton/i18n/plugin/parser/impl/ParserXmlUserMojo.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -108,6 +108,7 @@ XmlFileParser fileParser = new XmlFileParser(getLog(), encoding, oldParser, + acceptPattern, showTouchedFiles, rules, xpath, Modified: trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/SourceEntryTest.java =================================================================== --- trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/SourceEntryTest.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/SourceEntryTest.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -1,5 +1,29 @@ package org.nuiton.i18n.plugin.parser; +/* + * #%L + * I18n :: Maven Plugin + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2007 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + import org.junit.Assert; import org.junit.Test; import org.nuiton.i18n.plugin.parser.impl.ParserJavaMojo; Property changes on: trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/SourceEntryTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/JavaFileParserTest.java =================================================================== --- trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/JavaFileParserTest.java 2012-08-29 19:38:13 UTC (rev 1970) +++ trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/JavaFileParserTest.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -64,6 +64,7 @@ log, ENCODING, oldParser, + null, false) { @Override protected void registerKey(String key) { Added: trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/Struts2JspFileParserTest.java =================================================================== --- trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/Struts2JspFileParserTest.java (rev 0) +++ trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/Struts2JspFileParserTest.java 2012-08-29 19:38:52 UTC (rev 1971) @@ -0,0 +1,126 @@ +package org.nuiton.i18n.plugin.parser.impl; + +/* + * #%L + * I18n :: Maven Plugin + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2007 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.apache.maven.plugin.logging.SystemStreamLog; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.nuiton.io.SortedProperties; + +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * To tes the {@link ParserStruts2Mojo.Struts2JspFileParser} parser. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.5 + */ +public class Struts2JspFileParserTest { + + public static final String ENCODING = "utf-8"; + + protected static final SystemStreamLog log = new SystemStreamLog(); + + protected ParserStruts2Mojo.Struts2JspFileParser parser; + + protected SortedProperties oldParser; + + protected Set<String> detectedKeys; + + @Before + public void setUp() throws Exception { + oldParser = new SortedProperties(ENCODING); + + + parser = new ParserStruts2Mojo.Struts2JspFileParser( + log, + ENCODING, + oldParser, + Pattern.compile("^i18n\\..*$"), + false) { + @Override + protected void registerKey(String key) { + if (acceptKeyPattern != null) { + Matcher matcher = acceptKeyPattern.matcher(key); + if (!matcher.matches()) { + return; + } + } + detectedKeys.add(key); + } + }; + detectedKeys = new HashSet<String>(); + } + + @After + public void tearDown() throws Exception { + detectedKeys.clear(); + detectedKeys = null; + parser = null; + } + + @Test + public void getKeys() throws IOException { + + File file = new File("getKeys"); + String line; + + line = "label='%{getText(\"i18n.key1\")}'/>"; + parseLine(file, line, "i18n.key1"); + + line = "key=\"key22\" label='%{getText(\"i18n.key2\")}'/> "; + parseLine(file, line, "i18n.key2"); + } + + @Test + public void getKeys2() throws IOException { + + String line; + File file = new File("getKeys2"); + + line = "<s:text name=\"i18n.key3\"/>"; + parseLine(file, line, "i18n.key3"); + + line = "<s:text key='i18n.key4'/>"; + parseLine(file, line, "i18n.key4"); + } + + protected void parseLine(File f, String line, String... expectedKeys) throws IOException { + parser.parseLine(f, line); + for (String expectedKey : expectedKeys) { + + Assert.assertTrue("Key " + expectedKey + + " was expected from line " + line, + detectedKeys.contains(expectedKey)); + } + } +} Property changes on: trunk/i18n-maven-plugin/src/test/java/org/nuiton/i18n/plugin/parser/impl/Struts2JspFileParserTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native
participants (1)
-
tchemit@users.nuiton.org