Re: [xwiki-users] Recommendations on writing automated functional tests for xar extensions ?
Thanks Marius, that's exactly what I was looking for ! I'll follow that practice, BR, Jeremie 2013/3/20 Marius Dumitru Florea mariusdumitru.flo...@xwiki.com Hi Jeremie, We have started moving functional tests from xwiki-enterprise to xwiki-platform so that they are grouped by functional domain. Thus xwiki-enterprise-test-ui is not the best example. You should take a look at the platform modules that have functional tests: https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-administration https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-faq https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-index to name a few. The packager maven plugin is taking care of importing (installing) your XAR and (I believe) adding the required jar dependencies to the WAR. You should follow this practice. Hope this helps, Marius On Wed, Mar 20, 2013 at 1:07 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: Hello, I would like to discuss a little on writing of Selenium2 tests, as described in test strategy [1], ie use Selenium 2 and apply Page Objects pattern. My particular use-case is that I'm on a mission : write some functional tests for my mail archive application. I also think these would be the best tests for my app, as it greatly relies on 2 external interfaces (xwiki for persistence/conf, javamail and mail accounts on another side). There are some good unit tests to write of course, but the main logic of the app has more meaning to be tested in real life, or close to that. To do that, I decided to try and plug myself in xwiki test framework, in order to avoid redeveloping everything (such as deploying / launching an xwiki instance from the tests). I added 2 modules in my project: - xwiki-contrib-mailarchive-test-pageobjects - xwiki-contrib-mailarchive-test-ui Both inherit from org.xwiki.enterprise:xwiki-enterprise-test pom, and are greatly inspired from poms of xwiki-enterprise-test-pageobjects and xwiki-enterprise-test-ui poms. It's unfinished and untested, but I believe I'll be able to have xwiki instance installed, launched, and tests run automatically. My main question, is how should I do in order to also deploy my app in this wiki instance prior to run the tests ? For now I have several possible solutions that come to my mind, but I don't know what would be the best... : A- - grab xwiki-standalone zip version x.y.z, unzip it, launch it - make EM install my application (call some REST API ? GET some page with proper parameters ?) - run the tests B- - grab xwiki-standalone zip version x.y.z, unzip it - patch it in some way with my application binaries, (ie, add things directly under permanent directory / extension / repository ?) - launch it and run the tests I personnally prefer A-, but it supposes also that the xwiki instance knows any of my dev maven repositories (either my local repository .m2, or my local instance of Nexus), so it would mean an additional step would be to patch the standalone wiki xwiki.properties to add my personal repo. Or maybe I can add such repo programmatically in the wiki instance from java by looking up and using the right component ? Maybe this point has already been solved by anyone, so if you have any samples it would be good enough. I did not search exhaustively, but I don't remember having seen such use-cases on existing extensions on github. Also, I think it might be interesting to extract from all this some kind of maven archetype for functional testing of UI extension ? So contributors could just call the archetype and get everything properly prepared, and just have to add page objects and tests for their app ... WDYT ? BR, Jeremie [1] http://dev.xwiki.org/xwiki/bin/view/Community/Testing#HSelenium2-basedFramework ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Recommendations on writing automated functional tests for xar extensions ?
Hummm, running through a strange issue during build: [ERROR] Failed to execute goal org.xwiki.platform:xwiki-platform-tool-packager-plugin:4.5.2:package (default) on project xwiki-contrib-mailarchive-test-tests: Failed to resolve art ifact [org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT:]: Failure to find org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT in http:// nexus.xwiki.org/nexus/content/groups/public-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of xwiki-snapshots has elapse d or updates are forced 4.5.2 is ${platform.version}, 0.3-SNAPSHOT is ${project.version}. The packager plugin is declared in my pom in version ${platform.version} of course. Surprisingly though, here's an extract of the output of dependency:resolve-plugins: [INFO] Plugin Resolved: xwiki-platform-tool-packager-plugin-4.5.2.jar [...] [INFO] Plugin Dependency Resolved: xwiki-platform-tool-jetty-resources-4.5.2.zip [...] Seems that it finds correct 4.5.2 version for same dependency, that it doesn't find at runtime ... Maybe an issue on packager plugin, invisible until you use it on a non-xwiki project ? :-) BR, Jeremie 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Thanks Marius, that's exactly what I was looking for ! I'll follow that practice, BR, Jeremie 2013/3/20 Marius Dumitru Florea mariusdumitru.flo...@xwiki.com Hi Jeremie, We have started moving functional tests from xwiki-enterprise to xwiki-platform so that they are grouped by functional domain. Thus xwiki-enterprise-test-ui is not the best example. You should take a look at the platform modules that have functional tests: https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-administration https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-faq https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-index to name a few. The packager maven plugin is taking care of importing (installing) your XAR and (I believe) adding the required jar dependencies to the WAR. You should follow this practice. Hope this helps, Marius On Wed, Mar 20, 2013 at 1:07 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: Hello, I would like to discuss a little on writing of Selenium2 tests, as described in test strategy [1], ie use Selenium 2 and apply Page Objects pattern. My particular use-case is that I'm on a mission : write some functional tests for my mail archive application. I also think these would be the best tests for my app, as it greatly relies on 2 external interfaces (xwiki for persistence/conf, javamail and mail accounts on another side). There are some good unit tests to write of course, but the main logic of the app has more meaning to be tested in real life, or close to that. To do that, I decided to try and plug myself in xwiki test framework, in order to avoid redeveloping everything (such as deploying / launching an xwiki instance from the tests). I added 2 modules in my project: - xwiki-contrib-mailarchive-test-pageobjects - xwiki-contrib-mailarchive-test-ui Both inherit from org.xwiki.enterprise:xwiki-enterprise-test pom, and are greatly inspired from poms of xwiki-enterprise-test-pageobjects and xwiki-enterprise-test-ui poms. It's unfinished and untested, but I believe I'll be able to have xwiki instance installed, launched, and tests run automatically. My main question, is how should I do in order to also deploy my app in this wiki instance prior to run the tests ? For now I have several possible solutions that come to my mind, but I don't know what would be the best... : A- - grab xwiki-standalone zip version x.y.z, unzip it, launch it - make EM install my application (call some REST API ? GET some page with proper parameters ?) - run the tests B- - grab xwiki-standalone zip version x.y.z, unzip it - patch it in some way with my application binaries, (ie, add things directly under permanent directory / extension / repository ?) - launch it and run the tests I personnally prefer A-, but it supposes also that the xwiki instance knows any of my dev maven repositories (either my local repository .m2, or my local instance of Nexus), so it would mean an additional step would be to patch the standalone wiki xwiki.properties to add my personal repo. Or maybe I can add such repo programmatically in the wiki instance from java by looking up and using the right component ? Maybe this point has already been solved by anyone, so if you have any samples it would be good enough. I did not search exhaustively, but I don't remember having seen such use-cases on existing extensions on github. Also, I think it might be interesting to extract from all this some kind of maven archetype for functional
Re: [xwiki-users] Recommendations on writing automated functional tests for xar extensions ?
Note: it goes a bit further if I declare a bunch of xwiki platform dependencies in my pom, but breaks again, trying to look at those platform artifacts for version ${project.version} instead of ${platform.version} : [INFO] Copying JAR dependencies ... [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-wysiwyg-server:jar:0.3-SNAPSHOT [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-localization-script:jar:0.3-SNAPSHOT [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-oldcore:jar:0.3-SNAPSHOT [...] [ERROR] Failed to execute goal org.xwiki.platform:xwiki-platform-tool-packager-plugi datory artifacts: Missing: [ERROR] -- [ERROR] 1) org.xwiki.platform:xwiki-platform-localization-script:jar:0.3-SNAPSHOT [ERROR] [ERROR] Try downloading the file manually from the project website. [...] Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to resolve mandatory artifacts at org.xwiki.tool.packager.PackageMojo.resolveTransitively(PackageMojo.java:614) at org.xwiki.tool.packager.PackageMojo.resolveJarArtifacts(PackageMojo.java:543) at org.xwiki.tool.packager.PackageMojo.execute(PackageMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Hummm, running through a strange issue during build: [ERROR] Failed to execute goal org.xwiki.platform:xwiki-platform-tool-packager-plugin:4.5.2:package (default) on project xwiki-contrib-mailarchive-test-tests: Failed to resolve art ifact [org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT:]: Failure to find org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT in http:// nexus.xwiki.org/nexus/content/groups/public-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of xwiki-snapshots has elapse d or updates are forced 4.5.2 is ${platform.version}, 0.3-SNAPSHOT is ${project.version}. The packager plugin is declared in my pom in version ${platform.version} of course. Surprisingly though, here's an extract of the output of dependency:resolve-plugins: [INFO] Plugin Resolved: xwiki-platform-tool-packager-plugin-4.5.2.jar [...] [INFO] Plugin Dependency Resolved: xwiki-platform-tool-jetty-resources-4.5.2.zip [...] Seems that it finds correct 4.5.2 version for same dependency, that it doesn't find at runtime ... Maybe an issue on packager plugin, invisible until you use it on a non-xwiki project ? :-) BR, Jeremie 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Thanks Marius, that's exactly what I was looking for ! I'll follow that practice, BR, Jeremie 2013/3/20 Marius Dumitru Florea mariusdumitru.flo...@xwiki.com Hi Jeremie, We have started moving functional tests from xwiki-enterprise to xwiki-platform so that they are grouped by functional domain. Thus xwiki-enterprise-test-ui is not the best example. You should take a look at the platform modules that have functional tests: https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-administration https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-faq https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-index to name a few. The packager maven plugin is taking care of importing (installing) your XAR and (I believe) adding the required jar dependencies to the WAR. You should follow this practice. Hope this helps, Marius On Wed, Mar 20, 2013 at 1:07 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: Hello, I would like to discuss a little on writing of Selenium2 tests, as described in test strategy [1], ie use Selenium 2 and apply Page Objects pattern. My particular use-case is that I'm on a mission : write some functional tests for my mail archive application. I also think these would be the best tests for my app, as it greatly relies on 2 external interfaces (xwiki for persistence/conf, javamail and mail accounts on another side). There are some good unit tests to write of course, but the main logic of the app has more meaning to be tested in real life, or close to that. To do that, I decided to try and plug myself in xwiki test framework, in order to avoid redeveloping everything (such as deploying / launching an xwiki instance from the tests). I added 2 modules in my project: - xwiki-contrib-mailarchive-test-pageobjects - xwiki-contrib-mailarchive-test-ui Both inherit from org.xwiki.enterprise:xwiki-enterprise-test pom, and are greatly inspired from poms of xwiki-enterprise-test-pageobjects and xwiki-enterprise-test-ui poms. It's unfinished and untested, but I believe I'll be able to have xwiki
Re: [xwiki-users] Recommendations on writing automated functional tests for xar extensions ?
I think the problem lies on this kind of expressions [1] ... The packager plugin defines version for all mandatory platform artifacts with this.getProject().getVersion(), meaning if I'm correct that it returns correct version only if project is part of xwiki platform - or if it shares the same version. Maybe it should use property platform.version instead ? BR, Jeremie [1] https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-tools/xwiki-platform-tool-packager-plugin/src/main/java/org/xwiki/tool/packager/PackageMojo.java#L565 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Note: it goes a bit further if I declare a bunch of xwiki platform dependencies in my pom, but breaks again, trying to look at those platform artifacts for version ${project.version} instead of ${platform.version} : [INFO] Copying JAR dependencies ... [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-wysiwyg-server:jar:0.3-SNAPSHOT [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-localization-script:jar:0.3-SNAPSHOT [WARNING] Missing POM for org.xwiki.platform:xwiki-platform-oldcore:jar:0.3-SNAPSHOT [...] [ERROR] Failed to execute goal org.xwiki.platform:xwiki-platform-tool-packager-plugi datory artifacts: Missing: [ERROR] -- [ERROR] 1) org.xwiki.platform:xwiki-platform-localization-script:jar:0.3-SNAPSHOT [ERROR] [ERROR] Try downloading the file manually from the project website. [...] Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to resolve mandatory artifacts at org.xwiki.tool.packager.PackageMojo.resolveTransitively(PackageMojo.java:614) at org.xwiki.tool.packager.PackageMojo.resolveJarArtifacts(PackageMojo.java:543) at org.xwiki.tool.packager.PackageMojo.execute(PackageMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Hummm, running through a strange issue during build: [ERROR] Failed to execute goal org.xwiki.platform:xwiki-platform-tool-packager-plugin:4.5.2:package (default) on project xwiki-contrib-mailarchive-test-tests: Failed to resolve art ifact [org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT:]: Failure to find org.xwiki.platform:xwiki-platform-tool-jetty-resources:zip:0.3-SNAPSHOT in http:// nexus.xwiki.org/nexus/content/groups/public-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of xwiki-snapshots has elapse d or updates are forced 4.5.2 is ${platform.version}, 0.3-SNAPSHOT is ${project.version}. The packager plugin is declared in my pom in version ${platform.version} of course. Surprisingly though, here's an extract of the output of dependency:resolve-plugins: [INFO] Plugin Resolved: xwiki-platform-tool-packager-plugin-4.5.2.jar [...] [INFO] Plugin Dependency Resolved: xwiki-platform-tool-jetty-resources-4.5.2.zip [...] Seems that it finds correct 4.5.2 version for same dependency, that it doesn't find at runtime ... Maybe an issue on packager plugin, invisible until you use it on a non-xwiki project ? :-) BR, Jeremie 2013/3/25 Jeremie BOUSQUET jeremie.bousq...@gmail.com Thanks Marius, that's exactly what I was looking for ! I'll follow that practice, BR, Jeremie 2013/3/20 Marius Dumitru Florea mariusdumitru.flo...@xwiki.com Hi Jeremie, We have started moving functional tests from xwiki-enterprise to xwiki-platform so that they are grouped by functional domain. Thus xwiki-enterprise-test-ui is not the best example. You should take a look at the platform modules that have functional tests: https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-administration https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-faq https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-index to name a few. The packager maven plugin is taking care of importing (installing) your XAR and (I believe) adding the required jar dependencies to the WAR. You should follow this practice. Hope this helps, Marius On Wed, Mar 20, 2013 at 1:07 PM, Jeremie BOUSQUET jeremie.bousq...@gmail.com wrote: Hello, I would like to discuss a little on writing of Selenium2 tests, as described in test strategy [1], ie use Selenium 2 and apply Page Objects pattern. My particular use-case is that I'm on a mission : write some functional tests for my mail archive application. I also think these would be the best tests for my app, as it greatly relies on 2 external interfaces (xwiki for persistence/conf, javamail and mail accounts on another side). There are some good unit tests to write of course, but the main logic
[xwiki-users] RSS feed including modifications
Hi! Please, is there any easy way of configuring the global wiki RSS feed of a XE 2.4.30451 to include both newly created and modified pages? Thanks! Ricardo -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada. See more languages: http://www.sergas.es/aviso_confidencialidad.htm ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users