Author: jawi
Date: Wed Aug 15 11:58:16 2012
New Revision: 1373357
URL: http://svn.apache.org/viewvc?rev=1373357&view=rev
Log:
Formatting...
Modified:
ace/site/trunk/content/dev-doc/writing-tests.mdtext
Modified: ace/site/trunk/content/dev-doc/writing-tests.mdtext
URL:
http://svn.apache.org/viewvc/ace/site/trunk/content/dev-doc/writing-tests.mdtext?rev=1373357&r1=1373356&r2=1373357&view=diff
==============================================================================
--- ace/site/trunk/content/dev-doc/writing-tests.mdtext (original)
+++ ace/site/trunk/content/dev-doc/writing-tests.mdtext Wed Aug 15 11:58:16 2012
@@ -45,16 +45,16 @@ Lets take a look at an excerpt from the
This snippet shows us almost all important concepts for TestNG:
-* The `@BeforeMethod` annotation allows us to run a method before each
individual test. In this 'setUp' method, we create a stub implementation of a
<tt>LogService</tt>. **Note:** the `alwaysRun = true` is needed to ensure that
this method is run, even though it does not belong to any test-group;
-* The method `testAuthenticateFailsWithNullContext` is annotated with the
`@Test` annotation, and its parameters tell us two more things: it belongs to a
group UNIT, and there's a failure to expect in the form of an
'IllegalArgumentException'. In this method, we instantiate the class-under-test
(using the stub 'LogService') and invoke a method on it;
-* The last method (`testAuthenticateFailsWithoutAuthProcessors`) shows us how
to make assertions on the results of methods. The `Assert` class of TestNG is
almost equivalent to its equally named counterpart in JUnit with one
difference: the failure message always comes last.
+* The <tt>@BeforeMethod</tt> annotation allows us to run a method before each
individual test. In this 'setUp' method, we create a stub implementation of a
<tt>LogService</tt>. **Note:** the `alwaysRun = true` is needed to ensure that
this method is run, even though it does not belong to any test-group;
+* The method <tt>testAuthenticateFailsWithNullContext</tt> is annotated with
the <tt>@Test</tt> annotation, and its parameters tell us two more things: it
belongs to a group UNIT, and there's a failure to expect in the form of an
'IllegalArgumentException'. In this method, we instantiate the class-under-test
(using the stub 'LogService') and invoke a method on it;
+* The last method (<tt>testAuthenticateFailsWithoutAuthProcessors<tt>) shows
us how to make assertions on the results of methods. The <tt>Assert</tt> class
of TestNG is almost equivalent to its equally named counterpart in JUnit with
one difference: the failure message always comes last.
To run the unit tests for a project, you simply go to the root directory of
the project itself, and call:
:::sh
$ ant testng
-This will run the unit tests using TestNG. The output of the tests can be
found in the `test-output` directory of your project. To run the test from
Eclipse, you can right click on it, and select `Run As -> TestNG Test` from its
context menu.
+This will run the unit tests using TestNG. The output of the tests can be
found in the <tt>test-output</tt> directory of your project. To run the test
from Eclipse, you can right click on it, and select "Run As -> TestNG Test"
from its context menu.
## Writing integration tests
@@ -63,7 +63,7 @@ In an integration test you test whether
### Integration test principles
-To write a very basic (OSGi) integration test, you need to extend your test
from `junit.framework.TestCase`. To access the bundle context of your test
case, you can make use of some standard OSGi utility code:
+To write a very basic (OSGi) integration test, you need to extend your test
from <tt>junit.framework.TestCase</tt>. To access the bundle context of your
test case, you can make use of some standard OSGi utility code:
:::java
public class MyIntegrationTest extends junit.framework.TestCase {