Skip to content

Commit

Permalink
Switch from Ant / MXUnit / etc to CommandBox / TestBox
Browse files Browse the repository at this point in the history
  • Loading branch information
seancorfield committed Feb 24, 2017
1 parent aad5867 commit e35fe69
Show file tree
Hide file tree
Showing 41 changed files with 231 additions and 625 deletions.
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
WEB-INF/*
litepost/*
mxunit/*
wirebox/*
tests/ci/results
tests/ci/results/*
testbox/*
tests/results/
.project
settings.xml
.settings/org.eclipse.core.resources.prefs
# Intellij IDEA files
*.iml
*.ipr
*.idea
.ant-targets-build.xml
run-tests.sh
/examples/6helloclojure/target/stale/extract-native.dependencies
/taskmanager/
/server.json
35 changes: 23 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
language: java

sudo: required

env:
matrix:
- PLATFORM=acf10-linux64
- PLATFORM=railo42beta
- PLATFORM=railo41
- [email protected]
- ENGINE=lucee@5
- ENGINE=adobe@2016
- ENGINE=adobe@11
- ENGINE=adobe@10

before_install:
- sudo apt-key adv --keyserver keys.gnupg.net --recv 6DA70622
- sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a
/etc/apt/sources.list.d/commandbox.list

install:
- sudo apt-get update && sudo apt-get --assume-yes install commandbox
- box install

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/c3bc8e90100d9446a065
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
before_script:
- box server start cfengine=$ENGINE port=8500 openbrowser=false

install: ant -Dsource=remote -Dwork.dir=$HOME/work -Dbuild.dir=$TRAVIS_BUILD_DIR -Dplatform=$PLATFORM install-ci-deps
script: ant -Dsource=remote -Dwork.dir=$HOME/work -Dbuild.dir=$TRAVIS_BUILD_DIR -Dplatform=$PLATFORM test-ci
script: >
testResults="echo $(box testbox run reporter=mintext)";
echo "$testResults";
if grep -i "\[Failures: [1-9][0-9]\?[0-9]\?\]\|\[Errors: [1-9][0-9]\?[0-9]\?\]\|<t[^>]*>\|<b[^>]*>" <<< $testResults; then exit 1; fi
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,24 @@ Please read the [Framework One Code of Conduct](CODE_OF_CONDUCT.md) - we want FW

# Running the Tests

The Ant `build.xml` file is primarily designed to be used by Travis to run the tests automatically, but it is possible to run the tests locally, with some setup:
FW/1 is setup to run tests on [Travis CI](https://travis-ci.org/framework-one/fw1) using the `.travis.yml` file.

* This FW/1 directory needs to be a web root for some test domain on your local machine. I have `fw1.local` setup to resolve to this folder.
* You'll need MXUnit installed and accessible via `/mxunit` for the test domain you use for this project. You can install MXUnit into this FW/1 directory if you want - `mxunit/*` is on the `.gitignore` list.
To run tests manually, you'll need [CommandBox](https://www.ortussolutions.com/products/commandbox) installed.

You can run the build locally using a variant of this command (all on one line):
Then run `box install` once to install the dependencies (TestBox is the only one currently).

ant -Dplatform=railo41 -Dtest.path.root=/Developer/workspace/fw1 \
-Dcontext.root= -Dserver.name=fw1.local -Dserver.port=8080 \
run-tests-mxunit
Then start a server on port 8500 with your choice of CFML engine, e.g.,

See the `run-tests-example.sh` file for a template (for Mac/Linux).
box server start cfengine=lucee@5 port=8500

* `platform` needs to be set just to satisfy the build script it doesn't affect anything (so use `railo41` even if you're on ACF or a different version of Railo)
* `test.path.root` should be the filesystem path to this directory, i.e., the web root for the FW/1 project.
* `context.root` should probably be empty (unless you are using a named web application context)
* `server.name` should be the test domain you have configured
* `server.port` should be the port on which you access that test domain
* `run-tests-mxunit` is the actual Ant task that does the testing
This will open a browser, running the FW/1 "Introduction" app.

You can then run the tests:

box testbox run reporter=mintext

# Copyright and License

Copyright (c) 2009-2016 Sean Corfield (and others -- see individual files for additional copyright holders). All rights reserved.
Copyright (c) 2009-2017 Sean Corfield (and others -- see individual files for additional copyright holders). All rights reserved.
The use and distribution terms for this software are covered by the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) which can also be found in the file LICENSE at the root of this distribution and in individual licensed files.
By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
92 changes: 63 additions & 29 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,66 @@
{
"name" : "Framework One",
"slug" : "fw1",
"version" : "4.0.0",
"author" : "Sean Corfield, Marcin Szczepanski, Ryan Cogswell",
"location" : "https://github.com/framework-one/fw1/archive/develop.zip",
"createPackageDirectory" : true,
"packageDirectory" : "framework",
"Homepage" : "http://framework-one.github.io/",
"Documentation" : "http://framework-one.github.io/documentation/",
"Repository" : {
"type" : "git", "URL" : "https://github.com/framework-one/fw1.git"
},
"Bugs" : "https://github.com/framework-one/fw1/issues",
"shortDescription" : "FW/1 - Framework One - is a family of small, lightweight, convention-over-configuration frameworks, primarily for CFML.",
"description" : "FW/1 - Framework One - is a family of small, lightweight, convention-over-configuration frameworks, primarily for CFML. FW/1 itself provides MVC, DI/1 provides dependency injection (a.k.a. inversion of control), and AOP/1 provides aspect-oriented programming features on top of DI/1.",
"instructions" : "http://framework-one.github.io/documentation/",
"changelog" : "https://github.com/framework-one/fw1/commits/master",
"type" : "mvc",
"keywords" : [ "fw1", "framework one", "mvc", "conventions" ],
"private" : "false",
"engines" : [
{ "type" : "railo", "version" : ">=4.1.x" },
{ "type" : "lucee", "version" : ">=4.5.x" },
{ "type" : "adobe", "version" : ">=10.0.x" }
"name":"Framework One",
"slug":"fw1",
"version":"4.0.0",
"author":"Sean Corfield, Marcin Szczepanski, Ryan Cogswell",
"location":"https://github.com/framework-one/fw1/archive/develop.zip",
"createPackageDirectory":true,
"packageDirectory":"framework",
"Homepage":"http://framework-one.github.io/",
"Documentation":"http://framework-one.github.io/documentation/",
"Repository":{
"type":"git",
"URL":"https://github.com/framework-one/fw1.git"
},
"Bugs":"https://github.com/framework-one/fw1/issues",
"shortDescription":"FW/1 - Framework One - is a family of small, lightweight, convention-over-configuration frameworks, primarily for CFML.",
"description":"FW/1 - Framework One - is a family of small, lightweight, convention-over-configuration frameworks, primarily for CFML. FW/1 itself provides MVC, DI/1 provides dependency injection (a.k.a. inversion of control), and AOP/1 provides aspect-oriented programming features on top of DI/1.",
"instructions":"http://framework-one.github.io/documentation/",
"changelog":"https://github.com/framework-one/fw1/commits/master",
"type":"mvc",
"keywords":[
"fw1",
"framework one",
"mvc",
"conventions"
],
"License" : [
{ "type" : "Apache 2.0", "URL" : "http://www.apache.org/licenses/LICENSE-2.0" }
"private":"false",
"engines":[
{
"type":"railo",
"version":">=4.1.x"
},
{
"type":"lucee",
"version":">=4.5.x"
},
{
"type":"adobe",
"version":">=10.0.x"
}
],
"Contributors" : [ {"name": "Contributors List", "url": "https://github.com/framework-one/fw1/graphs/contributors"} ],
"ignore" : [ ]
}
"License":[
{
"type":"Apache 2.0",
"URL":"http://www.apache.org/licenses/LICENSE-2.0"
}
],
"Contributors":[
{
"name":"Contributors List",
"url":"https://github.com/framework-one/fw1/graphs/contributors"
}
],
"ignore":[

],
"devDependencies":{
"testbox":"^2.3.0+00044"
},
"installPaths":{
"testbox":"testbox"
},
"testbox":{
"runner":"http://localhost:8500/tests/runner.cfm"
}
}
142 changes: 0 additions & 142 deletions build.xml

This file was deleted.

15 changes: 0 additions & 15 deletions run-tests-example.sh

This file was deleted.

11 changes: 11 additions & 0 deletions server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"app":{
"cfengine":"lucee@5"
},
"web":{
"http":{
"port":"8500"
}
},
"openbrowser":"false"
}
6 changes: 3 additions & 3 deletions tests/AddBeanTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ component extends="mxunit.framework.TestCase" {
.declare( "known" ).asValue( 42 ).done();
}

function shouldHaveKnownValue() {
function testHaveKnownValue() {
assertEquals( 42, variables.added.getBean( "known" ) );
}

function shouldBeSingleton() {
function testBeSingleton() {
assertTrue( variables.added.isSingleton( "known" ) );
}

function shouldHaveKnownMetadata() {
function testHaveKnownMetadata() {
var info = variables.added.getBeanInfo( "known" );
assertEquals( 42, info.value );
assertTrue( info.isSingleton );
Expand Down
Loading

0 comments on commit e35fe69

Please sign in to comment.