tests fixed

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@435 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2009-03-16 20:21:17 +00:00
parent 716cfe8fe7
commit 1d6b93864f
3 changed files with 6 additions and 6 deletions

View File

@ -82,7 +82,7 @@ public class LabelsTest {
}
public static File findBaseDir() {
URL url = LabelsTest.class.getClassLoader().getResource("Labels.txt");
URL url = LabelsTest.class.getClassLoader().getResource("messages.properties");
return new File(url.getPath()).getParentFile().getParentFile();
}
@ -102,7 +102,7 @@ public class LabelsTest {
private void findAndTestLabels(File file) throws IOException {
// TODO: tune these regexps
final Pattern LABELS_REGEX = Pattern.compile("Label.{1,60}\"([a-z]\\w+?\\.[a-z][\\w.]+?\\w)\"");
final Pattern LABELS_REGEX = Pattern.compile("Label.get{1,60}\"([a-z]\\w+?\\.[a-z][\\w.]+?\\w)\"");
final Pattern EXCEPTION_REGEX = Pattern.compile("new\\s+?(\\w+?Exception)\\(\"([\\w.]+?\\w)\"");
BufferedReader fileReader = new BufferedReader(new FileReader(file));

View File

@ -16,7 +16,7 @@ import org.junit.Test;
*/
public class SelectFetchersDialogTest {
@Test @SuppressWarnings("unchecked")
@Test
public void testSaveFetchersToRegistry() {
FetcherRegistry fetcherRegistry = createMock(FetcherRegistry.class);
fetcherRegistry.updateSelectedFetchers(aryEq(new String[] {"fetcher.ip", "fetcher.blah", "fetcher.hello"}));

View File

@ -30,7 +30,7 @@ import org.junit.Test;
public class StatisticsDialogTest {
@Test
public void testTimeToText() throws Exception {
public void timeToText() throws Exception {
Labels.initialize(new Locale("en"));
assertEquals("0\u00A0sec", StatisticsDialog.timeToText(0));
assertEquals("0.5\u00A0sec", StatisticsDialog.timeToText(499));
@ -43,7 +43,7 @@ public class StatisticsDialogTest {
}
@Test
public void testname() throws Exception {
public void dialogContent() throws Exception {
ScanningResultList results = createMock(ScanningResultList.class);
ScanInfo scanInfo = new ScanInfo() {
{
@ -60,7 +60,7 @@ public class StatisticsDialogTest {
expect(results.getFeederInfo()).andReturn("SomeInfoHere");
replay(results);
String text = new StatisticsDialog(results).getMessage();
String text = new StatisticsDialog(results).prepareText();
assertNotNull(text);
assertTrue(text.contains(Labels.getLabel("text.scan.time.total") + "10"));