Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
TestBox 2.8.0 is a minor release with some great new functionality and tons of fixes. You can find the release notes here and the major updates for this release.
[TESTBOX-224] - Bug on SimpleReporter name not complete
[TESTBOX-231] - Recurse parameter not honored #71 on html runner
[TESTBOX-232] - Junit reporter blows up on null values in server scope
[TESTBOX-233] - Update Expectation.cfc
to make toMatchWithCase
consistent as it is not working
[TESTBOX-225] - Add ability to exclude labels from running using `url.excludes`
[TESTBOX-230] - Incompatibilities with Adobe on many isValid
and isInstanceOf
TestBox 2.7.0 is a minor release with some great new functionality and tons of fixes. You can find the release notes here and the major updates for this release.
[TESTBOX-217] - new version of Lucee has complex values in UDF implementation that breaks the mock generator
[TESTBOX-222] - Heap issues and stack overflow issues when normalizing ORM entities in mocking arguments
[TESTBOX-221] - Complete refactoring of around,before,after each executions to support concurrency
[TESTBOX-219] - some refactoring to use invoke()
instead of evaluate()
[TESTBOX-220] - some speed improvements by not using createuuid
anymore
TestBox 2.6.0 is a minor release with some great new functionality and tons of fixes. You can find the release notes here and the major updates for this release.
The methods aroundEach(), beforeEach() and afterEach()
can now be chained as they return the Base Spec as well. So get funky with the DSL.
You can now pass null
into an expectation and TestBox will gracefully represent it instead of blowing up!
Thanks to Pixilation method mocking performance has sky rocketed. He changed the filename generation to an MD5 hash of the code, and disabled removing the files. This allows TestBox to leverage ColdFusion template caching. This reduces the time that $()
takes from ~30 ms to ~0 ms. It is a happy day for mocking!
We have added a new argument to all TestBox run(), runRemote(), runRaw()
commands: eagerFailure
, which defaults to false
. If this is turned on, then TestBox will gracefully short-circuit out of testing further Test Bundles if it finds any failures or errors on previous ones. This is useful for large suites that you want to stop testing if a failure is discovered.
This was another community driven contribution by Ian Burns - iwburns to help those folks with Color Blindness. You can see the differences in color in the github pull request: https://github.com/Ortus-Solutions/TestBox/pull/60
Before
After
x
exclusion MethodsYou can now prefix the following methods with the letter x
to exclude them from execution:
story()
given()
when()
then()
feature()
[TESTBOX-196] - Assertion argument order does not match testbox.system.assertion for the expected argument
[TESTBOX-199] - MockBox method subs are leaking whitespace
[TESTBOX-203] - Labels in an it() are ignored
[TESTBOX-215] - The recurse checkbox in test-runner doesn't work
[TESTBOX-216] - TestBox doesn't handle an interface CFC in the specs folder and chokes
[TESTBOX-195] - Return this from around,beforeEach and afterEach to have a chained DSL thanks to Jose Chavez
[TESTBOX-200] - Output null representation in output message
[TESTBOX-201] - wrap bundle runner execution in try/catch with rethrow
[TESTBOX-202] - Improved method mocking performance
[TESTBOX-204] - Provide a way to mute debug buffer on marshalled results
[TESTBOX-205] - Add eager failure argument to runner so if set and a bundle fails no more bundles are tested after
[TESTBOX-208] - Use correct key casing in report output
[TESTBOX-210] - switch pass/failed/error colors to help color blindness
[TESTBOX-211] - Exclude empty test suites from ANT JUnit Reporting
[TESTBOX-212] - Add x- methods to skip suites and specs to new BDD methods.
[TESTBOX-214] - Don't re-mock already mocked objects. #63
TestBox is a next generation testing framework for ColdFusion (CFML) that is based on BDD (Behavior Driven Development) for providing a clean obvious syntax for writing tests. It contains not only a testing framework, runner, assertions and expectations library but also ships with MockBox, A mocking and stubbing companion. It also supports xUnit style of testing and MXUnit compatibilities.
Here are a simple listing of features TestBox brings to the table:
BDD style testing
xUnit style testing
Testing life-cycle methods
MockBox integration for mocking and stubbing
Ability to extend and create custom test runners
Ability to extend and create custom test reporters
Extensible reporters, bundled with tons of them:
JSON
XML
JUnit 4 XML
Text (80's style)
Console
TAP (Test Anything Protocol)
Simple HTML
Min - Minimalistic Heaven
Raw
CommandBox
Asynchronous testing
Multi-suite capabilities
Test skipping
Suite skipping
Dynamic skipping support via runtime executions
Test one or more suites exclusively
Test one or more tests/specs exclusively
Test labels and tagging
Testing debug output stream
Clickable suite titles to filter test execution
Much more!
TestBox is maintained under the Semantic Versioning guidelines as much as possible.Releases will be numbered with the following format:
And constructed with the following guidelines:
Breaking backward compatibility bumps the major (and resets the minor and patch)
New additions without breaking backward compatibility bumps the minor (and resets the patch)
Bug fixes and misc changes bumps the patch
TestBox and MockBox are open source and licensed under the Apache 2 License. If you use them please try to make mention of it in your code or web site.
Copyright by Ortus Solutions, Corp
TestBox is a registered trademark by Ortus Solutions, Corp
Info: The ColdBox Websites, Documentation, logo and content have a separate license and they are a separate entity.
BoxTeam Slack : https://boxteam.herokuapp.com
CFML Slack: Look for the box-products
channel: http://cfml.slack.com
We all make mistakes from time to time :) So why not let us know about it and help us out. We also love pull requests, so please star us and fork us: https://github.com/Ortus-Solutions/TestBox
TestBox is a professional open source software backed by Ortus Solutions, Corp offering services like:
Custom Development
Professional Support & Mentoring
Training
Server Tuning
Security Hardening
Code Reviews
Official Site: https://www.ortussolutions.com/products/testbox
Current API Docs: http://apidocs.ortussolutions.com/testbox/current
Source Code: https://github.com/Ortus-Solutions/TestBox
Bug Tracker : https://ortussolutions.atlassian.net/browse/TESTBOX
Twitter: @ortussolutions
Facebook: https://www.facebook.com/ortussolutions
Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.
Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. - Romans 5:5
TestBox 2.5.0 is a minor release with some great new functionality and tons of fixes. You can find the release notes here and the major updates for this release. One of the biggest features for TestBox that was not part of TestBox, was the addition of TestBox Watchers to CommandBox.
CommandBox CLI has added watching capabilities to the testbox
namespace. Which means you can now run the following command in the root of your project: testbox watch
and it will monitor all your CFCs for changes. If a change is detected, then it will fire the new testbox run
command with our CLI reporter.
We had introduced spec data binding in TestBox for creating dynamic specs and passing dynamic data into them. We have extended this feature into life-cycle methods:
beforeEach()
afterEach()
aroundEach()
You can now pass in an argument called data
which is a struct of dynamic data to pass into the life-cycle method. You can then pickup this data in the closure for the life-cycle. Here is a typical example:
[] - Simple reporter broken on Adobe servers
[] - HTML Runner links should include directory param
[] - AsyncAll Errroring on xUnit runner
[] - the 'type' argument was being ignored if the 'regex' argument was provided and matched the exception data
[] - Remove thread scope from debug stream
[] - Passing Data to Dynamic Tests via life-cycle methods: around, after, before
[] - Preserve whitespace in HTML (simple) Reporter
[] - Include TestBox version in TestResult memento
[] - Let travis handle upload of api docs and snapshot binaries
[] - Aggregate suite stats from nested suties
TestBox 2.2.0 is a minor release with some great new functionality and tons of fixes.
Bugs
[TESTBOX-48] - Syntax error in docs for Assertion Registration
[TESTBOX-49] - Docs for Assertion CFCs inadequate, or functionality just doesn't work?
[TESTBOX-120] - MXUnit injectMethod not working if calls to methods being replaced are not "this" scoped
[TESTBOX-122] - Order of args for init function did not match the interface
[TESTBOX-134] - Mockbox: object instances as args do not always pass comparison
New Features
[TESTBOX-129] - throwErrorCode addition to mock method generator
[TESTBOX-132] - Ability to bind data to a spec
[TESTBOX-133] - Support story-given-when-then style of representing tests
[TESTBOX-136] - MockBox no longer standalone package
[TESTBOX-138] - run method listeners so you can do callbacks on testing progress
Improvements
[TESTBOX-121] - Ability to read assets from current directory to support lucee
[TESTBOX-124] - Support Lucee's localMode="modern"
[TESTBOX-126] - it() callback should not need to be a closure
[TESTBOX-130] - Mocking method CallBack argument receives all arguments now.
[TESTBOX-135] - Change toIncludeWithCase arguments to match toInclude
TestBox 2.3.0 is a minor release with some great new functionality and tons of fixes. This release has been a great community effort as many people in the community contributed to its release.
Bug
[TESTBOX-123] - If test spec descriptor contains a comma, it can not be drilled down to run that one spec directly
[TESTBOX-140] - Allow Mocking of an Interface that implements another interface
[TESTBOX-158] - Give line number when an expectation fails or errors out
New Feature
[TESTBOX-150] - new expressive exception throwing goodness: $throws()
[TESTBOX-161] - Recursively call parent `aroundEach` functions in reverse tree format
[TESTBOX-162] - Add annotation hooks for lifecycle methods
[TESTBOX-163] - remove the TestBox tag contexts from the beginning of Failure Origins
[TESTBOX-164] - Make test harness easier for development via CommandBox
[TESTBOX-165] - Add travis build support for supporting pull requests and test matrixes
[TESTBOX-166] - Update API Docs to leverage DocBox instead
Improvement
[TESTBOX-160] - Explicitly place the instance "scope" in the variables scope due to lucee full cascade support
[TESTBOX-167] - update string buffers to string builders
TestBox 2.4.0 is a minor release with some great new functionality and tons of fixes. This release has been a great community effort as many people in the community contributed to its release. Special thanks to Eric Peterson, Joe Gooch and Sean Corfield for their additions, testing and contributions.
toSatisfy
matcherThis new matcher is thanks to Sean Corfield. It allows you to create your own closure that will evaluate the expectation and then decide if it passes the given truth test.
expectAll()
collection expectationSean was busy in this release and provided us with this awesome feature in which you can call on a new expectAll()
and pass either an array or struct. TestBox will then iterate for you and call all the chained matchers upon the collection items.
mintext
ReporterThis new reporter is to enhance console based runners in order for the report to be more legible.
You can now use a toBeJSON()
matcher or a $assert.isJSON
assertion.
runRemote
You no longer need to pass ?method=runRemote
in the URL when executing a test bundle via the URL. This will automatically be added for you.
Thanks to Joe Gooch you can now use the new methods in the TestBox cfc
addDirectory()
addDirectories()
addBundles()
You can chain them as you see fit and they will aggregate the specs collected.
Here is the full release notes for this release
[TESTBOX-169] - discover if fail origin exists in errors and failures, else ignore as it causes issues
[TESTBOX-170] - Custom reporter passed as CFC instance doesn't work
[TESTBOX-171] - New mintext reporter
[TESTBOX-172] - new matcher toBeJSON and new assertion isJSON
[TESTBOX-175] - No need to pass method=runRemote anymore on spec runners, defaults now
[TESTBOX-176] - Implements fluent API - addDirectory,addBundles,addDirectories on TestBox Core
[TESTBOX-168] - runRemote operations are not setting the default response to HTML, so wddx takes over
[TESTBOX-173] - Add toSatisfy( predicate ) matcher
[TESTBOX-174] - Add expectAll() to make it easier to work with collections
The source code for this book is hosted in GitHub: https://github.com/Ortus-Solutions/testbox-docs. You can freely contribute to it and submit pull requests. The contents of this book is copyright by Ortus Solutions, Corp and cannot be altered or reproduced without author's consent. All content is provided "As-Is" and can be freely distributed.
The majority of code examples in this book are done in cfscript
.
The majority of code generation and running of examples are done via CommandBox: The ColdFusion (CFML) CLI, Package Manager, REPL - http://www.ortussolutions.com/products/commandbox
All ColdFusion examples designed to run on the open soure Railo Platform or Adobe ColdFusion 9.0.2+
Flash, Flex, ColdFusion, and Adobe are registered trademarks and copyrights of Adobe Systems, Inc.
The information in this book is distributed “as is”, without warranty. The author and Ortus Solutions, Corp shall not have any liability to any person or entity with respect to loss or damage caused or alleged to be caused directly or indirectly by the content of this training book, software and resources described in it.
We highly encourage contribution to this book and our open source software. The source code for this book can be found in our GitHub repository where you can submit pull requests.
15% of the proceeds of this book will go to charity to support orphaned kids in El Salvador - http://www.harvesting.org/. So please donate and purchase the printed version of this book, every book sold can help a child for almost 2 months.
Shalom Children’s Home (http://www.harvesting.org/) is one of the ministries that is dear to our hearts located in El Salvador. During the 12 year civil war that ended in 1990, many children were left orphaned or abandoned by parents who fled El Salvador. The Benners saw the need to help these children and received 13 children in 1982. Little by little, more children werecame on their own, churches and the government brought children to them for care, and the Shalom Children’s Home was founded.
Shalom now cares for over 80 children in El Salvador, from newborns to 18 years old. They receive shelter, clothing, food, medical care, education and life skills training in a Christian environment. The home is supported by a child sponsorship program.
We have personally supported Shalom for over 6 years now; it is a place of blessing for many children in El Salvador that either have no families or have been abandoned. This is good earth to seed and plant.
Luis has a passion for Jesus, tennis, golf, volleyball and anything electronic. Random Author Facts:
He played volleyball in the Salvadorean National Team at the tender age of 17
The Lord of the Rings and The Hobbit is something he reads every 5 years. (Geek!)
His first ever computer was a Texas Instrument TI-86 that his parents gave him in 1986. After some time digesting his very first BASIC book, he had written his own tic-tac-toe game at the age of 9. (Extra geek!)
He has a geek love for circuits, microcontrollers and overall embedded systems.
He has of late (during old age) become a fan of running and bike riding with his family.
Keep Jesus number one in your life and in your heart. I did and it changed my life from desolation, defeat and failure to an abundant life full of love, thankfulness, joy and overwhelming peace. As this world breathes failure and fear upon any life, Jesus brings power, love and a sound mind to everybody!
“Trust in the LORD with all your heart, and do not lean on your own understanding.” Proverbs 3:5
Jorge started working as project manager and business developer at Ortus Solutions, Corp. in 2013, . At Ortus he fell in love with software development and now enjoys taking part on software development projects and software documentation! He is a fellow Cristian who loves to play the guitar, worship and rejoice in the Lord!
Therefore, if anyone is in Christ, the new creation has come: The old has gone, the new is here! 2 Corinthians 5:17
TestBox 2.1.0 is a minor release with some great new functionality and tons of fixes.
Bugs Fixed
Better whitespace management on text enabled reporting
ColdFusion 11 compatibilities
ColdFusion 9 support on xUnit and Assertions
HTML Runners now have a high request timeout for long-lasting tests
TestBox's debug()
method has been enhanced to provide greater messages and telemetry. You can even control the depth of the dumps of each of the debugged data as it is sent. Here is the new signature:
The output will now include information as to what spec produced the output, timestamps, data, and thread data.
You can now chain your matchers on a specific expectation to produce an even nicer DSL when trying to assert data on a single expectation:
AroundEach()
Life-Cycle MethodWe have added a new life-cycle method to the suites called aroundEach()
which will completely wrap your spec in another closure. This is an elegant way for you to provide a complete around AOP advice to a specificiation. You can use it to surround the execution in transaction blocks, ORM rollbacks, logging, and so much more. This life-cycle method will decorate ALL specificiations within a single suite. The method signature is below:
The method receives a structure of data representing the spec
. This contains the following elements:
body : The actual closure for the spec that you will use to execute within it.
labels : The labels used in the spec
name : The name of the spec
order : The order of execution of the spec
skip : The skip flag or closure that determines if the spec runs
The method also receives a structure of metadata about the suite this spec is contained in. It has information about life-cycle closures, async information, names, parents, etc. Here is a very practical example of creating and around each closure to provide rollbacks for specs:
This simple around each life-cycle closure will rollback ALL my spec's executions even if they throw exceptions.
The simple reporter has been enhanced to add a bundle test filter that can help reduce noise when looking for a specific bundle result:
run()
EnhancementsThe traditional BDD run()
has been enhanced so it now receives the TestBox TestResults object as a reference and TestBox as a reference. This way you can have more metadata and access to what will be reported to users in a reporter. You can also use it to decorate it or store much more information that can be picked up later by reports. You also have access to the TestBox class so you can see how the test is supposed to execute, what labels was it passed, directories, options, etc.
Luis Majano is a Computer Engineer with over 16 years of software development and systems architecture experience. He was born in in the late 70’s, during a period of economical instability and civil war. He lived in El Salvador until 1995 and then moved to Miami, Florida where he completed his Bachelors of Science in Computer Engineering at . Luis resides in The Woodlands, Texas with his beautiful wife Veronica, baby girl Alexia and baby boy Lucas!
He is the CEO of , a consulting firm specializing in web development, ColdFusion (CFML), Java development and all open source professional services under the ColdBox and ContentBox stack. He is the creator of ColdBox, ContentBox, WireBox, MockBox, LogBox and anything “BOX”, and contributes to many open source ColdFusion projects. He is also the Adobe ColdFusion user group manager for the . You can read his blog at
Jorge is an Industrial and Systems Engineer born in El Salvador. After finishing his Bachelor studies at the Monterrey Institute of Technology and Higher Education , Mexico, he went back to his home country where he worked as the COO of. In 2012 he left El Salvador and moved to Switzerland in persuit of the love of his life. He married her and today he resides in Basel with his lovely wife Marta and their daughter Sofía.
[] - isEqual on Query fails when queries are equal
[] - equalize fails on struct/objects/arrays when null values exist within them
[] - Floating Point Number isEqual Fails
[] - Specs with the same name cause thread name exceptions when using async
[] - Download file has "samples" instead of "tests" directory
[] - tobe() cannot handle sparse arrays on Adobe CF
[] - xUnit compatibility CF9 broken due to isClosure() being utilized
[] - skip closures get more metadata arguments when being executed.
[] - testbox errors when using complete null support in railo
[] - Have debug() include information about where it came from
[] - remove extra whitespace in text reporter
[] - Remove CF7,8 incompatibilities
[] - ColdFusion 11 cfinclude compatibilities
[] - BDD run() method now receive the TestResults argument for usage in their definitions.
[] - BDD runner and specs receive reference to the TestBox calling class via the run() method
[] - Update the apidocs with our new DocBox skin
[] - Debug labels and telemetry additions
[] - Add "top" attribute to debug method
[] - HTMLRunner add big request timeout setting to avoid server cut offs
[] - have expectations assertions return the expectation to allow chaining
[] - Simple reporter includes now a test bundle filter
[] - New lifecycle method: aroundEach() so you can do a full AOP advice on any spec
New searchable API Docs with new skin: