mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
tests fixed
git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@435 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
parent
716cfe8fe7
commit
1d6b93864f
@ -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));
|
||||
|
||||
@ -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"}));
|
||||
|
||||
@ -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"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user