@@ -0,0 +1,1995 @@
+/* LanguageTool, a natural language style checker %0A * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de)%0A * %0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A * USA%0A */%0Apackage de.danielnaber.languagetool;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class VersionNumberTest extends TestCase %7B%0A%0A  public void testVersionNumber() throws IOException %7B%0A    String buildFile = load(%22build.xml%22);%0A    Pattern p1 = Pattern.compile(%22name=%5C%22version%5C%22 value=%5C%22(.*?)%5C%22%22);%0A    Matcher m1 = p1.matcher(buildFile);%0A    m1.find();%0A    String javaFile = load(%22src/java/de/danielnaber/languagetool/JLanguageTool.java%22);%0A    Pattern p2 = Pattern.compile(%22VERSION = %5C%22(.*?)%5C%22%22);%0A    Matcher m2 = p2.matcher(javaFile);%0A    m2.find();%0A    assertEquals(m1.group(1), m2.group(1));%0A    //System.out.println(m1.group(1));%0A  %7D%0A%0A  private String load(String filename) throws IOException %7B%0A    FileReader fr = new FileReader(filename);%0A    BufferedReader br = new BufferedReader(fr);%0A    StringBuffer sb = new StringBuffer();%0A    String line;%0A    while ((line = br.readLine()) != null) %7B%0A      sb.append(line);%0A    %7D%0A    br.close();%0A    fr.close();%0A    return sb.toString();%0A  %7D%0A%0A%7D%0A

test version numbers are the same at both places