├── .gitignore ├── lib-cloudy ├── .gitignore ├── js.jar ├── cpd-cfm.jar ├── mxunit-ant.jar ├── pmd-4.2.6.jar ├── ant-contrib-1.0b3.jar ├── jslint4java-2.0.1.jar ├── jslint4java-2.0.5.jar ├── MIT-License.txt └── LICENSE.txt ├── tests ├── .gitignore ├── HttpAntRunner.cfc ├── RemoteFacade.cfc ├── ui │ └── ASeleniumTest.cfc └── unit │ └── MyFirstTest.cfc └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | /testresults 2 | -------------------------------------------------------------------------------- /lib-cloudy/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | /testresults 2 | -------------------------------------------------------------------------------- /tests/HttpAntRunner.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.runner.HttpAntRunner"{} -------------------------------------------------------------------------------- /tests/RemoteFacade.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.framework.RemoteFacade" wsversion="1"{} -------------------------------------------------------------------------------- /lib-cloudy/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/js.jar -------------------------------------------------------------------------------- /lib-cloudy/cpd-cfm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/cpd-cfm.jar -------------------------------------------------------------------------------- /lib-cloudy/mxunit-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/mxunit-ant.jar -------------------------------------------------------------------------------- /lib-cloudy/pmd-4.2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/pmd-4.2.6.jar -------------------------------------------------------------------------------- /lib-cloudy/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /lib-cloudy/jslint4java-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/jslint4java-2.0.1.jar -------------------------------------------------------------------------------- /lib-cloudy/jslint4java-2.0.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhenke/Cloudy-With-A-Chance-Of-Tests/HEAD/lib-cloudy/jslint4java-2.0.5.jar -------------------------------------------------------------------------------- /lib-cloudy/MIT-License.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 MXUnit.org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /tests/ui/ASeleniumTest.cfc: -------------------------------------------------------------------------------- 1 | component extends="cfselenium.CFSeleniumTestCase" 2 | { 3 | 4 | function beforeTests(){ 5 | browserUrl = "http://www.google.com/"; 6 | browserCommand = "*googlechrome"; 7 | super.beforeTests();// If you *need* your own beforeTests(), you *must* call super to start selenium 8 | } 9 | 10 | function afterTests(){ 11 | super.afterTests();//same with afterTests 12 | } 13 | 14 | function sanity(){} 15 | 16 | function search_google_for_cfselenium_should_have_cfselenium_in_results(){ 17 | selenium.open("http://www.google.com"); 18 | debug(selenium.getHtmlSource()); 19 | 20 | selenium.type("q", "cfselenium"); 21 | sleep(1000);//because when you do this, google will automatically submit the form! No need to click 22 | 23 | assertTrue( selenium.isTextPresent("CFSelenium") ); 24 | } 25 | 26 | function search_google_for_selenium_page_object_pattern_when_you_get_serious_about_selenium(){ 27 | selenium.open("http://www.google.com"); 28 | debug(selenium.getHtmlSource()); 29 | 30 | selenium.type("q", "selenium page object design pattern"); 31 | sleep(1000);//because when you do this, google will automatically submit the form! No need to click 32 | 33 | assertTrue( selenium.isTextPresent("PageObjects") ); 34 | } 35 | } -------------------------------------------------------------------------------- /tests/unit/MyFirstTest.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.framework.TestCase"{ 2 | 3 | function beforeTests(){ 4 | //will run before any tests run 5 | } 6 | 7 | function afterTests(){ 8 | //will run after all tests run 9 | } 10 | 11 | function setUp(){ 12 | //will run before each test 13 | } 14 | 15 | function tearDown(){ 16 | //will run after each test 17 | } 18 | 19 | function check_out_coldfusion_koans_to_learn_about_coldfusion_and_testing(){ 20 | debug("https://github.com/bittersweetryan/ColdFusion-Koans"); 21 | } 22 | 23 | function how_to_configure_the_mxunit_eclipse_plugin(){ 24 | debug(" 25 | In Eclipse, highlight the 'cloudy...' project 26 | 27 | right click, select 'properties' 28 | 29 | select 'mxunit' 30 | 31 | in the 'RemoteFacade URL' field, add 'http://localhost/cloudy-with-a-chance-of-tests/tests/RemoteFacade.cfc' 32 | 33 | -- or whatever your server and path is 34 | 35 | hit 'ok' 36 | 37 | Then, right click the 'tests' folder, or any individual test (or select multiple tests) 38 | 39 | Select 'Run MXUnit Tests' 40 | 41 | Or hit 'Ctrl+Enter' on the keyboard 42 | "); 43 | } 44 | 45 | function this_thing_should_work(){ 46 | assertTrue( true , "should have been true but was not" ); 47 | assertEquals( 1, 1, "should have been equal but was not" ); 48 | } 49 | 50 | function this_will_fail_uh_oh(){ 51 | var fish = ["tuna", "salmon", "trout", "magpied huckleberry"]; 52 | var littlerFish = ["toona", "goldie", "squid", "whos-roe-daddy"]; 53 | 54 | /*you can compare complex data; 55 | if you're running this in Eclipse, select the test in the test tree and hit the "b" key for a visual representation of diffs 56 | 57 | then, hit the "compare" icon in the middle right of the plugin for a "diff" tool 58 | 59 | */ 60 | assertEquals( fish, littlerFish ); 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /lib-cloudy/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * The Apache Software License, Version 1.1 3 | * 4 | * Copyright (c) 2001-2003 Ant-Contrib project. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The end-user documentation included with the redistribution, if 19 | * any, must include the following acknowlegement: 20 | * "This product includes software developed by the 21 | * Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)." 22 | * Alternately, this acknowlegement may appear in the software itself, 23 | * if and wherever such third-party acknowlegements normally appear. 24 | * 25 | * 4. The name Ant-Contrib must not be used to endorse or promote products 26 | * derived from this software without prior written permission. For 27 | * written permission, please contact 28 | * ant-contrib-developers@lists.sourceforge.net. 29 | * 30 | * 5. Products derived from this software may not be called "Ant-Contrib" 31 | * nor may "Ant-Contrib" appear in their names without prior written 32 | * permission of the Ant-Contrib project. 33 | * 34 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 36 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 37 | * DISCLAIMED. IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS 38 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 41 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 43 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 44 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 45 | * SUCH DAMAGE. 46 | * ==================================================================== 47 | */ 48 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## What is Cloudy With A Chance Of Tests? 2 | 3 | Cloudy With A Chance Of Tests is a pared down ant build.xml. This build.xml can be used for Continuous Integration with ColdFusion (with or without unit tests). A syntax and other specific CFML inspections will occur setting the stage for testing and other progressions in the build.xml and your code base. 4 | 5 | Some targets in the build.xml are purposely left blank for place holders. 6 | 7 | The build.xml should be able to be used without any CFML code changes to your code base and only a few changes to build.properties that match your environment. 8 | 9 | Have fun, this is a journey not a sprint. Introduce this easy step, sit back and wait till your opportunity to do more Continuous Integration. 10 | 11 | ## Recorded Presentation, Slides, and Outline 12 | Recorded Presentation - ??? 13 | 14 | [Recorded Presentation (15 mins)](http://cfmumbojumbo.com/cf/index.cfm/bolttalks/bolt-talk-mike-henke-cloudy-with-a-chance-of-tests/) 15 | 16 | [Slides](http://prezi.com/ebyrqdkbnhie/cloudy-with-a-chance-of-tests/) 17 | 18 | [Outline](https://docs.google.com/document/d/1biLTSfLfZxdwLI78Jo2lID_w-pKAqnR63csfu8mT9EA/edit) 19 | 20 | ## Installation 21 | This build script is decoupled from the environment you can execute it in. You can use the command prompt, Eclipse IDE, or Jenkins with just a few changes to build.properties. 22 | 23 | 1. Please unzip and add the build.xml to your source control system in your top level folder and build.properties but ignore it from your scs. 24 | 1. Unzip and add the lib-cloudy folder with the jars at the top level of the project and to source control. 25 | 1. You will have to change some build.properties settings to match the environment it will run on. 26 | 1. To run the VarScope, QueryParam, and/or Unit/Acceptance tests, you will need to download and place them in the top level of the web server (not just the project top level). I would recommend excluding them from your source control system. 27 | 28 | * Folder name: varscoper4 - http://varscoper.riaforge.org/ 29 | * Folder name: qpscanner - http://qpscanner.riaforge.org/ 30 | * Folder name: mxunit - http://mxunit.org/ 31 | 32 | ##Unit and Acceptance tests 33 | You can also add more MXUnit tests. They are define where they are run from in the testing.mxunit target. "Dummy" tests already are setup for unit testing and acceptance testing. 34 | 35 | ##Database deployments 36 | TODO:Write Description of the sql/create and sql/update folders (hint: add sequentially named files to be run in order, like 0001.sql and 0002.sql) 37 | 38 | ## License 39 | This is licensed under [Creative CommonsAttribution-Noncommercial-Share Alike 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/us/) except for third party software which retains their licenses. 40 | 41 | ## Contributors / Originators 42 | 43 | Please add yourself if you help: 44 | 45 | * @denstar 46 | * @vitrix 47 | * @lmajano 48 | * @markdrew 49 | 50 | ## Git Workflow for Contributors 51 | This project uses the excellent [Git Workflow series](http://www.silverwareconsulting.com/index.cfm/Git-Workflow) by [Bob Silverburg](https://github.com/bobsilverberg/) for contributions. --------------------------------------------------------------------------------