You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2015/09/25 15:44:02 UTC

svn commit: r966794 - in /websites/staging/sling/trunk/content: ./ documentation/development.html documentation/development/hamcrest.md

Author: buildbot
Date: Fri Sep 25 13:44:02 2015
New Revision: 966794

Log:
Staging update by buildbot for sling

Added:
    websites/staging/sling/trunk/content/documentation/development/hamcrest.md
Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/development.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Sep 25 13:44:02 2015
@@ -1 +1 @@
-1704887
+1705306

Modified: websites/staging/sling/trunk/content/documentation/development.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/development.html (original)
+++ websites/staging/sling/trunk/content/documentation/development.html Fri Sep 25 13:44:02 2015
@@ -134,6 +134,7 @@ h2:hover > .headerlink, h3:hover > .head
 <li><a href="/documentation/development/sling-mock.html">Sling Mocks</a></li>
 <li><a href="/documentation/development/osgi-mock.html">OSGi Mocks</a></li>
 <li><a href="/documentation/development/jcr-mock.html">JCR Mocks</a></li>
+<li><a href="">Hamcrest integration</a></li>
 </ul>
 <h2 id="maven-stuff">Maven Stuff<a class="headerlink" href="#maven-stuff" title="Permanent link">&para;</a></h2>
 <p>Sling is using Apache Maven 3 as its build system. Over time we have created a number of Maven 3 plugins and gathered a whole range of knowledge about using Maven.</p>
@@ -156,7 +157,7 @@ h2:hover > .headerlink, h3:hover > .head
 <li>A Sonar analysis is available on the <a href="https://analysis.apache.org/dashboard/index/org.apache.sling:sling-builder">analysis.apache.org</a> server.</li>
 </ul>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1704544 by bdelacretaz on Tue, 22 Sep 2015 10:26:34 +0000
+        Rev. 1705306 by rombert on Fri, 25 Sep 2015 13:43:48 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project

Added: websites/staging/sling/trunk/content/documentation/development/hamcrest.md
==============================================================================
--- websites/staging/sling/trunk/content/documentation/development/hamcrest.md (added)
+++ websites/staging/sling/trunk/content/documentation/development/hamcrest.md Fri Sep 25 13:44:02 2015
@@ -0,0 +1,39 @@
+Title: Hamcrest Integration
+
+Deeper integration with the [Hamcrest matcher library](http://hamcrest.org/).
+
+## Maven Dependency
+
+<div class="warning">
+This module has not yet been officially released.
+</div>
+
+    #!xml
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.testing.hamcrest</artifactId>
+    </dependency>
+
+Note that to keep the classpath consistent this module has all its dependencies marked as `provided`. It relies on your own project to define the needed dependencies, such as `org.hamcrest:hamcrest-core` and `org.apache.sling:org.apache.sling.api` .
+
+See latest version on the [downloads page](/downloads.cgi).
+
+## Usage
+
+The class `org.apache.sling.testing.hamcrest.ResourceMatchers` is the main entry point. It contains static methods that can be used to create assertions.
+
+    #!java
+    import static org.apache.sling.hamcrest.ResourceMatchers.resourceOfType;
+    
+    public void MyServiceTest {
+    
+      @Test 
+      public void loadResources() {
+        Resource resource = /* load resource */ null;
+        
+        assertThat(resource, resourceOfType('my/app'));
+      } 
+    
+    }
+
+The Slingshot sample application uses these matchers, see [SetupServiceTest.java](http://svn.apache.org/repos/asf/sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java) for an example.
\ No newline at end of file