Skip to content

Commit

Permalink
Running on different ports
Browse files Browse the repository at this point in the history
  • Loading branch information
kkozel committed Oct 3, 2011
1 parent 5bf8086 commit 8474547
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 9 deletions.
12 changes: 9 additions & 3 deletions AcceptanceTest/ATRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void Main(string[] args)
}

FileLog debugLog = new FileLog("log", new SessionID("AT", "Application", "Debug"));

ThreadedSocketAcceptor acceptor = null;
try
{
SessionSettings settings = new SessionSettings(args[0]);
Expand All @@ -22,20 +22,26 @@ static void Main(string[] args)
LogFactory logFactory = null;
if (settings.Get().Has("Verbose") && settings.Get().GetBool("Verbose"))
logFactory = new FileLogFactory(settings); //ScreenLogFactory(true, true, true);
ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(testApp, storeFactory, settings, logFactory);
acceptor = new ThreadedSocketAcceptor(testApp, storeFactory, settings, logFactory);

acceptor.Start();
while (true)
{
System.Console.WriteLine("o hai");
System.Threading.Thread.Sleep(1000);
}
//acceptor.Stop();
}
catch (System.Exception e)
{
debugLog.OnEvent(e.ToString());
}

finally
{
if(acceptor != null)
acceptor.Stop();
}

}
}
}
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_40.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5001
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.0
DataDictionary=..\spec\fix\FIX40.xml
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_41.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5002
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.1
DataDictionary=..\spec\fix\FIX41.xml
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_42.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5003
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.2
DataDictionary=..\spec\fix\FIX42.xml
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_43.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5004
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.3
DataDictionary=..\spec\fix\FIX43.xml
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_44.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5005
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
9 changes: 8 additions & 1 deletion AcceptanceTest/runat.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ set RESULT=0

if "%1" == "" goto usage
if "%2" == "" goto usage
if "%4" == "" (
set CONF_FILE="cfg\at.cfg"
)ELSE (
set CONF_FILE=%4
)

set TESTS="definitions/server/fix42/*.def"
if "%3" == "" goto getconfig:
set TESTS="%3"
goto getconfig

set CONFFILE="cfg\at.cfg"

:getconfig
if "%1" == "debug" goto debug
if "%1" == "release" goto release
Expand All @@ -28,7 +35,7 @@ goto start
call setup.bat %2

REM release\at\atrun -t run -s "%DIR%\AcceptanceTest.exe cfg\at.cfg" -d . -c "ruby Runner.rb 127.0.0.1 %2 definitions\server\fix40\*.def definitions\server\fix41\*.def definitions\server\fix42\*.def definitions\server\fix43\*.def definitions\server\fix44\*.def definitions\server\fix50\*.def definitions\server\fix50sp1\*.def definitions\server\fix50sp2\*.def" -i .\ -o TestResult.xml
release\at\atrun -t run -s "%DIR%\AcceptanceTest.exe cfg\at.cfg" -d . -c "ruby Runner.rb 127.0.0.1 %2 %TESTS%" -i .\ -o TestResult.xml
release\at\atrun -t run -s "%DIR%\AcceptanceTest.exe %CONF_FILE%" -d . -c "ruby Runner.rb 127.0.0.1 %2 %TESTS%" -i .\ -o TestResult.xml
if ERRORLEVEL 1 set RESULT=1
type TestResult.xml
goto quit
Expand Down
10 changes: 5 additions & 5 deletions acceptance_test.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
pushd AcceptanceTest
del TestResult.xml AcceptanceTests_40.html AcceptanceTests_41.xml AcceptanceTests_42.xml AcceptanceTests_43.xml AcceptanceTests_44.xml
call runat release 5001 definitions/server/fix40/*.def
call runat release 5001 definitions/server/fix40/*.def cfg/at_40.cfg
if ERRORLEVEL 1 set RESULT40=1
echo "40 tests result: %RESULT40%"
xsltproc.exe -o AcceptanceTests_40.html at.xsl TestResult.xml

call runat release 5001 definitions/server/fix41/*.def
call runat release 5002 definitions/server/fix41/*.def cfg/at_41.cfg
if ERRORLEVEL 1 set RESULT41=1
echo "41 tests result: %RESULT41%"
xsltproc.exe -o AcceptanceTests_41.html at.xsl TestResult.xml

call runat release 5001 definitions/server/fix42/*.def
call runat release 5003 definitions/server/fix42/*.def cfg/at_42.cfg
if ERRORLEVEL 1 set RESULT42=1
echo "42 tests result: %RESULT42%"
xsltproc.exe -o AcceptanceTests_42.html at.xsl TestResult.xml

call runat release 5001 definitions/server/fix43/*.def
call runat release 5004 definitions/server/fix43/*.def cfg/at_43.cfg
if ERRORLEVEL 1 set RESULT43=1
echo "43 tests result: %RESULT43%"
xsltproc.exe -o AcceptanceTests_43.html at.xsl TestResult.xml

call runat release 5001 definitions/server/fix44/*.def
call runat release 5005 definitions/server/fix44/*.def cfg/at_44.cfg
if ERRORLEVEL 1 set RESULT44=1
echo "44 tests result: %RESULT44%"
xsltproc.exe -o AcceptanceTests_44.html at.xsl TestResult.xml
Expand Down

0 comments on commit 8474547

Please sign in to comment.