From 1d6b93864ffe1d5aedec6c7ec11302bc285bff7b Mon Sep 17 00:00:00 2001 From: angryziber Date: Mon, 16 Mar 2009 20:21:17 +0000 Subject: [PATCH] tests fixed git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@435 375186e5-ef17-0410-b0b6-91563547dcda --- test/net/azib/ipscan/config/LabelsTest.java | 4 ++-- test/net/azib/ipscan/gui/SelectFetchersDialogTest.java | 2 +- test/net/azib/ipscan/gui/StatisticsDialogTest.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/net/azib/ipscan/config/LabelsTest.java b/test/net/azib/ipscan/config/LabelsTest.java index 473d14f2..f7d44cd7 100755 --- a/test/net/azib/ipscan/config/LabelsTest.java +++ b/test/net/azib/ipscan/config/LabelsTest.java @@ -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)); diff --git a/test/net/azib/ipscan/gui/SelectFetchersDialogTest.java b/test/net/azib/ipscan/gui/SelectFetchersDialogTest.java index eea46cb1..f040a993 100755 --- a/test/net/azib/ipscan/gui/SelectFetchersDialogTest.java +++ b/test/net/azib/ipscan/gui/SelectFetchersDialogTest.java @@ -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"})); diff --git a/test/net/azib/ipscan/gui/StatisticsDialogTest.java b/test/net/azib/ipscan/gui/StatisticsDialogTest.java index c49c477d..703bb81c 100644 --- a/test/net/azib/ipscan/gui/StatisticsDialogTest.java +++ b/test/net/azib/ipscan/gui/StatisticsDialogTest.java @@ -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"));