<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Annotations</title><link>https://sourceforge.net/p/jasminerunner/wiki/Annotations/</link><description>Recent changes to Annotations</description><atom:link href="https://sourceforge.net/p/jasminerunner/wiki/Annotations/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 16 Feb 2013 20:11:18 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/jasminerunner/wiki/Annotations/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Annotations modified by Kai Hackemesser</title><link>https://sourceforge.net/p/jasminerunner/wiki/Annotations/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -20,7 +20,7 @@
     :::java
     @RequiredScripts({"/config.js", "/lib/require.js/require.js", "/lib/underscore.js" /*,...*/ })

-This adds the mentioned scripts to the test environment before running the jasmine spec. All this scripts will be loaded before the Jasmine test suite runs. Base path for scripts is the root of the server, see above.
+This adds the mentioned scripts to the test environment before running the jasmine spec. All this scripts will be loaded before the Jasmine test suite runs. Base path for scripts is the root of the server, see above. The scripts of Jasmine don't need to be listed, they are added by default. They are not required in your project source code folder either.
 When added to class, this affects all tests in the JUnit suite, when added to test method, it affects only the specs given in that test.
 If present for both class and test, both are applied (avoid duplicates!).

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kai Hackemesser</dc:creator><pubDate>Sat, 16 Feb 2013 20:11:18 -0000</pubDate><guid>https://sourceforge.neteb0ed42d72ebfd8e173ee00486557e6e68de4f5d</guid></item><item><title>WikiPage Annotations modified by Kai Hackemesser</title><link>https://sourceforge.net/p/jasminerunner/wiki/Annotations/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Jasmine JUnit tests take advantage from the Annotation based approach of JUnit 4.x. All annotations listed below can be found in the sourcecode under package com.metservice.jasminerunner.junit&lt;/p&gt;
&lt;p&gt;Mark the class as a Junit with specialized runner. A Jasmine JUnit class is annotated by &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@RunWith&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JasmineTestRunner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Specify the browser to run the test on. One or more Browser types can be used for the same test suite. Supported are: FIREFOX, SAFARI, CHROME, IPHONE, INTERNET_EXPLORER, ANDROID, HTML_UNIT (restricted)&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@Browsers&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FIREFOX&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Define where to find the &lt;em&gt;root&lt;/em&gt; of the web application (relative to project path). multiple roots possible, first hit is served:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@ServerConfiguration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sourceBase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/src/main/webapp&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/src/test/javascript&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;})&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2 id="optional-annotations-for-class-or-method"&gt;Optional annotations (for class or method)&lt;/h2&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@RequiredScripts&lt;/span&gt;&lt;span class="o"&gt;({&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/config.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/lib/require.js/require.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/lib/underscore.js&amp;quot;&lt;/span&gt; &lt;span class="cm"&gt;/*,...*/&lt;/span&gt; &lt;span class="o"&gt;})&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This adds the mentioned scripts to the test environment before running the jasmine spec. All this scripts will be loaded before the Jasmine test suite runs. Base path for scripts is the root of the server, see above.&lt;br /&gt;
When added to class, this affects all tests in the JUnit suite, when added to test method, it affects only the specs given in that test.&lt;br /&gt;
If present for both class and test, both are applied (avoid duplicates!).&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@MockResource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/module/modules&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;[{}]&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@MockResource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/module/modules&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;mockReturn.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Either content or location must be given. If the tests requests the resource of this path, either content is returned, or the content of the given location is returned. Base path of location is the parent folder of the executed jasmine spec. To add multiple MockResource entries per test, use this annotation: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@MockResources&lt;/span&gt;&lt;span class="o"&gt;([&lt;/span&gt;&lt;span class="nd"&gt;@MockResource...&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2 id="defining-a-junit-test"&gt;Defining a JUnit test&lt;/h2&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nd"&gt;@SpecFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;srcRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/src/test/javascript/module/portlets/lightning/search&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;testBasePath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/module&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="nf"&gt;testMapSearch&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;MapSearch_spec.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;MapSearchResultsView_spec.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;SearchableClientLocations_spec.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;SearchableModel_spec.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;SearchCriteriaModel_spec.js&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;&amp;quot;SearchResultsModel_spec.js&amp;quot;&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;em&gt;srcRoot&lt;/em&gt; is the path relative to project root that holds the spec files&lt;br /&gt;
&lt;em&gt;testBasePath&lt;/em&gt; is where to load this script from during the test  - to work well with relative file links&lt;br /&gt;
the test method returns a list of spec file names to run within the environment defined by this test method in this test class&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kai Hackemesser</dc:creator><pubDate>Sat, 12 Jan 2013 11:02:59 -0000</pubDate><guid>https://sourceforge.net8e7049baff33292b42709bd956c8ccd8cd4f84bc</guid></item></channel></rss>