Problem using Magic Test

14 views
Skip to first unread message

Thomas Mauch

unread,
Jun 17, 2010, 6:34:46 PM6/17/10
to magictest-users
From: Arun Panda

Hi ,

The command line usage of Magic test is not very clear and i am
finding it
difficult to execute the tests from command prompt.

Also the The save /run link does not work from within the eclipse or
from
any popular browsers.

Can you please let me know if the project is still active? I am trying
to
implement magic tests in my project and would like to provide demo to
my
team members

Thanks in advance.

Arun

Thomas Mauch

unread,
Jun 17, 2010, 6:45:55 PM6/17/10
to magictest-users
Hi Arun

Thanks for your interest. The project is still active but I have not
published a new release since some weeks.

Can you please clarify what you mean with "command line usage of Magic
test is not very clear". I have reread the documenation and saw a few
details for improvment, but did you see a specific point?
I will attach a script with some usage examples to this post.

The (Run)/(Save) links will only work within Eclipse, as Eclipse
monitors these links and if you click on it, it will automatically
execute the selected command. It basically is a shortcut to the
commands "Run test"/"Save test" from the MagicTest context menu.

Regards
Thomas

--------------------
@echo off

rem --
rem -- Run test using MagicTest core
rem --

rem -- Java executable
set JAVA=java
rem -- JAR with MagicTest library
set MAGICTEST_JAR=D:\Source\Eclipse\Workspace\MagicTest\build
\magictest-core.jar
rem -- Main class of MagicTest
set MAGICTEST_MAIN=org.magictest.MagicTest
rem -- Directory containing the test class files
set TESTS=bin


rem -- Test a single method

rem -- Save the actual output as reference
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -run -method
org.magictest.examples.StaticMethodsTest.testAdd
rem -- As run is the default mode, you can omit "-run"
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -method
org.magictest.examples.StaticMethodsTest.testAdd
rem -- Save the actual output as reference
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -save -method
org.magictest.examples.StaticMethodsTest.testAdd


rem -- Test a whole class

%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -run -class
org.magictest.examples.StaticMethodsTest
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -class
org.magictest.examples.StaticMethodsTest
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -save -class
org.magictest.examples.StaticMethodsTest

rem -- Set the output directory
rem -- In the given directory, the magictest directory will be
created.
rem -- Both directories will be created if they do not yet exist
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -dir tests -method
org.magictest.examples.StaticMethodsTest.testAdd


rem -- Set the log level
%JAVA% -cp %MAGICTEST_JAR%;%TESTS% %MAGICTEST_MAIN% -log info -method
org.magictest.examples.StaticMethodsTest.testAdd

Arun

unread,
Jun 18, 2010, 7:11:55 AM6/18/10
to magictest-users
Thanks Thomas,

That really helped me in setting the magic tests for my demo project
correctly.
I am able to run the tests through command prompt properly now.
I had some doubt on set TESTS_CP=bin parameter, but now i am able to
execute the tests.


Reply all
Reply to author
Forward
0 new messages