mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
tests now run outside of eclipse :-)
git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@304 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
parent
913f1eded4
commit
00cfcc8530
10
build.xml
10
build.xml
@ -33,8 +33,8 @@
|
||||
<exclude name="**/icon?*.png"/>
|
||||
</patternset>
|
||||
|
||||
<!--<target name="all" depends="clean,compile,compile-tests,do-test,package,clean_end"/>-->
|
||||
<target name="all" depends="clean,compile,compile-tests,do-test,package,clean_end"/>
|
||||
<!--<target name="all" depends="clean,compile,compile-tests,test,package,clean_end"/>-->
|
||||
<target name="all" depends="clean,compile,compile-tests,test,package,clean_end"/>
|
||||
<target name="linux" depends="clean,compile,package-linux,clean_end"/>
|
||||
<target name="linux64" depends="clean,compile,package-linux64,clean_end"/>
|
||||
<target name="mac" depends="clean,compile,package-mac,clean_end"/>
|
||||
@ -112,14 +112,14 @@
|
||||
-->
|
||||
</target>
|
||||
|
||||
<target name="do-test">
|
||||
<target name="test">
|
||||
<delete dir="${testresults}"/>
|
||||
<mkdir dir="${testresults}"/>
|
||||
<delete file="coverage.ec"/>
|
||||
<junit haltonfailure="true" showoutput="true">
|
||||
<junit haltonfailure="true" showoutput="true" fork="yes">
|
||||
<classpath>
|
||||
<dirset dir="${testbin}"/>
|
||||
<fileset dir="${swt}" includes="*.jar"/>
|
||||
<fileset dir="${swt}" includes="swt-linux.jar"/>
|
||||
<fileset dir="${ext}/junit" includes="*.jar"/>
|
||||
<fileset dir="${ext}/easymock" includes="*.jar"/>
|
||||
<path refid="emma.lib"/>
|
||||
|
||||
@ -58,13 +58,15 @@ public class StartStopScanningAction implements SelectionListener, ScanningProgr
|
||||
/**
|
||||
* Creates internal stuff independent from all other external dependencies
|
||||
*/
|
||||
StartStopScanningAction() {
|
||||
StartStopScanningAction(Display display) {
|
||||
this.display = display;
|
||||
|
||||
// preload button images
|
||||
buttonImages[ScanningState.IDLE.ordinal()] = new Image(null, Labels.getInstance().getImageAsStream("button.start.img"));
|
||||
buttonImages[ScanningState.SCANNING.ordinal()] = new Image(null, Labels.getInstance().getImageAsStream("button.stop.img"));
|
||||
buttonImages[ScanningState.IDLE.ordinal()] = new Image(display, Labels.getInstance().getImageAsStream("button.start.img"));
|
||||
buttonImages[ScanningState.SCANNING.ordinal()] = new Image(display, Labels.getInstance().getImageAsStream("button.stop.img"));
|
||||
buttonImages[ScanningState.STARTING.ordinal()] = buttonImages[ScanningState.SCANNING.ordinal()];
|
||||
buttonImages[ScanningState.RESTARTING.ordinal()] = buttonImages[ScanningState.SCANNING.ordinal()];
|
||||
buttonImages[ScanningState.STOPPING.ordinal()] = new Image(null, Labels.getInstance().getImageAsStream("button.kill.img"));
|
||||
buttonImages[ScanningState.STOPPING.ordinal()] = new Image(display, Labels.getInstance().getImageAsStream("button.kill.img"));
|
||||
buttonImages[ScanningState.KILLING.ordinal()] = buttonImages[ScanningState.STOPPING.ordinal()];
|
||||
|
||||
// preload button texts
|
||||
@ -77,7 +79,7 @@ public class StartStopScanningAction implements SelectionListener, ScanningProgr
|
||||
}
|
||||
|
||||
public StartStopScanningAction(ScannerThreadFactory scannerThreadFactory, StateMachine stateMachine, ResultTable resultTable, StatusBar statusBar, FeederGUIRegistry feederRegistry, PingerRegistry pingerRegistry, Button startStopButton, GUIConfig guiConfig) {
|
||||
this();
|
||||
this(startStopButton.getDisplay());
|
||||
|
||||
this.scannerThreadFactory = scannerThreadFactory;
|
||||
this.resultTable = resultTable;
|
||||
@ -85,7 +87,6 @@ public class StartStopScanningAction implements SelectionListener, ScanningProgr
|
||||
this.feederRegistry = feederRegistry;
|
||||
this.pingerRegistry = pingerRegistry;
|
||||
this.button = startStopButton;
|
||||
this.display = button.getDisplay();
|
||||
this.stateMachine = stateMachine;
|
||||
this.guiConfig = guiConfig;
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ package net.azib.ipscan.gui.actions;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import net.azib.ipscan.core.state.ScanningState;
|
||||
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@ -21,7 +22,7 @@ public class StartStopScanningActionTest {
|
||||
|
||||
@Test
|
||||
public void testAllImagesAreDefined() throws Exception {
|
||||
StartStopScanningAction action = new StartStopScanningAction();
|
||||
StartStopScanningAction action = new StartStopScanningAction(Display.getDefault());
|
||||
for (ScanningState state : ScanningState.values()) {
|
||||
assertNotNull(action.buttonImages[state.ordinal()]);
|
||||
assertNotNull(action.buttonTexts[state.ordinal()]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user