[ 
https://issues.apache.org/jira/browse/SLING-5356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15052841#comment-15052841
 ] 

Bertrand Delacretaz commented on SLING-5356:
--------------------------------------------

At revision 1719430 I think this is fairly complete, the interesting bits are

* The {{ResourceBuilder}} interface at [1] - it should provide everything to 
create tres such as the one show in the second comment above, in a convenient 
way.
* The {{ResourceBuilderImplTest.treeWithFiles}} test at [2] which creates such 
a tree.
* The {{FileRetrievalIT}} [3[ which demonstrates using the {{ResourceBuilder}} 
in teleported tests

I'll ask for feedback on the dev list.

[1] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/resourcebuilder/src/main/java/org/apache/sling/resourcebuilder/api/ResourceBuilder.java

[2]  
https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/resourcebuilder/src/test/java/org/apache/sling/resourcebuilder/impl/ResourceBuilderImplTest.java

[3] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/resourcebuilder/src/test/java/org/apache/sling/resourcebuilder/it/FileRetrievalIT.java

> Extract and generalize the Sling Mocks ContentBuilder
> -----------------------------------------------------
>
>                 Key: SLING-5356
>                 URL: https://issues.apache.org/jira/browse/SLING-5356
>             Project: Sling
>          Issue Type: New Feature
>          Components: General
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>
> As discussed recently on our dev list the {{ContentBuilder}} currently 
> provided by the Sling Mocks library [1] can be very useful in testing. 
> In order to make it usable for both client-side and server-side testing (as 
> well as in server-side code) I'm planning to
> * Extract it into its own module
> * Define an API that allows for creating nodes and properties, importing JSON 
> and other files via the Sling ContentLoader and providing a simple a way to 
> cleanup the test content
> * Implement (first) a server-side version of that API
> * Implement (as a second priority) a client-side version that can be used in 
> test run via HTTP
> This shouldn't affect the existing Sling Mocks library users, except maybe 
> forcing them to rebuild their tests to use the new API.
> [1] 
> https://sling.apache.org/documentation/development/sling-mock.html#building-content



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to