├── mxunit ├── framework │ ├── .gitignore │ ├── mightymock │ │ ├── AbstractMock.cfc │ │ ├── MockLogger.cfc │ │ ├── MockFactory.cfc │ │ ├── MightyMockFactory.cfc │ │ ├── todo │ │ └── MockDebug.cfc │ ├── lib │ │ ├── xom-1.2.6.jar │ │ └── tagsoup-1.2.jar │ ├── javaloader │ │ ├── lib │ │ │ └── classloader-20100119110136.jar │ │ ├── support │ │ │ ├── spring │ │ │ │ └── lib │ │ │ │ │ ├── spring-coldfusion.jar │ │ │ │ │ └── spring-coldfusion-src.zip │ │ │ └── cfcdynamicproxy │ │ │ │ └── lib │ │ │ │ ├── cfcdynamicproxy.jar │ │ │ │ └── cfcdynamicproxy-src.zip │ │ ├── readme.txt │ │ └── tags │ │ │ └── directory.cfm │ ├── decorators │ │ ├── AlphabeticallyOrderedTestsDecorator.cfc │ │ ├── TransactionRollbackDecorator.cfc │ │ ├── OrderedTestDecorator.cfc │ │ └── MinimumVersionDecorator.cfc │ ├── Test.cfc │ ├── adapters │ │ └── cf9 │ │ │ └── PublicProxyMaker.cfc │ ├── VersionReader.cfc │ ├── QueryTestResult.cfc │ └── HamcrestAssert.cfc ├── buildprops │ ├── .gitignore │ ├── antrunner_sample.properties │ ├── unames_example.properties │ ├── version.properties │ ├── nightlyversion.properties │ ├── testresultsmail.html │ └── scripts │ │ └── http_doc_gen.js ├── ftp.listing ├── tests │ ├── framework │ │ ├── fixture │ │ │ ├── interfaces │ │ │ │ ├── OtherInterface.cfc │ │ │ │ ├── AnInterface.cfc │ │ │ │ ├── SubInterface.cfc │ │ │ │ └── AComponent.cfc │ │ │ ├── xpath │ │ │ │ └── nodes.html │ │ │ ├── dataproviders │ │ │ │ ├── CSVWithoutHeaders.csv │ │ │ │ ├── SimpleCSV.csv │ │ │ │ ├── SimpleExcel.xls │ │ │ │ └── ExcelWithoutHeaders.xls │ │ │ ├── fixturetests │ │ │ │ ├── SubClassWithNoMethodsTest.cfc │ │ │ │ ├── SuperClassWithPrivateMethodsTest.cfc │ │ │ │ ├── SomeRandomTest.cfc │ │ │ │ ├── AnotherRandomTests.cfc │ │ │ │ └── AnotherRandomTest.cfc │ │ │ ├── ATestSuite.cfc │ │ │ ├── MockFactory.cfc │ │ │ ├── ComparatorTestData.cfc │ │ │ ├── ParentWithPrivateMethods.cfc │ │ │ ├── DataProviderFixture.cfc │ │ │ ├── Mocking.cfc │ │ │ ├── MyCFC.cfc │ │ │ ├── TestAssertComponent.cfc │ │ │ ├── decorators │ │ │ │ ├── StoreTestNameDecorator.cfc │ │ │ │ └── IgnoreFunnyFunctionsDecorator.cfc │ │ │ ├── TestWithExpectedExceptionAttributes.cfc │ │ │ ├── mxunit-TestCase-Template.cfc │ │ │ ├── NewCFComponent.cfc │ │ │ └── MyCFCTest.cfc │ │ ├── DynamicTestCaseGenerationTest.cfc │ │ ├── adapters │ │ │ └── cf9 │ │ │ │ └── PublicProxyMakerTest.cfc │ │ ├── AssertionChainingTest.cfc │ │ ├── VersionReaderTest.cfc │ │ ├── HamcrestMatcherTest.cfc │ │ ├── TestDecoratorTest.cfc │ │ ├── TestTest.cfc │ │ ├── QueryTestResultTest.cfc │ │ ├── HtmlTestResultTest.cfc │ │ ├── CSVUtilityTest.cfc │ │ └── TestCaseExtendsTest.cfc │ ├── install │ │ └── fixture │ │ │ ├── test.cfm │ │ │ └── index.cfm │ ├── mightymock │ │ ├── fixture │ │ │ ├── Mockery.cfc │ │ │ ├── Helper.cfc │ │ │ ├── AcceptStrictType.cfc │ │ │ ├── Dummy.cfc │ │ │ ├── Mockify.cfc │ │ │ ├── ParentSpyObject.cfc │ │ │ ├── FileDeleter.cfc │ │ │ ├── MySpyObject.cfc │ │ │ └── MyComponent.cfc │ │ ├── MockLoggerTest.cfc │ │ ├── AbstractMockTest.cfc │ │ ├── CaseSensitivtyTest.cfc │ │ ├── MockDebugTest.cfc │ │ ├── StateTransitionTest.cfc │ │ ├── PatternInvocationTest.cfc │ │ ├── FileDeleterTest.cfc │ │ ├── BasicMXUnitIntegrationTest.cfc │ │ ├── MockifyTest.cfc │ │ ├── TypeParserTest.cfc │ │ ├── BaseTest.cfc │ │ ├── WilcardPatternTest.cfc │ │ └── MockPlayTest.cfc │ ├── bugs │ │ ├── fixture │ │ │ ├── 122 │ │ │ │ ├── GoodTest.cfc │ │ │ │ └── ParseErrorTest.cfc │ │ │ ├── 93sample.cfc │ │ │ ├── test-with_hyphen.cfc │ │ │ └── test_with_underscore.cfc │ │ ├── 90.cfc │ │ ├── 105ExtendedTest.cfc │ │ ├── 105.cfc │ │ ├── 93.cfc │ │ ├── 149Test.cfc │ │ ├── run-me │ │ │ ├── test-with_hyphen.cfc │ │ │ └── test_with_underscore.cfc │ │ ├── Bug115.cfc │ │ ├── bug126.cfc │ │ └── ExpectedExceptionBug147Test.cfc │ ├── build.properties │ ├── compatability │ │ └── DoesNotHaveTestAtEndOrBegining.cfc │ ├── samples │ │ ├── MyComponent.cfc │ │ ├── MyComponentTest.cfc │ │ └── MyOtherComponentTest.cfc │ ├── ant │ │ ├── commitSvnTest.xml │ │ ├── build.xml │ │ └── svnUpdateTest.xml │ ├── runner │ │ └── HTMLRunnerTest.cfc │ ├── run.cfm │ └── utils │ │ └── TestBubbleSort.cfc ├── lib │ ├── mail.jar │ ├── activation.jar │ ├── varscoper.jar │ ├── ant-googlecode.jar │ ├── ant-contrib-1.0b3.jar │ ├── commons-net-1.4.1.jar │ └── jakarta-oro-2.0.8.jar ├── samples │ ├── HttpAntRunner.cfc │ ├── TestCaseSkeleton.cfc │ ├── MyComponent.cfc │ ├── tests │ │ ├── myTestSuite.cfm │ │ ├── MyComponentTest.cfc │ │ └── TestCaseSkeletonTest.cfc │ ├── mocking │ │ ├── TheComponent.cfc │ │ ├── TheCollaborator.cfc │ │ ├── TheStubTest.cfc │ │ └── TheMockTest.cfc │ ├── SimpleRunSkeleton.cfm │ ├── MyTestSuite.cfm │ ├── DirectoryTestSuiteSample.cfm │ ├── ScheduledRun.cfm │ ├── MyComponentTest.cfc │ ├── PluginSimulator.cfm │ └── MyOtherComponentTest.cfc ├── generator │ ├── no-bugs.gif │ ├── MXUnit_Parameter_Types_for_Automatic_Test_Generation.doc │ ├── generator.js │ ├── main.css │ └── templates │ │ ├── FailNewTagStyle.xslt │ │ ├── FailNew.xslt │ │ └── SucceedNew.xslt ├── images │ ├── bug_green.gif │ └── MXUnit-Small.png ├── ant │ ├── lib │ │ └── mxunit-ant.jar │ ├── stylesheets │ │ ├── antmanual.css │ │ └── style.css │ └── README.txt ├── resources │ ├── jquery │ │ ├── tablesorter │ │ │ ├── blue │ │ │ │ ├── asc.gif │ │ │ │ ├── bg.gif │ │ │ │ ├── blue.zip │ │ │ │ ├── desc.gif │ │ │ │ └── style.css │ │ │ └── green │ │ │ │ ├── up.png │ │ │ │ ├── down.png │ │ │ │ ├── default.png │ │ │ │ └── style.css │ │ ├── tipsy │ │ │ ├── images │ │ │ │ └── tipsy.gif │ │ │ └── stylesheets │ │ │ │ └── tipsy.css │ │ └── spark.cfm │ └── theme │ │ ├── footer.cfm │ │ └── styles.css ├── experimental_ant │ └── copydictionary.properties ├── .gitignore ├── PluginDemoTests │ ├── inheritance │ │ ├── SomeExtendingTest.cfc │ │ ├── BaseTest.cfc │ │ └── SomeDoublyExtendingTest.cfc │ ├── FiveSecondTest.cfc │ ├── TestOrdering │ │ ├── AlphabeticallyOrderedTest.cfc │ │ └── DefaultOrderedTest.cfc │ ├── weirderrordemos │ │ ├── extends │ │ │ ├── SomeTest.cfc │ │ │ └── Extends.cfc │ │ ├── BustedSetupTest.cfc │ │ ├── BustedTearDownTest.cfc │ │ └── BustedConstructorTest.cfc │ ├── SubDir │ │ ├── AnotherSubDir │ │ │ ├── TestSomething.cfc │ │ │ ├── SomeComponentWithStuff.cfc │ │ │ ├── AnotherTest.cfc │ │ │ └── SomeOtherTest.cfc │ │ └── CFUnitStyleTest.cfc │ ├── SingleFailureTest.cfc │ ├── EmptyTest.cfc │ ├── ExpectedExceptionTest.cfc │ ├── InvalidMarkupTest.cfc │ ├── ThrowsAnErrorTest.cfc │ ├── SomeObject.cfc │ ├── ComplexExceptionTypeErrorTest.cfc │ ├── CFScriptExpectedExceptionTest.cfc │ ├── SingleMethodTest.cfc │ ├── run.cfm │ ├── DoubleMethodTest.cfc │ ├── PrivateMethodTest.cfc │ └── build.xml ├── eclipse │ ├── snippets │ │ ├── mxunit │ │ │ ├── assert │ │ │ │ ├── fail.xml │ │ │ │ ├── assertIsArray.xml │ │ │ │ ├── assertIsEmpty.xml │ │ │ │ ├── assertIsQuery.xml │ │ │ │ ├── assertIsStruct.xml │ │ │ │ ├── assertIsDefined.xml │ │ │ │ ├── assertSame.xml │ │ │ │ ├── assertEquals.xml │ │ │ │ ├── assertIsTypeOf.xml │ │ │ │ ├── assertIsXMLDoc.xml │ │ │ │ ├── assertNotSame.xml │ │ │ │ ├── assertTrue.xml │ │ │ │ ├── assertFalse.xml │ │ │ │ ├── assertNotEquals.xml │ │ │ │ ├── addAssertDecorator.xml │ │ │ │ └── try catch error path.xml │ │ │ ├── helpers │ │ │ │ ├── debug.xml │ │ │ │ ├── makepublic.xml │ │ │ │ ├── injectMethod.xml │ │ │ │ ├── cfquerysim.xml │ │ │ │ ├── injectProperty.xml │ │ │ │ ├── test-time override function.xml │ │ │ │ └── querysim.xml │ │ │ ├── setUp cfscript.xml │ │ │ ├── setUp.xml │ │ │ ├── tearDown cfscript.xml │ │ │ ├── tearDown.xml │ │ │ ├── new test function cfscript.xml │ │ │ ├── new test function.xml │ │ │ ├── new test error path function cfscript.xml │ │ │ ├── new test error path function.xml │ │ │ ├── new MXUnit TestCase cfscript.xml │ │ │ ├── testrunner │ │ │ │ ├── Directory Test Suite Skeleton.xml │ │ │ │ └── Simple Scheduled Test Run Template.xml │ │ │ └── new MXUnit TestCase.xml │ │ ├── readme.txt │ │ └── keyCombos.properties │ └── dictionary │ │ └── readme.txt ├── README-toc.xml ├── README.txt ├── mxunit-TestSuiteTemplate.cfm ├── README.textile ├── doc │ └── colddoc │ │ └── strategy │ │ └── api │ │ └── resources │ │ └── templates │ │ ├── allclasses-frame.html │ │ ├── package-frame.html │ │ ├── .tmp_package-frame.html.16014~ │ │ ├── overview-frame.html │ │ ├── .tmp_overview-frame.html.21513~ │ │ ├── index.html │ │ ├── .tmp_index.html.25338~ │ │ ├── overview-summary.html │ │ └── .tmp_overview-summary.html.91099~ ├── mxunit-TestCase-Template.cfc ├── runner │ ├── runner.js │ ├── HtmlRunner.cfc │ └── index.cfm ├── MIT-License.txt ├── README.html └── utils │ └── BubbleSort.cfc ├── cfkoanslogo.png ├── .gitignore ├── Koans ├── BaseKoan.cfc ├── AboutComponents.cfc ├── AboutClosures.cfc ├── AboutComponentTags.cfc ├── AboutBooleans.cfc └── AboutExceptions.cfc ├── Components └── TestComponent.cfc └── Application.cfc /mxunit/framework/.gitignore: -------------------------------------------------------------------------------- 1 | /generated 2 | -------------------------------------------------------------------------------- /mxunit/buildprops/.gitignore: -------------------------------------------------------------------------------- 1 | /unames.properties 2 | -------------------------------------------------------------------------------- /mxunit/ftp.listing: -------------------------------------------------------------------------------- 1 | 02-04-08 08:47AM 91 index.html 2 | -------------------------------------------------------------------------------- /cfkoanslogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/cfkoanslogo.png -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/interfaces/OtherInterface.cfc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/xpath/nodes.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mxunit/lib/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/mail.jar -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/interfaces/AnInterface.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mxunit/framework/mightymock/AbstractMock.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mxunit/lib/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/activation.jar -------------------------------------------------------------------------------- /mxunit/lib/varscoper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/varscoper.jar -------------------------------------------------------------------------------- /mxunit/samples/HttpAntRunner.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/interfaces/SubInterface.cfc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mxunit/generator/no-bugs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/generator/no-bugs.gif -------------------------------------------------------------------------------- /mxunit/images/bug_green.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/images/bug_green.gif -------------------------------------------------------------------------------- /mxunit/tests/install/fixture/test.cfm: -------------------------------------------------------------------------------- 1 | test.cfm 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /settings.xml 3 | /.project 4 | /.settings/org.eclipse.core.resources.prefs 5 | /.DS_Store 6 | /WEB-INF 7 | -------------------------------------------------------------------------------- /Koans/BaseKoan.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.framework.TestCase" hint="Base class for Koans"{ 2 | variables.__ = ""; 3 | } -------------------------------------------------------------------------------- /mxunit/ant/lib/mxunit-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/ant/lib/mxunit-ant.jar -------------------------------------------------------------------------------- /mxunit/images/MXUnit-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/images/MXUnit-Small.png -------------------------------------------------------------------------------- /mxunit/lib/ant-googlecode.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/ant-googlecode.jar -------------------------------------------------------------------------------- /mxunit/lib/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /mxunit/lib/commons-net-1.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/commons-net-1.4.1.jar -------------------------------------------------------------------------------- /mxunit/lib/jakarta-oro-2.0.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/lib/jakarta-oro-2.0.8.jar -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/dataproviders/CSVWithoutHeaders.csv: -------------------------------------------------------------------------------- 1 | 0,1,1 2 | 1,5000,5050 3 | 2,5000,5100 4 | 3,5000,5150 5 | -------------------------------------------------------------------------------- /mxunit/framework/lib/xom-1.2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/lib/xom-1.2.6.jar -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/interfaces/AComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/Mockery.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mxunit/framework/lib/tagsoup-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/lib/tagsoup-1.2.jar -------------------------------------------------------------------------------- /mxunit/buildprops/antrunner_sample.properties: -------------------------------------------------------------------------------- 1 | server=localhost 2 | port=80 3 | context= 4 | webroot=c:/inetpub/wwwroot/ 5 | classpath.excludes= -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/fixturetests/SubClassWithNoMethodsTest.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/blue/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/blue/asc.gif -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/blue/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/blue/bg.gif -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/green/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/green/up.png -------------------------------------------------------------------------------- /mxunit/resources/jquery/tipsy/images/tipsy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tipsy/images/tipsy.gif -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/dataproviders/SimpleCSV.csv: -------------------------------------------------------------------------------- 1 | TaxRate,ItemCost,ExpectedResult 2 | 0,1,1 3 | 1,5000,5050 4 | 2,5000,5100 5 | 3,5000,5150 6 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/blue/blue.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/blue/blue.zip -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/blue/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/blue/desc.gif -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/green/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/green/down.png -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/green/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/resources/jquery/tablesorter/green/default.png -------------------------------------------------------------------------------- /mxunit/experimental_ant/copydictionary.properties: -------------------------------------------------------------------------------- 1 | dictionary.destinationDir=C:/Program Files (x86)/eclipse_33_rcp/plugins/org.cfeclipse.cfml_1.3.1.6/dictionary 2 | 3 | -------------------------------------------------------------------------------- /mxunit/buildprops/unames_example.properties: -------------------------------------------------------------------------------- 1 | gc.username= 2 | gc.password= 3 | mail.from= 4 | mail.to= 5 | mail.host= 6 | ftp.site=ftp.mxunit.org 7 | ftp.username= 8 | ftp.password= -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/dataproviders/SimpleExcel.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/tests/framework/fixture/dataproviders/SimpleExcel.xls -------------------------------------------------------------------------------- /mxunit/framework/javaloader/lib/classloader-20100119110136.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/javaloader/lib/classloader-20100119110136.jar -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/Helper.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | function helpMe(){ 4 | return 'called helper successfully'; 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/.gitignore: -------------------------------------------------------------------------------- 1 | settings.xml 2 | .settings/ 3 | .project 4 | MXUnitInstallTest.cfc 5 | buildprops/antrunner.properties 6 | tests/testresults/ 7 | 8 | /WEB-INF 9 | /doc 10 | /dist 11 | -------------------------------------------------------------------------------- /mxunit/framework/javaloader/support/spring/lib/spring-coldfusion.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/javaloader/support/spring/lib/spring-coldfusion.jar -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/dataproviders/ExcelWithoutHeaders.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/tests/framework/fixture/dataproviders/ExcelWithoutHeaders.xls -------------------------------------------------------------------------------- /mxunit/framework/javaloader/readme.txt: -------------------------------------------------------------------------------- 1 | JavaLoader v1.0 2 | Author: Mark Mandel 3 | Date: 10 September 2010 4 | 5 | Documentation can now be found at: 6 | http://www.compoundtheory.com/javaloader/docs/ -------------------------------------------------------------------------------- /mxunit/framework/javaloader/support/spring/lib/spring-coldfusion-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/javaloader/support/spring/lib/spring-coldfusion-src.zip -------------------------------------------------------------------------------- /mxunit/generator/MXUnit_Parameter_Types_for_Automatic_Test_Generation.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/generator/MXUnit_Parameter_Types_for_Automatic_Test_Generation.doc -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/inheritance/SomeExtendingTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mxunit/framework/javaloader/support/cfcdynamicproxy/lib/cfcdynamicproxy.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/javaloader/support/cfcdynamicproxy/lib/cfcdynamicproxy.jar -------------------------------------------------------------------------------- /mxunit/framework/javaloader/support/cfcdynamicproxy/lib/cfcdynamicproxy-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodoherty/ColdFusion-Koans/HEAD/mxunit/framework/javaloader/support/cfcdynamicproxy/lib/cfcdynamicproxy-src.zip -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/fixturetests/SuperClassWithPrivateMethodsTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mxunit/buildprops/version.properties: -------------------------------------------------------------------------------- 1 | #Build version info 2 | #Sat Nov 12 09:19:51 EST 2011 3 | build.buildnum=0 4 | build.minor=1 5 | build.versiondescription=Release 6 | build.notation= 7 | build.date=11/12/2011 8 | build.major=2 9 | -------------------------------------------------------------------------------- /mxunit/framework/mightymock/MockLogger.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | Write invocation records to log 5 | */ 6 | function init(){ 7 | return this; 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/tests/install/fixture/index.cfm: -------------------------------------------------------------------------------- 1 | hell from fixture 2 | 3 | 4 | getPageContext().include("test.cfm"); 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mxunit/buildprops/nightlyversion.properties: -------------------------------------------------------------------------------- 1 | #Build version info 2 | #Thu Sep 08 22:01:11 EDT 2011 3 | build.buildnum=4 4 | build.minor=0 5 | build.versiondescription=Nightly Build 6 | build.notation= 7 | build.date=09/08/2011 8 | build.major=2 9 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/fixture/93sample.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/tests/build.properties: -------------------------------------------------------------------------------- 1 | #build properties for the Ant builds build.xml and fast-build.xml 2 | server.name=localhost 3 | server.port=8301 4 | component.path=/home/billy/software/jrun4/servers/dev/cfusion.ear/cfusion.war 5 | mxunit.jar=../ant/lib/mxunit-ant.jar -------------------------------------------------------------------------------- /mxunit/buildprops/testresultsmail.html: -------------------------------------------------------------------------------- 1 | 2 |

LATEST Test Results

3 |

4 |

5 |
6 | ${resultshtml} 7 | 8 |

9 |
10 |

PREVIOUS Test Results

11 | ${currentresultshtml} -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/AcceptStrictType.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/FiveSecondTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/TestOrdering/AlphabeticallyOrderedTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/weirderrordemos/extends/SomeTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SubDir/AnotherSubDir/TestSomething.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/fail.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fail 4 | 5 | ]]> 6 | 7 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/ATestSuite.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | addAll("mxunit.tests.framework.AssertDecoratorTest"); 4 | addAll("mxunit.tests.bugs.fixture.test_with_underscore"); 5 | 6 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeComponentWithStuff.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/MockFactory.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | return this; 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/debug.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | debug 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/Dummy.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | this.bah = 'this.bah'; 4 | foo = 'bar'; 5 | variables.instance.bah = 'barbar'; 6 | 7 | function bar(){ 8 | return foo; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/setUp cfscript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | setUp cfscript 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/Mockify.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/setUp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | setUp 4 | 5 | 6 | ]]> 7 | ]]> 9 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SingleFailureTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | wooopity doo! 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/tearDown cfscript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tearDown cfscript 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/weirderrordemos/extends/Extends.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsArray 4 | 5 | ]]> 6 | 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsEmpty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsEmpty 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsQuery.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsQuery 4 | 5 | ]]> 6 | 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/tearDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tearDown 4 | 5 | 6 | ]]> 7 | ]]> 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsStruct.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsStruct 4 | 5 | ]]> 6 | 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsDefined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsDefined 4 | 5 | ]]> 6 | 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertSame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertSame 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/EmptyTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertEquals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertEquals 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsTypeOf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsTypeOf 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/makepublic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | makepublic 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/ExpectedExceptionTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertIsXMLDoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertIsXMLDoc 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertNotSame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertNotSame 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertTrue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertTrue 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/inheritance/BaseTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertFalse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertFalse 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/assertNotEquals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | assertNotEquals 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/inheritance/SomeDoublyExtendingTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/samples/TestCaseSkeleton.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /mxunit/README-toc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/ComparatorTestData.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/addAssertDecorator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | addAssertDecorator 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/ParentWithPrivateMethods.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/tests/framework/DynamicTestCaseGenerationTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | component extends="mxunit.framework.TestCase" { 4 | 5 | a = [1,2,3,4]; 6 | 7 | 8 | 9 | function setUp(){ 10 | 11 | } 12 | 13 | 14 | 15 | 16 | /** 17 | * @dataprovider a 18 | */ 19 | function testThis(a){ 20 | debug(a); 21 | } 22 | 23 | 24 | } 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/MockLoggerTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function testWriteLog() { 6 | //To Do: do logging 7 | debug('to do'); 8 | } 9 | 10 | 11 | 12 | function setUp(){ 13 | 14 | } 15 | 16 | function tearDown(){ 17 | 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/90.cfc: -------------------------------------------------------------------------------- 1 | 2 | Calls TestSuite.run() which invokes tearDown(). This is caught but not 3 | displayed in debug .. 4 | 5 | 6 | error 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new test function cfscript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new test function cfscript 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/generator/generator.js: -------------------------------------------------------------------------------- 1 | function toggle(frm) 2 | { 3 | for ( ii=0 ; ii < frm.tableNameList.length ; ii++) 4 | { 5 | frm.tableNameList[ii].checked = frm.all.checked; 6 | } 7 | } 8 | 9 | function suggest(frm,target,delim) 10 | { 11 | if (delim == "file") 12 | { 13 | target.value = frm.value + "/tests"; 14 | } else { 15 | target.value = frm.value + ".tests"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/injectMethod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | injectMethod 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/InvalidMarkupTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | -------------------------------------------------------------------------------- /mxunit/tests/framework/adapters/cf9/PublicProxyMakerTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/TestOrdering/DefaultOrderedTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/cfquerysim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | cfquerysim 4 | 5 | 6 | 7 | 8 | q 9 | ]]> 10 | 14 | 15 | ]]> 16 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/DataProviderFixture.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function double(param1){ 5 | return param1 * 2; 6 | } 7 | 8 | function queryEcho(q) { 9 | return q.recordCount; 10 | } 11 | 12 | 13 | 14 | 15 | 16 | q 17 | col1,col2,col3,col4 18 | 1|1.2|1.3|1.4 19 | 2|2.2|2.3|2.4 20 | 3|3.2|3.3|3.4 21 | 22 | 23 | -------------------------------------------------------------------------------- /mxunit/README.txt: -------------------------------------------------------------------------------- 1 | MXUnit is a unit test framework for CFML. 2 | 3 | Main website: http://mxunit.org 4 | 5 | Docs, etc: http://wiki.mxunit.org 6 | 7 | Bugs and enhancements: http://jira.mxunit.org 8 | 9 | SVN: http://mxunit.googlecode.com/svn/mxunit/trunk 10 | 11 | MXUnit Google Group (to get help): http://groups.google.com/group/mxunit 12 | 13 | Version Info: This is a nightly build of the 2.0.3 stream, built on 09/09/2011 -------------------------------------------------------------------------------- /mxunit/tests/bugs/105ExtendedTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | should display two tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mxunit/tests/compatability/DoesNotHaveTestAtEndOrBegining.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function testSomething(){ 5 | fail("implement me ..."); 6 | } 7 | 8 | 9 | /* 10 | @BeforeTest/@AfterTest 11 | */ 12 | 13 | function setUp(){ 14 | 15 | } 16 | 17 | function tearDown(){ } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/AbstractMockTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function testAbstractMockMetaData(){ 5 | //debug( getMetaData(mock) ); 6 | } 7 | 8 | function setUp(){ 9 | mock = createObject('component' ,'mxunit.framework.mightymock.AbstractMock'); 10 | } 11 | 12 | 13 | function tearDown(){ 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/injectProperty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | injectProperty 4 | 5 | 6 | ]]> 7 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new test function.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new test function 4 | 5 | 6 | 7 | 8 | ]]> 9 | ]]> 11 | -------------------------------------------------------------------------------- /mxunit/framework/decorators/AlphabeticallyOrderedTestsDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/test-time override function.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | test-time override function 4 | 5 | 6 | 7 | 8 | ]]> 9 | ]]> 10 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/weirderrordemos/BustedSetupTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mxunit/samples/MyComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/Mocking.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mymock = mock("mxunit.framework.Assert"); 6 | assertIsTypeOf(mymock,"mxunit.framework.Assert"); 7 | mymock.mockMethod("getHashCode").returns("Hello!"); 8 | assertEquals("Hello!",mymock.getHashCode("")); 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /mxunit/tests/samples/MyComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/weirderrordemos/BustedTearDownTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/105.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We just want this test to run and will extend if later 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/helpers/querysim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | querysim 4 | 5 | 6 | 7 | 8 | q 9 | $${column names separated by commas} 10 | $${row of data separated by pipes} 11 | 12 | ]]> 13 | 15 | 16 | ]]> 17 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new test error path function cfscript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new test error path function cfscript 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/weirderrordemos/BustedConstructorTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mxunit/samples/tests/myTestSuite.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DTS = createObject("component","mxunit.runner.DirectoryTestSuite"); 5 | excludes = ""; 6 | results = DTS.run( 7 | directory = "c:\inetpub\wwwroot\mxunit\samples\tests\", 8 | componentPath = "mxunit.samples.tests", 9 | recurse = "true", 10 | excludes = "#excludes#" 11 | ); 12 | 13 | 14 | #results.getResultsOutput(URL.output)# 15 | 16 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/CaseSensitivtyTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function mockShouldBeCaseInsensitive(){ 5 | m = $('bar'); 6 | m.foo('bar').returns(true); 7 | 8 | m.foo('bar'); 9 | m.foo('Bar'); 10 | m.fOo('BaR'); 11 | m.fOO('bAr'); 12 | m.verifyTimes(4).foo('bar'); 13 | } 14 | 15 | 16 | function setUp(){ 17 | 18 | } 19 | 20 | function tearDown(){ 21 | 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/ThrowsAnErrorTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/fixture/122/GoodTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/ParentSpyObject.cfc: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new test error path function.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new test error path function 4 | 5 | 6 | 7 | 8 | ]]> 9 | 10 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/readme.txt: -------------------------------------------------------------------------------- 1 | ----------------------------------------------- 2 | Instructions for installing the mxunit snippets 3 | ----------------------------------------------- 4 | 5 | 6 | 1) in Eclipse: go to Window -- Preferences -- CFEclipse 7 | 2) copy the path to the snippets directory 8 | 3) open that path on your file system 9 | 4) copy the snippets/mxunit directory into the snippets directory that you just opened 10 | 5) optionally, copy the contents of snippets/mxunit/keyCombos.properties into your existing keyCombos.properties file -------------------------------------------------------------------------------- /mxunit/tests/bugs/fixture/122/ParseErrorTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mxunit/eclipse/dictionary/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | 1) open /plugins/org.cfeclipse.cfml_/dictionary/ 3 | 2) copy mxunit.xml into that directory 4 | 3) open dictionaryconfig.xml 5 | 4) underneath the "" lines, add: 6 | 7 | 8 | 9 | 5) restart eclipse 10 | 11 | Then, inside any test cases, typing the function names for public and package functions from TestCase and the Assert* cfcs will pop up function support. For example, type "assertEquals(" 12 | 13 | and the argument popups will appear. -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/assert/try catch error path.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | try catch error path 4 | 5 | 6 | 7 | 8 | 9 | ]]> 10 | 13 | 14 | 15 | 16 | 17 | ]]> 18 | -------------------------------------------------------------------------------- /mxunit/resources/theme/footer.cfm: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SubDir/AnotherSubDir/AnotherTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/MyCFC.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/MockDebugTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | function testDebug(){ 4 | assertIsTypeOf( mockBug, 'mxunit.framework.mightymock.MockDebug'); 5 | } 6 | 7 | 8 | 9 | function dumpMockBugs() { 10 | m = $('snicker'); 11 | m.foo().returns(); 12 | m.bar(123).throws('eek-a-mouse'); 13 | a = [1,2,3,4,5]; 14 | m.foobar('asd').returns(a); 15 | 16 | debug( mockBug.debug(m,true) ); 17 | } 18 | 19 | 20 | function setUp() { 21 | mockBug = createObject('component', 'mxunit.framework.mightymock.MockDebug'); 22 | 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /mxunit/tests/ant/commitSvnTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /mxunit/tests/ant/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | Running antunit tests 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mxunit/tests/framework/AssertionChainingTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function testAssertMethodChainAndPrint(){ 6 | 7 | println('Added method chaining for assert() only.'); 8 | print('Not sure what value it has unless someone is instantiating Assert separately.'); 9 | 10 | assert(true, "should be true") 11 | .assert(1 eq 1, "better be true") 12 | .assert('asd' is 'asd', "should be true"); 13 | 14 | } 15 | 16 | 17 | 18 | function setUp(){ 19 | 20 | } 21 | 22 | function tearDown(){ 23 | 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/FileDeleter.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SomeObject.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/93.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _93 = createObject("component","mxunit.tests.bugs.fixture.93Sample"); 6 | debug(_93.printTrace()); 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/ComplexExceptionTypeErrorTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/CFScriptExpectedExceptionTest.cfc: -------------------------------------------------------------------------------- 1 | component extends="mxunit.framework.TestCase" { 2 | 3 | /** 4 | * @mxunit:expectedException MyCustomException 5 | */ 6 | function thisShouldFail_BecauseExpectedExceptionIsNotThrown(){ 7 | throw("hi mom!", "SomeOtherKindOfException"); 8 | } 9 | 10 | /** 11 | * @mxunit:expectedException MyCustomException 12 | */ 13 | function thisShouldPass_BecauseExpectedExceptionIsThrown(){ 14 | throw("hi mom!", "MyCustomException"); 15 | } 16 | 17 | /** 18 | * @mxunit:expectedException MyCustom.Exception 19 | */ 20 | function thisShouldPass_BecauseExpectedExceptionIsThrown2(){ 21 | throw("hi mom!", "MyCustom.Exception"); 22 | } 23 | } -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/TestAssertComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new MXUnit TestCase cfscript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new MXUnit TestCase cfscript 4 | 5 | 28 | 29 | -------------------------------------------------------------------------------- /mxunit/framework/Test.cfc: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SubDir/CFUnitStyleTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Koans/AboutComponents.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator 3 | */ 4 | component extends="Koans.BaseKoan"{ 5 | 6 | //for these tests you'll need to study /Components/testComponent.cfc 7 | 8 | /** 9 | *@order 1 10 | */ 11 | public void function testGetFullName(){ 12 | 13 | var testComponent = new Components.TestComponent("Homer","Simpson"); 14 | 15 | assertEquals(__,testComponent.getFullName()); 16 | } 17 | 18 | /** 19 | *@order 2 20 | */ 21 | public void function testOnMissingMethod(){ 22 | var testComponent = new Components.TestComponent(); 23 | 24 | var reverseName = testComponent.getReverseName("Ned","Flanders"); 25 | 26 | assertEquals(__,reverseName); 27 | } 28 | } -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/decorators/StoreTestNameDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | request.test = arguments; 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SingleMethodTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/SubDir/AnotherSubDir/SomeOtherTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/decorators/IgnoreFunnyFunctionsDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mxunit/framework/decorators/TransactionRollbackDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mxunit/samples/mocking/TheComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | theCollaborator = createObject('component','TheCollaborator'); 4 | 5 | function init(){ 6 | return this; 7 | } 8 | 9 | 10 | function setCollaborator(collaborator){ 11 | theCollaborator = collaborator; 12 | } 13 | 14 | function callLoggerALot(){ 15 | var i = 1; 16 | var arbitrary = 0; 17 | for(i; i <= 25; i++){ 18 | arbitrary = hash(i); 19 | theCollaborator.logStuff(); 20 | } 21 | } 22 | 23 | function getUserAsStruct(id){ 24 | var temp = theCollaborator.getUser(id); 25 | var user = {}; 26 | user['id'] = temp.id; 27 | user['name'] = temp.name; 28 | user['email'] = temp.email; 29 | return user; 30 | } 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/framework/javaloader/tags/directory.cfm: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mxunit/mxunit-TestSuiteTemplate.cfm: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | testSuite = createObject("component","mxunit.framework.TestSuite").TestSuite(); //TestSuite() is the constructor 12 | testSuite.addAll("path.to.myTest"); 13 | testSuite.addAll("path.to.myOtherTest"); 14 | //Create mxunit.framework.TestResult object 15 | results = testSuite.run(); 16 | 17 | 18 | 19 | #results.getHtmlResults()# -------------------------------------------------------------------------------- /mxunit/tests/framework/VersionReaderTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Koans/AboutClosures.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator,mxunit.framework.decorators.MinimumVersionDecorator 3 | */ 4 | component extends="Koans.BaseKoan"{ 5 | 6 | /** 7 | *@order 1 8 | *@minVersion 10 9 | */ 10 | public void function testWhatIsAClosure(){ 11 | /* 12 | In ColdFusion 10 when a function executes, its internal variables are saved. When a 13 | variable is returned from a function, it can always access the variables that were defined 14 | in its scope. This "enclosing" of a variables execution context variables is what a closure 15 | is. 16 | */ 17 | 18 | var actual = function(string appendMe){ 19 | var myNewVar = "foo"; 20 | 21 | return myNewVar & arguments.appendMe; 22 | }; 23 | 24 | assertEquals(__,actual('bar')); 25 | } 26 | } -------------------------------------------------------------------------------- /mxunit/tests/bugs/149Test.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function AssertNotequalsFailureMessageShouldBeMeaningful() { 6 | try{ 7 | assertNotEquals(1,1); 8 | } 9 | catch(mxunit.exception.AssertionFailedError e){ 10 | debug(e); 11 | assert(find('These values should not be the same', e.message) , 'partial expected failure message not found' ); 12 | } 13 | 14 | } 15 | 16 | function AsserEqualsFailureMessageShouldBeMeaningful() { 17 | try{ 18 | assertEquals(1,2); 19 | } 20 | catch(mxunit.exception.AssertionFailedError e){ 21 | assert(find('These values should be the same', e.message) , 'partial expected failure message not found' ); 22 | } 23 | 24 | } 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/spark.cfm: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 |
16 | Testing Header 17 |
18 | Loading.. 19 |
20 | Testing Footer 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /mxunit/README.textile: -------------------------------------------------------------------------------- 1 | h1. MXUnit 2 | 3 | A test framework for CFML (ColdFusion). 4 | 5 | Main website "http://mxunit.org":http://mxunit.org 6 | Docs, etc: "http://wiki.mxunit.org/":http://wiki.mxunit.org/ 7 | MXUnit Google Group (to get help): "http://groups.google.com/group/mxunit":http://groups.google.com/group/mxunit 8 | 9 | 10 | h2. About this repository 11 | 12 | This is the main distribution branch, formally located at http://mxunit.googlecode.com/svn/mxunit/trunk/ (Subversion) 13 | 14 | We have moved most, if not all, source from Google Code to git hub. So, you should find everything here you need. 15 | 16 | h2. Collaborating Guidelines 17 | 18 | Patches and improvements are always welcome! Please fork this branch, make your changes (with plenty of passing tests) and make a pull request. 19 | 20 | Test and Be Happy! 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mxunit/buildprops/scripts/http_doc_gen.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author bill 3 | * 4 | * This Rhino/JS script invokes doc/build.cfm which generates static html api stuff. 5 | * The anonymous function below is not really necessary, but illustrates 6 | * how you can structure logic to support Ant tasks. It's also nice to develop OO 7 | * constructs, iterators, and exception handling. 8 | * 9 | */ 10 | importPackage(java.net,java.io); 11 | 12 | (function(){ 13 | var inputLine, url; 14 | 15 | print( 'Generating MXUnit API docs.' ); 16 | url = new URL('http://' + project.getProperty('server') + ':' + project.getProperty('port') + '/mxunit/doc/build.cfm'); 17 | input = new BufferedReader( new InputStreamReader(url.openStream()) ); 18 | 19 | while ((inputLine = input.readLine()) != null) 20 | print(inputLine); 21 | input.close(); 22 | 23 | })(); 24 | 25 | -------------------------------------------------------------------------------- /mxunit/samples/tests/MyComponentTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/fixturetests/SomeRandomTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | assertTrue(true); 15 | 16 | 17 | 18 | 19 | 20 | assertTrue(false,"Intentional failure"); 21 | 22 | 23 | 24 | 25 | 26 | assertTrue(true); 27 | 28 | 29 | 30 | 31 | 32 | assertTrue(true); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | All Classes 18 | 19 |
20 | 21 | 22 | 23 | 30 | 31 |
24 | 25 | #name# 26 |
27 |
28 |
29 |
32 | 33 | 34 | 35 |
-------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/fixturetests/AnotherRandomTests.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | assertTrue(true); 15 | 16 | 17 | 18 | 19 | 20 | assertTrue(false,"Intentional failure"); 21 | 22 | 23 | 24 | 25 | 26 | assertTrue(true); 27 | 28 | 29 | 30 | 31 | 32 | assertTrue(true); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /mxunit/samples/mocking/TheCollaborator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | select * 15 | from qData 16 | where id = #arguments.id# 17 | 18 | 19 | 20 | 21 | 23 | 24 | data 25 | id,name,email 26 | 1|bill|bill@bill.com 27 | 2|marc|marc@marc.com 28 | 3|ted|ted@ted.com 29 | 4|joe|joe@joe.com 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mxunit/samples/SimpleRunSkeleton.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

#dir#

5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | #results.getResultsOutput(URL.output)# -------------------------------------------------------------------------------- /mxunit/framework/mightymock/MockFactory.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | return this; 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/TestWithExpectedExceptionAttributes.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mxunit/mxunit-TestCase-Template.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/runner/runner.js: -------------------------------------------------------------------------------- 1 | ;(function($) { 2 | examples = { 3 | TestCase: { 4 | test: 'mxunit.tests.framework.AssertTest', 5 | componentPath: '' 6 | }, 7 | TestSuite: { 8 | test: 'mxunit.tests.framework.fixture.ATestSuite', 9 | componentPath: '' 10 | }, 11 | Directory: { 12 | test: '/mxunit/tests/samples', 13 | componentPath: 'mxunit.tests.samples' 14 | } 15 | }; 16 | 17 | $test = $('#test'); 18 | $componentPath = $('#componentPath'); 19 | 20 | $examples = $('

Examples: TestCase TestSuite Directory

'); 21 | 22 | $('a', $examples).click(function() { 23 | option = examples[$(this).html()]; 24 | 25 | $test.val(option.test); 26 | $componentPath.val(option.componentPath); 27 | 28 | return false; 29 | }); 30 | 31 | $('#btnRun').before( $examples ); 32 | 33 | $('#btnClear').click( function(){ 34 | $('.mxunitResults').html(''); 35 | } ); 36 | })(jQuery); 37 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/fixture/test-with_hyphen.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/run-me/test-with_hyphen.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Components/TestComponent.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | /** 4 | *@getters true 5 | *@setters true 6 | */ 7 | property String firstName; 8 | 9 | /** 10 | *@getters true 11 | *@setters true 12 | */ 13 | property String lastName; 14 | 15 | public void function init(String firstName = "", String lastName = ""){ 16 | this.firstName = arguments.firstName; 17 | this.lastName = arguments.lastName; 18 | } 19 | 20 | public String function getFullName(){ 21 | return this.firstName & " " & this.lastName; 22 | } 23 | 24 | public Any function onMissingMethod(String missingMethodName, Struct missingMethodArguments){ 25 | 26 | if(structKeyExists(missingMethodArguments,"1") && structKeyExists(missingMethodArguments,"2")){ 27 | return missingMethodArguments[2] & " " & missingMethodArguments[1]; 28 | } 29 | } 30 | 31 | public String function getOne(){ 32 | return "1"; 33 | } 34 | 35 | public String function getTwo(){ 36 | return "2"; 37 | } 38 | } -------------------------------------------------------------------------------- /mxunit/tests/bugs/fixture/test_with_underscore.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/run-me/test_with_underscore.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/ant/stylesheets/antmanual.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | body { 19 | background-image:url(/images/beta.png) 20 | } 21 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/mxunit-TestCase-Template.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/run.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | #results.getResultsOutput(url.output)# 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/blue/style.css: -------------------------------------------------------------------------------- 1 | /* tables */ 2 | table.tablesorter { 3 | font-family:arial; 4 | margin:10px 0pt 15px; 5 | font-size: 8pt; 6 | width: 100%; 7 | text-align: left; 8 | } 9 | table.tablesorter thead tr th, table.tablesorter tfoot tr th { 10 | background-color: #e6EEEE; 11 | border: 1px solid #FFF; 12 | font-size: 8pt; 13 | padding: 4px; 14 | } 15 | table.tablesorter thead tr .header { 16 | background-image: url(bg.gif); 17 | background-repeat: no-repeat; 18 | background-position: center right; 19 | cursor: pointer; 20 | } 21 | table.tablesorter tbody td { 22 | color: #3D3D3D; 23 | padding: 4px; 24 | vertical-align: top; 25 | } 26 | table.tablesorter thead tr .headerSortUp { 27 | background-image: url(asc.gif); 28 | } 29 | table.tablesorter thead tr .headerSortDown { 30 | background-image: url(desc.gif); 31 | } 32 | table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { 33 | background-color: #8dbdd8; 34 | } 35 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/tablesorter/green/style.css: -------------------------------------------------------------------------------- 1 | table.tablesorter { 2 | font-size: 12px; 3 | background-color: #eaeaea; 4 | width: 1024px; 5 | border: 1px solid #000; 6 | } 7 | table.tablesorter th { 8 | text-align: left; 9 | padding: 5px; 10 | background-color: #545050; 11 | color:whitesmoke; 12 | } 13 | table.tablesorter td { 14 | padding: 5px; 15 | } 16 | table.tablesorter .even { 17 | background-color: #3D3D3D; 18 | } 19 | table.tablesorter .odd { 20 | background-color: #6E6E6E; 21 | } 22 | table.tablesorter .header { 23 | background-image: url(default.png); 24 | background-repeat:no-repeat; 25 | cursor: pointer; 26 | border: 1px inset silver; 27 | padding-left: 32px; 28 | padding-top: 8px; 29 | height: 32px; 30 | 31 | } 32 | table.tablesorter .headerSortDown { 33 | background-image: url(up.png); 34 | background-repeat:no-repeat; 35 | } 36 | 37 | table.tablesorter .headerSortUp { 38 | background-image: url(down.png); 39 | background-repeat:no-repeat; 40 | } -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/testrunner/Directory Test Suite Skeleton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Directory Test Suite Skeleton 4 | 5 | 6 | 7 | 8 |

#dir#

9 | 10 | 11 | 12 | 19 | 20 | 21 | #results.getResultsOutput(URL.output)# ]]>
22 | 23 |
-------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/NewCFComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/MySpyObject.cfc: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | function callMockThis(param1){ 26 | var val = mockThis(param2); 27 | return val; 28 | } 29 | 30 | function mockThis(param2){ 31 | return arguments.param2; 32 | } 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/MyCFCTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Koans/AboutComponentTags.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/StateTransitionTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function testStateTransition(){ 6 | 7 | mock._$setState('idle'); 8 | 9 | mock._$setState('registering'); 10 | assertEquals( 'idle' , mock._$getPreviousState() ); 11 | assertEquals( 'registering' , mock._$getState() ); 12 | 13 | mock._$setState('executing'); 14 | assertEquals( 'registering' , mock._$getPreviousState() ); 15 | assertEquals( 'executing' , mock._$getState() ); 16 | 17 | 18 | mock._$setState('verifying'); 19 | assertEquals( 'executing' , mock._$getPreviousState() ); 20 | assertEquals( 'verifying' , mock._$getState() ); 21 | 22 | mock._$setState('idle'); 23 | assertEquals( 'verifying' , mock._$getPreviousState() ); 24 | assertEquals( 'idle' , mock._$getState() ); 25 | 26 | mock._$setState('error'); 27 | assertEquals( 'idle' , mock._$getPreviousState() ); 28 | assertEquals( 'error' , mock._$getState() ); 29 | } 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/PatternInvocationTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function semanticPatternsNeedToCoexist() { 5 | mock.reset(); 6 | mock.foo(bar='foo').returns(true); 7 | mock.foo('foo').returns(true); 8 | assert( mock.foo('foo') ); 9 | assert( mock.foo(bar='foo') ); 10 | 11 | } 12 | 13 | function shouldBeAbleToVerifyBothePatternAndLiteral(){ 14 | mock.foo('{+}').returns(true); 15 | actual = mock.foo('asd'); 16 | debug( mock.debugMock() ); 17 | //To Do: Should be able to do this, to: 18 | // mock.verify().foo('asd'); 19 | } 20 | 21 | 22 | function peepPatternExec(){ 23 | mock.foo('{string}').returns(true); 24 | actual = mock.foo('asd'); 25 | mock.foo('asd'); 26 | debug( mock.debugMock() ); 27 | assert(actual); 28 | mock.verify(2).foo('{string}'); 29 | } 30 | 31 | 32 | 33 | 34 | 35 | function setUp(){ 36 | mock.reset(); 37 | } 38 | 39 | function tearDown(){ 40 | 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /mxunit/tests/framework/HamcrestMatcherTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mxunit/tests/framework/TestDecoratorTest.cfc: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | assertTrue(StructKeyExists(request, "test"), "Why is there no 'test' in the request scope?"); 8 | 9 | assertEquals("testDecoratorWrappingTest", request.test.methodName); 10 | 11 | assertTrue(StructIsEmpty(request.test.args), "How does args have data in it?"); 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/fixture/MyComponent.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | aSimpleVar = 'simple var'; 4 | this.bar = 'bar'; 5 | collaborator = ''; 6 | 7 | helper = createObject('component','Helper'); 8 | 9 | 10 | function invokeHelper(){ 11 | return helper.helpMe(); 12 | } 13 | 14 | function getInjectedSpyVar(){ 15 | return MYSPYVAR; 16 | } 17 | 18 | function setCollaborator(col){ 19 | collaborator = col; 20 | } 21 | 22 | function dependOnSomething(message){ 23 | return collaborator.echo(foo()); 24 | } 25 | 26 | function dependOnSomethingWithInstanceData(){ 27 | return collaborator.getMyVar(); 28 | } 29 | 30 | function dependOnSomethingElse(message){ 31 | return collaborator.add(1,2); 32 | } 33 | 34 | 35 | function dependOnParams(a){ 36 | return collaborator.echo('asd'); 37 | } 38 | 39 | function getSomeStuff(){ 40 | return 'stuff'; 41 | } 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/new MXUnit TestCase.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | new MXUnit TestCase 4 | 5 | 6 | 7 | 8 | 9 | ]]> 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
]]> 28 | -------------------------------------------------------------------------------- /mxunit/framework/mightymock/MightyMockFactory.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | mocks = []; 4 | 5 | 6 | function init(){ 7 | return this; 8 | } 9 | 10 | 11 | 12 | function create(){ 13 | //create basic mock with no name info 14 | if(arguments.size() eq 0 ) return createObject('component','MightyMock').init(); 15 | //create basic mock with a name for reference/debugging 16 | if(arguments.size() eq 1 ) return createObject('component','MightyMock').init(arguments[1]); 17 | //create type-safe mock. 18 | if(arguments.size() eq 2 ) return createObject('component','MightyMock').init(arguments[1],arguments[2]); 19 | //create a type-safe mock and a spy 20 | //if(arguments.size() eq 3 ) return createObject('component','MightyMock').init(arguments[1],arguments[2],arguments[3]); 21 | } 22 | 23 | function createSpy(name) { 24 | return createObject('component','MightyMock').createSpy(arguments.name); 25 | } 26 | 27 | function listMocks(){ 28 | return arrayToList(mocks); 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /mxunit/ant/README.txt: -------------------------------------------------------------------------------- 1 | 01-25-08 Using Ant with MXUnit. 2 | 3 | Source is available here: http://mxunit.googlecode.com/svn/org.mxunit.ant.idea/ 4 | Get the updated ANT doc here: http://wiki.mxunit.org/display/default/Ant+Task+Doc 5 | 6 | Overview: 7 | Used best for running groups of tests, test suites, and directories of 8 | tests. Writes test results in XML, JUnitXML, or HTML to a specified 9 | location. This is particularly useful for generating JUnit style 10 | reports, using Ant's task. 11 | 12 | This handles BASIC as well as NTML authentication as well as SSL. 13 | 14 | This assumes a basic knowledge of Ant. 15 | 16 | Dependencies: This assumes you have Ant installed. If not, please 17 | download the latest version from http://ant.apache.org/. 18 | 19 | The stylesheets in this package are the same as those in JUnit. Just a 20 | few slight modifications/branding were made. 21 | 22 | Usage: See sample-build.xml for usage. 23 | 24 | Examples: 25 | 26 | 27 | Enjoy ... 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /mxunit/samples/tests/TestCaseSkeletonTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #arguments.package# 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | #arguments.package# 21 | 22 | 23 | 24 | 33 |
25 | Classes  26 | 27 | 28 |
29 | #name# 30 |
31 | 32 |
34 | 35 | 36 | 37 |
-------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/.tmp_package-frame.html.16014~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #arguments.package# 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | #arguments.package# 21 | 22 | 23 | 24 | 33 |
25 | Classes  26 | 27 | 28 |
29 | #name# 30 |
31 | 32 |
34 | 35 | 36 | 37 |
-------------------------------------------------------------------------------- /mxunit/tests/bugs/Bug115.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | try{ 8 | assertEquals(1,2, "my message"); 9 | } 10 | catch(any e){ 11 | actual = e.getMessage(); 12 | } 13 | expected = "my message::[1] NOT EQUAL TO [2]"; 14 | debug(expected); 15 | debug(actual); 16 | assertEquals(expected, actual, "Failure message outputs should be the same"); 17 | 18 | 19 | 20 | 21 | 22 | 23 | pub = makePublic(this,"normalizeArguments"); 24 | args = structNew(); 25 | args.expected = 1; 26 | args.actual = 2; 27 | args.message ="my message"; 28 | newArgs = pub.normalizeArguments("equals",args); 29 | debug(newArgs); 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /mxunit/resources/jquery/tipsy/stylesheets/tipsy.css: -------------------------------------------------------------------------------- 1 | .tipsy { padding: 5px; font-size: 10px; position: absolute; z-index: 100000; } 2 | .tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: center; } 3 | .tipsy-inner { border-radius: 3px; -moz-border-radius:3px; -webkit-border-radius:3px; } 4 | .tipsy-arrow { position: absolute; background: url('../images/tipsy.gif') no-repeat top left; width: 9px; height: 5px; } 5 | .tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -4px; } 6 | .tipsy-nw .tipsy-arrow { top: 0; left: 10px; } 7 | .tipsy-ne .tipsy-arrow { top: 0; right: 10px; } 8 | .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -4px; background-position: bottom left; } 9 | .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; background-position: bottom left; } 10 | .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; background-position: bottom left; } 11 | .tipsy-e .tipsy-arrow { top: 50%; margin-top: -4px; right: 0; width: 5px; height: 9px; background-position: top right; } 12 | .tipsy-w .tipsy-arrow { top: 50%; margin-top: -4px; left: 0; width: 5px; height: 9px; } 13 | -------------------------------------------------------------------------------- /mxunit/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. -------------------------------------------------------------------------------- /mxunit/framework/decorators/OrderedTestDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | var methods = getTarget().getRunnableMethods(); 6 | var i = 1; 7 | var order = 0; 8 | var tests = []; 9 | var test = ""; 10 | var BubbleSort = createObject("Component","mxunit.utils.BubbleSort"); 11 | var sortedTests = arrayNew(1); 12 | var returnArray = arrayNew(1); 13 | 14 | for(i = 1; i LTE arrayLen(methods); i++){ 15 | test = structNew(); 16 | test.order = getAnnotation(methods[i],"order"); 17 | test.name = methods[i]; 18 | 19 | arrayAppend(tests,test); 20 | } 21 | 22 | sortedTests = BubbleSort.sortArrayOfStructs(tests,"order",true); 23 | 24 | for(i = 1; i LTE arrayLen(sortedTests); i = i + 1){ 25 | arrayAppend(returnArray,sortedTests[i].name); 26 | } 27 | 28 | return returnArray; 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mxunit/tests/framework/TestTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Koans/AboutBooleans.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator 3 | */ 4 | component extends="Koans.BaseKoan"{ 5 | 6 | private boolean function isTruthy(Any myVar){ 7 | 8 | if(isBoolean(arguments.myVar)){ 9 | return (arguments.myVar) ? true : false; 10 | } 11 | else{ 12 | return false; 13 | } 14 | } 15 | 16 | /** 17 | *@order 1 18 | */ 19 | public void function testBooleanValue(){ 20 | assertEquals(__,isTruthy(true)); 21 | assertEquals(__,isTruthy(false)); 22 | } 23 | 24 | /** 25 | *@order 2 26 | */ 27 | public void function testStringValue1(){ 28 | assertEquals(__,isTruthy("yes")); 29 | assertEquals(__,isTruthy("no")); 30 | } 31 | 32 | /** 33 | *@order 3 34 | */ 35 | public void function testStringValue2(){ 36 | assertEquals(__,isTruthy("true")); 37 | assertEquals(__,isTruthy("false")); 38 | } 39 | 40 | /** 41 | *@order 4 42 | */ 43 | public void function testStringValue3(){ 44 | assertEquals(__,isTruthy("y")); 45 | assertEquals(__,isTruthy("n")); 46 | } 47 | 48 | /** 49 | *@order 5 50 | */ 51 | public void function testNumericValue(){ 52 | assertEquals(__,isTruthy(-2)); 53 | assertEquals(__,isTruthy(0)); 54 | } 55 | } -------------------------------------------------------------------------------- /mxunit/tests/runner/HTMLRunnerTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | runner.run(test="mxunit.tests.framework.AssertTest",output="html"); 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | assertIsTypeOf(runner,"mxunit.runner.HtmlRunner"); 17 | 18 | 19 | 20 | 21 | 22 | 23 | //fail("not implemented"); 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | runner = createObject("component","mxunit.runner.HtmlRunner").HtmlRunner(); 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mxunit/framework/adapters/cf9/PublicProxyMaker.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/FileDeleterTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function testSingleLiteralParameter(){ 6 | nuMock.sendNotifications('asd'); 7 | //debug( nuMock.debugMock() ); 8 | nuMock.verify().sendNotifications('asd'); 9 | } 10 | 11 | function testMultipleArguments(){ 12 | nuMock.sendNotifications("{string}","{string}","{string}","{string}").returns(); 13 | nuMock.sendNotifications('asd','lkj','xyz','foo'); 14 | nuMock.sendNotifications('fgh','ghj','ghjghjghj','ghjghjghjgh8jghjghj'); 15 | nuMock.sendNotifications('ruioty','fg','ghjghjghj','ghjghjghjghj7ghjghj'); 16 | nuMock.sendNotifications('dffgg','ghj','ghjghjghj','ghjghjgh6jghjghjghj'); 17 | nuMock.sendNotifications('uio','ghj','ghj4ghjghj','gh5jghjghjghjghlljghj'); 18 | //debug( nuMock.debugMock() ); 19 | nuMock.verifyTimes(5).sendNotifications("{string}","{string}","{string}","{string}"); 20 | } 21 | 22 | 23 | 24 | function setUp(){ 25 | nuMock = $('mxunit.tests.mightymock.fixture.FileDeleter',true); 26 | nuMock.sendNotifications('asd').returns(); 27 | } 28 | 29 | function tearDown(){ 30 | nuMock.reset(); 31 | } 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /mxunit/framework/VersionReader.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /mxunit/tests/framework/QueryTestResultTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | //debug(q.getQueryResults()); 7 | assertIsQuery(q.getQueryResults()); 8 | assertEquals(q.getQueryResults().recordcount,4,"Should return 21 rows - but should use something more static that AssertTest"); 9 | 10 | 11 | 12 | 13 | 14 | //debug(q); 15 | assertEquals(q.testRuns, 4,"Should return 4 rows"); 16 | assertEquals(q.successes, 3,"Should 3 successes"); 17 | assertEquals(q.failures, 1,"Should 1 failure"); 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | suite = createObject("component","mxunit.framework.TestSuite").TestSuite(); 26 | suite.addAll("mxunit.tests.framework.fixture.fixturetests.SomeRandomTest"); 27 | results = suite.run(); 28 | q = createObject("component","mxunit.framework.QueryTestResult").QueryTestResult(results); 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/runner/HtmlRunner.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | var dirrunner = ""; 12 | var results = ""; 13 | 14 | if (refind("[\\/]+", arguments.test)) { 15 | if( arguments.componentPath is ""){ 16 | writeoutput("WARNING: Please supply componentPath when running a directory of tests"); 17 | return; 18 | } 19 | 20 | dirrunner = createObject("component","DirectoryTestSuite"); 21 | 22 | results = dirrunner.run(test,componentPath,false); 23 | 24 | writeoutput(results.getResultsOutput("rawhtml")); 25 | } else { 26 | localTest = createObject("component", arguments.test); 27 | 28 | localTest.runTestRemote(output="rawhtml"); 29 | } 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 |
23 | #arguments.projectTitle#
26 | 27 | 28 | 29 | 45 | 46 |
All Classes 30 |

31 | 32 | Packages 33 |
34 | 35 | 36 | 37 | #package# 38 |
39 |
40 | 41 | 42 |
43 | 44 |

47 | 48 |

49 |   50 | 51 | 52 | -------------------------------------------------------------------------------- /mxunit/samples/MyTestSuite.cfm: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | testSuite = createObject("component","mxunit.framework.TestSuite").TestSuite(); 15 | testSuite.addAll("mxunit.samples.MyComponentTest"); 16 | testSuite.addAll("mxunit.samples.MyOtherComponentTest"); //Identical to above 17 | //add explicit test cased (don't start with 'test'). 18 | //Note you can add more than one at a time as a list 19 | testSuite.add("mxunit.samples.MyOtherComponentTest","aTestFunctionThatDoesNotBeginWithTest,anotherTestFunctionThatDoesNotBeginWithTest"); 20 | results = testSuite.run(); 21 | 22 | 23 | #results.getResultsOutput(URL.output)# 24 |


25 |

Using CFDUMP against mxunit.TestResult.getResults() method

26 | 27 | 28 | -------------------------------------------------------------------------------- /Application.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | this.name = "ColdFusion Koans"; 3 | 4 | this.mappings["/mxunit"] = expandPath('.') & "/mxunit/"; 5 | //railo needs mappings to component dirs for calling the components from within mxunit 6 | this.mappings["/Koans"] = expandPath('.') & "/Koans/"; 7 | this.mappings["/Components"] = expandPath('.') & "/Components/"; 8 | 9 | this.sessionmanagement = true; 10 | this.sessiontimeout= CreateTimeSpan(0,1,0,0); 11 | 12 | public boolean function onApplicationStart(){ 13 | application.currentDirectory = getCurrentDirectory(); 14 | 15 | if(structKeyExists(server,"coldfusion") && structKeyExists(server.coldfusion,"productversion")){ 16 | application.version = val(server.coldfusion.productversion); 17 | } 18 | else{ 19 | application.version = 0; 20 | } 21 | 22 | return true; 23 | } 24 | 25 | public boolean function onRequestStart(){ 26 | if(isDefined("url.reset")){ 27 | onApplicationStart(); 28 | } 29 | 30 | return true; 31 | } 32 | 33 | private String function getCurrentDirectory() 34 | output=false hint="I get the current directory name that this app is running in"{ 35 | dirs = getDirectoryFromPath(getCurrentTemplatePath()); 36 | dirs = listToArray(dirs,createObject("java","java.lang.System").getProperty("file.separator")); 37 | 38 | return dirs[arrayLen(dirs)]; 39 | } 40 | } -------------------------------------------------------------------------------- /mxunit/generator/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Verdana, Arial, Helvetica, sans-serif; 3 | background-color: ##EDEDEB; 4 | margin:0px; 5 | border:0px; 6 | } 7 | 8 | input, select { 9 | background-color: #ffffff; 10 | } 11 | 12 | h1 { 13 | background-image: url("no-bugs.gif"); 14 | background-repeat: no-repeat; 15 | background-color: #eeeeee; 16 | color: ##002F2F; 17 | margin:0px; 18 | padding: 20px 5px 20px 80px; 19 | font-family: Georgia, "Times New Roman", Times, serif; 20 | } 21 | 22 | h2 { 23 | background-color: #046380; 24 | color: #ffffff; 25 | border:0px; 26 | margin:0px; 27 | padding:5px 5px 5px 15px; 28 | } 29 | 30 | h3 { 31 | padding: 5px 5px 5px 15px; 32 | } 33 | 34 | th { 35 | padding: 5px; 36 | text-align: left; 37 | background-color: #EFECCA; 38 | } 39 | 40 | td { 41 | text-align: left; 42 | background-color: #eee; 43 | padding: 3px; 44 | } 45 | 46 | p, table { 47 | padding: 15px; 48 | font-size: 9pt; 49 | } 50 | 51 | 52 | .button { 53 | background-color: #cc0000; 54 | color: #ffffff; 55 | font-weight: bold; 56 | padding: 5px; 57 | margin: 2px; 58 | } 59 | 60 | li { 61 | color: #000000; 62 | font-family: Verdana, Arial, Helvetica, sans-serif; 63 | font-size: 10pt; 64 | } 65 | 66 | a { 67 | color:#046380; 68 | text-decoration: none; 69 | } 70 | a:hover { 71 | text-decoration: underline; 72 | } -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/.tmp_overview-frame.html.21513~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 |
23 | #arguments.projectTitle#
26 | 27 | 28 | 29 | 45 | 46 |
All Classes 30 |

31 | 32 | Packages 33 |
34 | 35 | 36 | 37 | #package# 38 |
39 |
40 | 41 | 42 |
43 | 44 |

47 | 48 |

49 |   50 | 51 | 52 | -------------------------------------------------------------------------------- /mxunit/tests/ant/svnUpdateTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /mxunit/tests/framework/fixture/fixturetests/AnotherRandomTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | assertTrue(true); 15 | 16 | 17 | 18 | 19 | 20 | assertTrue(false,"Intentional failure"); 21 | 22 | 23 | 24 | 25 | 26 | assertTrue(true); 27 | 28 | 29 | 30 | 31 | 32 | assertTrue(true); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /mxunit/README.html: -------------------------------------------------------------------------------- 1 |

MXUnit

A test framework for CFML (ColdFusion).

Main website http://mxunit.org
Docs, etc: http://wiki.mxunit.org/
MXUnit Google Group (to get help): http://groups.google.com/group/mxunit

About this repository

The main distribution branch is currently located at http://mxunit.googlecode.com/svn/mxunit/trunk/ (Subversion)

The presence of the MXUnit source at here Github does not indicate that MXUnit is moving from Google Code to Github. This repository is at Github to help distribute MXUnit to as many people as possible (like those who prefer Git), and to work on MXUnit 2.0 in a collaborative Git environment. Please feel free to fork and hack.

Collaborating Guidelines

Patches and improvements are always welcome! Please fork this branch, make your changes (with plenty of passing tests) and make a pull request.

Test and Be Happy!

-------------------------------------------------------------------------------- /mxunit/samples/DirectoryTestSuiteSample.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

#dir#

7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | #results.getResultsOutput(URL.output)# 25 | 26 | 27 | 28 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/DoubleMethodTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | #blah# 23 | 24 | doublemethodtest 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/PrivateMethodTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/BasicMXUnitIntegrationTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | function setUp(){ 7 | myMock = mock("s.s.s"); 8 | myMock.one().returns(); 9 | myMock.two().returns(); 10 | myMock.three().returns(); 11 | myMock.four().returns(); 12 | myMock.one(); 13 | myMock.two(); 14 | myMock.three(); 15 | myMock.four(); 16 | 17 | } 18 | 19 | function tearDown(){ 20 | myMock.reset(); 21 | } 22 | 23 | function smoke(){ 24 | myMock.verify().two(); 25 | 26 | } 27 | 28 | 29 | function testOrderedExpectationRange(){ 30 | order = ''; 31 | order = orderedExpectation(myMock); 32 | order.one().four().verify(); 33 | //debug( myMock.debugMock() ); 34 | } 35 | 36 | 37 | function testOrderedExpectationWorks(){ 38 | order = orderedExpectation(myMock); 39 | order.one().two().three().verify(); 40 | } 41 | 42 | 43 | function testOrderedExpectationIsAlive(){ 44 | order = orderedExpectation(myMock); 45 | } 46 | 47 | 48 | 49 | 50 | order = ''; 51 | order = orderedExpectation(myMock); 52 | try{ 53 | order.four().one().verify(); 54 | } 55 | catch(mxunit.exception.AssertionFailedError e){} 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/MockifyTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function testMockify() { 6 | mockifyThis = createObject('component','mxunit.tests.mightymock.fixture.Mockify'); 7 | 8 | mocker = $(); 9 | 10 | cfc= mocker.mockify(mockifyThis.foo, 'bar' );//.returns('bar'); 11 | //debug(cfc); 12 | //debug( cfc.getClass().getName()); 13 | udf = createObject('java','coldfusion.runtime.UDFMethod'); 14 | 15 | filter = createObject('java','coldfusion.filter.FusionFilter'); 16 | ctx = createObject('java','coldfusion.filter.FusionContext'); 17 | //debug(udf); 18 | //debug(mockifyThis.foo.getMethodAttributes()); 19 | //debug(filter); 20 | //debug(ctx); 21 | 22 | //debug(mockifyThis.foo.getClass().getSuperclass().getName()); 23 | //debug(mockifyThis.foo.getClass().getSimpleName()); 24 | //debug(mockifyThis.foo.getSuperScope()); 25 | //debug(mockifyThis.foo.getPagePath()); 26 | 27 | 28 | 29 | //debug( getMetaData(mockifyThis.foo) ); 30 | 31 | // debug( getPageContext().getServletConfig().getServletContext() ); 32 | 33 | //result = mockifyThis.foo(); 34 | // assertEquals( 'bar', result ); 35 | 36 | } 37 | 38 | 39 | 40 | function setUp(){ 41 | 42 | } 43 | 44 | function tearDown(){ 45 | 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /mxunit/framework/decorators/MinimumVersionDecorator.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | var methods = getTarget().getRunnableMethods(); 8 | var method = ""; 9 | var minVersion = ""; 10 | var ret = arrayNew(1); 11 | 12 | getVersion(); 13 | 14 | for(i = 1; i LTE arrayLen(methods); i++){ 15 | 16 | method = methods[i]; 17 | 18 | minVersion = val( getAnnotation( method, "minVersion" ) ); 19 | 20 | if ( minVersion <= variables.cfmlEngineVersion ) { 21 | // test is applicable to engine so run it 22 | arrayAppend(ret,method); 23 | } 24 | 25 | } 26 | // note excluded tests show as green 27 | return ret; 28 | 29 | 30 | 31 | 32 | 33 | var meta = getMetaData(this); 34 | 35 | if(NOT structKeyExists(meta, "cfmlEngineVersion")){ 36 | meta.cfmlEngineVersion = val( ListFirst( server.coldfusion.productversion ) ); 37 | } 38 | 39 | variables.cfmlEngineVersion = meta.cfmlEngineVersion; 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mxunit/framework/mightymock/todo: -------------------------------------------------------------------------------- 1 | Valid To Dos as of December 5, 2009 2 | 3 | - Debug output should be more descriptive and readable, Raw debug data available 4 | via verbose flag. 5 | 6 | - Normalize arguments. Should be able to reasonably define a method with or 7 | without named arguments, and invoke it as named or positional. See 8 | how the engines do it. 9 | 10 | - add invocation record for both pattern and literal that were executed. This 11 | should allow verification of either. 12 | 13 | - mock should record all invocations and store literal parameters 14 | - verifying by pattern should also be possible 15 | e.g., 16 | register: 17 | mock.foo(1,2).returns(); 18 | mock.foo(4,5).return(); 19 | actual exec: 20 | mock.foo(1,2); 21 | mock.foo(1,2); 22 | mock.foo(4,5); 23 | 24 | verify: 25 | mock.verifyTimes(3).foo('{numeric}','{numeric}'); 26 | 27 | And vice versa: 28 | mock..foo('{numeric}','{numeric}').returns(); 29 | 30 | actual exec: 31 | mock.foo(1,2); 32 | mock.foo(1,2); 33 | mock.foo(4,5); 34 | 35 | verify: 36 | mock.verifyTimes(2).foo(1,2); 37 | mock.verifyTimes(1).foo(4,5); 38 | 39 | - DONE -verbose . maybe should persist actual literal arguments in addition to hash 40 | - 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /mxunit/tests/run.cfm: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | #results.getResultsOutput(url.output)# 34 | 35 | 36 |
37 | 38 |
39 |
40 | 41 |
42 | 43 | -------------------------------------------------------------------------------- /mxunit/generator/templates/FailNewTagStyle.xslt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <cfcomponent name="Test" extends="mxunit.framework.TestCase"> 8 | <!--- Begin specific tests ---> 9 | 10 | 11 | <cffunction name="test" access="public" returnType="void"> 12 | 13 | <cfset fail("Test test not implemented")> 14 | 15 | </cffunction> 16 | 17 | 18 | <!--- setup and teardown ---> 19 | 20 | 21 | </cfcomponent> 22 | 23 | 24 | 25 | 26 | 27 | <cffunction name="setUp" returntype="void" access="public"> 28 | 29 | <cfset this.myComp = createObject("component","")> 30 | 31 | </cffunction> 32 | 33 | 34 | 35 | <cffunction name="tearDown" returntype="void" access="public"> 36 | <!--- Any code needed to return your environment to normal goes here ---> 37 | </cffunction> 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/tests/framework/HtmlTestResultTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | htmlTestResult = createobject("component",'mxunit.framework.HtmlTestResult'); 5 | 6 | 7 | 8 | 9 | #htmlTestResult.printResources("/mxunit", expectedTitle)# 10 | #expectedTitle#", headers), "The HTML title tag is missing or incorrect.") /> 11 | 12 | 13 | 14 | 15 | #htmlTestResult.printResources(expectedRootPath)# 16 | 17 | 18 | 19 | 20 | 21 | #htmlTestResult.printResources(expectedRootPath)# 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mxunit/generator/templates/FailNew.xslt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <cfcomponent name="Test" extends="mxunit.framework.TestCase"> 8 | <!--- Begin specific tests ---> 9 | 10 | 11 | <cffunction name="test" access="public" returnType="void"> 12 | <cfscript> 13 | assertFalse(true,"Test not implemented"); 14 | </cfscript> 15 | </cffunction> 16 | 17 | 18 | <!--- setup and teardown ---> 19 | 20 | 21 | </cfcomponent> 22 | 23 | 24 | 25 | 26 | 27 | <cffunction name="setUp" returntype="void" access="public"> 28 | <cfscript> 29 | this.myComp = createObject("component",""); 30 | </cfscript> 31 | </cffunction> 32 | 33 | 34 | 35 | <cffunction name="tearDown" returntype="void" access="public"> 36 | <!--- Any code needed to return your environment to normal goes here ---> 37 | </cffunction> 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/generator/templates/SucceedNew.xslt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <cfcomponent name="Test" extends="mxunit.framework.TestCase"> 8 | <!--- Begin specific tests ---> 9 | 10 | 11 | <cffunction name="test" access="public" returnType="void"> 12 | <cfscript> 13 | assertFalse(false,"Test not implemented"); 14 | </cfscript> 15 | </cffunction> 16 | 17 | 18 | <!--- setup and teardown ---> 19 | 20 | 21 | </cfcomponent> 22 | 23 | 24 | 25 | 26 | 27 | <cffunction name="setUp" returntype="void" access="public"> 28 | <cfscript> 29 | this.myComp = createObject("component",""); 30 | </cfscript> 31 | </cffunction> 32 | 33 | 34 | 35 | <cffunction name="tearDown" returntype="void" access="public"> 36 | <!--- Any code needed to return your environment to normal goes here ---> 37 | </cffunction> 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/framework/QueryTestResult.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | var i = 1; 24 | var q = queryNew( StructKeyList(this.testResults[i]) ); 25 | for (i = 1; i lte arraylen(this.testResults); i = i + 1){ 26 | queryAddRow(q); 27 | for(test in this.testResults[i]){ 28 | querySetCell(q, test, this.testResults[i][test]); 29 | } 30 | } 31 | return q; 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/TypeParserTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | matcher = createObject('component','mxunit.framework.mightymock.ArgumentMatcher'); 4 | 5 | 6 | function testType(){ 7 | type = matcher.getArgumentType( 123 ); 8 | assertEquals('{numeric}', type , 'numeric failue'); 9 | 10 | type = matcher.getArgumentType( now() ); 11 | assertEquals('{date}', type , 'date failue'); 12 | 13 | type = matcher.getArgumentType(testType); 14 | assertEquals('{udf}', type, 'udf failue'); 15 | 16 | type = matcher.getArgumentType( args ); 17 | assertEquals('{struct}', type, 'struct failue'); 18 | 19 | type = matcher.getArgumentType( a ); 20 | assertEquals('{array}', type, 'array failue'); 21 | 22 | type = matcher.getArgumentType( q ); 23 | assertEquals('{query}', type, 'query failue'); 24 | 25 | type = matcher.getArgumentType( x ); 26 | assertEquals('{xml}', type, 'xml failue'); 27 | 28 | type = matcher.getArgumentType(true); 29 | assertEquals('{boolean}', type, 'bool failue'); 30 | 31 | type = matcher.getArgumentType(this); 32 | assertEquals('{object}', type, 'cfc object failue'); 33 | 34 | type = matcher.getArgumentType(sys); 35 | assertEquals('{object}', type, 'java object failue'); 36 | 37 | 38 | assert (isBinary(toBinary(toBase64(mname))) , 'should be true'); 39 | /* 40 | type = matcher.getArgumentType( toBinary( toBase64(mname)) ); 41 | assertEquals('{binary}', type, 'binary failue'); 42 | */ 43 | } 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/BaseTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | sys = createObject('java','java.lang.System'); 4 | mName = 'foo'; 5 | args = {a=[1,2,3],s='some value'}; 6 | id = '$' & sys.identityHashCode(mName) & '_' & sys.identityHashCode(args); 7 | a = [1,2,3,4]; 8 | q = queryNew('asd'); 9 | x = xmlnew(); 10 | x.xmlRoot = XmlElemNew(x,"MyRoot"); 11 | dummy = 'mxunit.tests.mightymock.fixture.Dummy'; 12 | mockery = 'mxunit.tests.mightymock.fixture.Mockery'; 13 | mock = createObject('component','mxunit.framework.mightymock.MightyMock').init(); 14 | s = {a=123,b='asd'}; 15 | 16 | mockFactory = createObject('component','mxunit.framework.mightymock.MightyMockFactory').init(); 17 | $ = mockFactory.create; //jQuery-like alias for multi-mock creation 18 | $$ = mockFactory.createSpy; //jQuery-like alias for multi-mock creation 19 | 20 | 21 | 22 | 23 | 24 | 25 | user 26 | id,f_name,l_name,group 27 | 1|pocito|mock|33 28 | 2|mighty|mock|33 29 | 3|mitee|mock|33 30 | 31 | 32 | 33 | user 34 | id,f_name,l_name,group 35 | 1|bobo|the assclown|22 36 | 2|mighty|mouse|22 37 | 3|pocito|mas|22 38 | 4|kwai chang|caine|22 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /mxunit/samples/ScheduledRun.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

#dir#

9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | #results.getResultsOutput(URL.output)# 30 | 31 | 32 | 33 | 34 | #recenthtml# 35 | 36 | 37 | 38 | 39 | 40 | #recenthtml# 41 | 42 | -------------------------------------------------------------------------------- /mxunit/framework/mightymock/MockDebug.cfc: -------------------------------------------------------------------------------- 1 | 2 | 40 | 41 | 42 | 43 | function debug(mock,verbose){ 44 | var mockBug = {}; 45 | var registry = mock._$getRegistry(); 46 | structInsert(mockBug," MockName", mock.getMocked().name ); 47 | structInsert(mockBug, 'Mocked Methods', registry.getRegistry()); 48 | structInsert(mockBug, 'Invocation Records', registry.invocationRecord); 49 | structInsert(mockBug, 'Returns and Throws Data' , registry.registryDataMap); 50 | structInsert(mockBug, 'Method Arguments' , registry.argMap); 51 | return mockBug; 52 | } 53 | 54 | function printRegistryDebug(reg) { 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /mxunit/samples/mocking/TheStubTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /* 5 | Demonstrates how to use MightyMock to stub out data provided by a 6 | collaborator. 7 | 8 | */ 9 | function stubUserTest(){ 10 | //The component under test needs data provided by the collaborator 11 | var comp = createObject('component','TheComponent'); 12 | 13 | //1. Create the mock 14 | var mock_collaborator = mock('mightymock.examples.TheCollaborator'); 15 | //2. Define behavior 16 | mock_collaborator.getUser(1).returns(stubData()); 17 | 18 | //3. Inject mock into component under test 19 | comp.setCollaborator(mock_collaborator); 20 | 21 | //4. Exercise the component under test 22 | actual = comp.getUserAsStruct(1); 23 | 24 | //Do some tests to verify our component under test does what it should 25 | assertEquals(1,actual.id); 26 | assertEquals('mocked_bill',actual.name); 27 | assertEquals('mocked_bill@bill.com', actual.email); 28 | 29 | } 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 | data 43 | id,name,email 44 | 1|mocked_bill|mocked_bill@bill.com 45 | 2|mocked_bill2|mocked_bill2@bill.com 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mxunit/tests/samples/MyComponentTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | num = this.mycomp.add(1,1); 14 | addTrace("num == " & num ); 15 | assertEquals(num,2); 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | num = this.mycomp.add(1,1); 24 | addTrace("num == " & num ); 25 | assertEquals(num,3); 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | this.mycomp = createObject("component" ,"mxunit.samples.MyComponent"); 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /mxunit/ant/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | h2 { 19 | font-size: 200%; 20 | background-color: ffffff; 21 | } 22 | 23 | h3 { 24 | font-size: 130%; 25 | color: #ffffff; 26 | background-color: #525D76; 27 | } 28 | 29 | h4 { 30 | color: #ffffff; 31 | background-color: #828DA6; 32 | } 33 | 34 | td { 35 | background-color: eeeeee; 36 | color: 000000; 37 | } 38 | 39 | /* first row */ 40 | table tr:first-child td { 41 | background-color: cccccc; 42 | color: 000000; 43 | } 44 | 45 | /* or th as first row */ 46 | table th { 47 | background-color: cccccc; 48 | color: 000000; 49 | } 50 | 51 | pre { 52 | background-color: efefef; 53 | } 54 | -------------------------------------------------------------------------------- /mxunit/framework/HamcrestAssert.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/bug126.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | //itself 6 | assertIsTypeOf(this,"mxunit.tests.bugs.bug126"); 7 | //immediate parent 8 | assertIsTypeOf(this,"mxunit.framework.TestCase"); 9 | // grandparent 10 | assertIsTypeOf(this,"mxunit.framework.Assert"); 11 | //last of the mohicans 12 | assertIsTypeOf(this,"any"); 13 | 14 | 15 | 16 | 17 | 18 | //itself 19 | assertIsTypeOf(c,"mxunit.tests.bugs.fixture.93sample"); 20 | assertIsTypeOf(c,"any"); 21 | try{ 22 | assertIsTypeOf(c,"mxunit.framework.TestCase"); 23 | } catch(mxunit.exception.AssertionFailedError e){} 24 | 25 | 26 | 27 | 28 | 29 | assertIsTypeOf(webinf,"any"); 30 | try{ 31 | assertIsTypeOf(webinf,"mxunit.bogus.cfc.package.I'm not here"); 32 | } catch(mxunit.exception.AssertionFailedError e){ 33 | 34 | } 35 | 36 | 37 | 38 | 39 | 40 | 41 | c = createObject("component","mxunit.tests.bugs.fixture.93sample"); 42 | webinf = createObject("component","any");; 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /mxunit/utils/BubbleSort.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | var temp = ""; 8 | var sorted = true; 9 | var i = 1; 10 | var x = 1; 11 | var len = arrayLen(theArray); 12 | var value1 = ""; 13 | var value2 = ""; 14 | 15 | for(i = 1; i lte len; i = i + 1){ 16 | 17 | sorted = true; 18 | 19 | for(x = 1; x lte len - 1; x = x + 1){ 20 | 21 | if(isNumber){ 22 | if(isNumeric(theArray[x + 1][theKey])){ 23 | value1 = lsParseNumber(theArray[x + 1][theKey]); 24 | } 25 | else{ 26 | value1 = 9999; 27 | } 28 | 29 | if(isNumeric(theArray[x][theKey])){ 30 | value2 = lsParseNumber(theArray[x][theKey]); 31 | } 32 | else{ 33 | value2 = 9999; 34 | } 35 | } 36 | else{ 37 | value1 = theArray[x + 1][theKey]; 38 | value2 - theArray[x][theKey]; 39 | } 40 | 41 | if(value1 lt value2){ 42 | 43 | temp = theArray[x]; 44 | theArray[x] = theArray[x + 1]; 45 | theArray[x + 1] = temp; 46 | 47 | sorted = false; 48 | } 49 | } 50 | 51 | if(sorted){ 52 | break; 53 | } 54 | } 55 | 56 | return theArray; 57 | 58 | 59 | -------------------------------------------------------------------------------- /mxunit/PluginDemoTests/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /mxunit/samples/MyComponentTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | var num = this.mycomp.add(1,1); 14 | addTrace("num == " & num ); 15 | assertEquals(num,2); 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | var num = this.mycomp.add(1,1); 24 | addTrace("num == " & num ); 25 | assertEquals(num,3,"Intentionally failing so you can see what a failure looks like."); 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | this.mycomp = createObject("component" ,"MyComponent"); 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /mxunit/runner/index.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 | 25 |
26 |
27 | 28 |
29 |
30 | 34 |
35 |
36 | 37 |
38 | 39 | 40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/mxunit/testrunner/Simple Scheduled Test Run Template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple Scheduled Test Run Template 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

#dir#

13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | #results.getResultsOutput(URL.output)# 29 | 30 | 31 | 32 | 33 | #recenthtml# 34 | 35 | 36 | 37 | 38 | 39 | #recenthtml# 40 | 41 | ]]>
42 | 43 |
-------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (#arguments.projectTitle#) 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <H2> 31 | Frame Alert</H2> 32 | 33 | <P> 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | <BR> 36 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/WilcardPatternTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | mainRetVal = [1,2,3,4,5,6,7,8,9]; 5 | 6 | function $wilcardPatternSmokeTest(){ 7 | mock.foo('{+}').returns(mainRetVal); 8 | reg = mock._$getRegistry(); 9 | args = {1={1='asdasd'}}; 10 | p = reg.findByPattern('foo',args); 11 | debug( p ); 12 | debug( reg ); 13 | 14 | v = mock.foo('asdasd'); 15 | debug(v); 16 | assertEquals(mainRetVal,v); 17 | } 18 | 19 | 20 | function emptyParamsShouldWork(){ 21 | mock.foo('{*}').returns(mainRetVal); 22 | v = mock.foo(); 23 | assertEquals(mainRetVal,v); 24 | } 25 | 26 | function multipleParamsShouldWorkWithOneOrMoreWildCard(){ 27 | mock.foo('{+}').returns(mainRetVal); 28 | v = mock.foo('asdasd'); 29 | assertEquals(mainRetVal,v); 30 | v = mock.foo('asdasd',4564); 31 | debug(v); 32 | assertEquals(mainRetVal,v); 33 | 34 | v = mock.foo('asdasd',4564,'dfgdfg',345345,this); 35 | debug(v); 36 | assertEquals(mainRetVal,v); 37 | 38 | } 39 | 40 | 41 | function multipleParamsShouldWorkWithZeroOrMoreWildCard(){ 42 | mock.foo('{*}').returns(mainRetVal); 43 | v = mock.foo('asdasd'); 44 | assertEquals(mainRetVal,v); 45 | v = mock.foo('asdasd',4564); 46 | debug(v); 47 | assertEquals(mainRetVal,v); 48 | 49 | v = mock.foo(mainRetVal,4564,'dfgdfg',345345,this); 50 | debug(v); 51 | assertEquals(mainRetVal,v); 52 | debug(mock.debugMock()); 53 | 54 | } 55 | 56 | 57 | function setUp(){ 58 | mock.reset(); 59 | 60 | } 61 | 62 | function tearDown(){ 63 | 64 | } 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/.tmp_index.html.25338~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (#arguments.projectTitle#) 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <H2> 31 | Frame Alert</H2> 32 | 33 | <P> 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | <BR> 36 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 34 |
35 | 36 |

37 | #arguments.projectTitle# 38 |

39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
44 | Packages
#package#
56 | 57 |

58 |  


59 | 60 | 65 | 66 |
67 | 68 | 69 | 70 |
-------------------------------------------------------------------------------- /mxunit/doc/colddoc/strategy/api/resources/templates/.tmp_overview-summary.html.91099~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 34 |
35 | 36 |

37 | #arguments.projectTitle# 38 |

39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
44 | Packages
#package#
56 | 57 |

58 |  


59 | 60 | 65 | 66 |
67 | 68 | 69 | 70 |
-------------------------------------------------------------------------------- /mxunit/tests/utils/TestBubbleSort.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | variables.BubbleSort = createObject("Component", "mxunit.utils.BubbleSort"); 5 | 6 | 7 | 8 | 9 | 10 | var myStruct1 = structNew(); 11 | myStruct1.value = "apple"; 12 | myStruct1.order="4"; 13 | 14 | var myStruct2 = structNew(); 15 | myStruct2.value="banana"; 16 | myStruct2.order="6"; 17 | 18 | var myStruct3 = structNew(); 19 | myStruct3.value="grape"; 20 | myStruct3.order="12"; 21 | 22 | var myStruct4 = structNew(); 23 | myStruct4.value="orange"; 24 | myStruct4.order="35"; 25 | 26 | var myStruct5 = structNew(); 27 | myStruct5.value="pear"; 28 | myStruct5.order="21"; 29 | 30 | var myStruct6 = structNew(); 31 | myStruct6.value="mango"; 32 | myStruct6.order="5"; 33 | 34 | var myArray = arrayNew(1); 35 | 36 | myArray[1] = myStruct1; 37 | myArray[2] = myStruct2; 38 | myArray[3] = myStruct3; 39 | myArray[4] = myStruct4; 40 | myArray[5] = myStruct5; 41 | myArray[6] = myStruct6; 42 | 43 | var actual = BubbleSort.SortArrayOfStructs(myArray,"order",true); 44 | 45 | var expected = arrayNew(1); 46 | expected[1] = myStruct1; 47 | expected[2] = myStruct6; 48 | expected[3] = myStruct2; 49 | expected[4] = myStruct3; 50 | expected[5] = myStruct5; 51 | expected[6] = myStruct4; 52 | 53 | assertEquals(actual,expected); 54 | 55 | 56 | -------------------------------------------------------------------------------- /Koans/AboutExceptions.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator 3 | */ 4 | component extends="Koans.BaseKoan" { 5 | 6 | /** 7 | *@order 1 8 | */ 9 | public void function testCapturingAnError(){ 10 | var errorType = ""; 11 | 12 | try{ 13 | createError(); 14 | } 15 | catch(Object ex){ 16 | errorType = ex.type; 17 | } 18 | catch(Expression ex){ 19 | errorType = ex.type; 20 | } 21 | catch(Application ex){ 22 | errorType = ex.type; 23 | } 24 | catch(Any ex){ 25 | errorType = "any"; 26 | } 27 | 28 | //For a complete list or error types in ColdFusion9 visit http://adobe.ly/vFRFKo 29 | assertEquals(__,errorType); 30 | } 31 | 32 | private void function createError(){ 33 | var oops = 1 + doesntExist; 34 | } 35 | 36 | /** 37 | *@order 2 38 | */ 39 | public void function testCapturingACustomeError(){ 40 | var errorType = ""; 41 | 42 | try{ 43 | throwError(); 44 | } 45 | catch(Any ex){ 46 | errorType = ex.type; 47 | } 48 | 49 | assertEquals(__,errorType); 50 | } 51 | 52 | private void function throwError(){ 53 | throw(type="UserGeneratedError",message="I am a user generated error."); 54 | } 55 | 56 | /** 57 | * @mxunit:expectedException CustomErrorType 58 | * @order 3 59 | */ 60 | public void function testCreatingYourOwnException(){ 61 | //ColdFusion allows you to create your own exceptions and exception types http://adobe.ly/LF8mV9 62 | //In order to get this test to pass, get the generateError method to throw the type of error defined on line 57 63 | 64 | generateError(); 65 | } 66 | 67 | private void function generateError(){ 68 | //use the function throwError as an example 69 | } 70 | } -------------------------------------------------------------------------------- /mxunit/eclipse/snippets/keyCombos.properties: -------------------------------------------------------------------------------- 1 | #Fri May 21 12:28:50 EDT 2010 2 | injectproperty=/mxunit/helpers/injectProperty.xml 3 | true=/mxunit/assert/assertTrue.xml 4 | assertdecorator=/mxunit/assert/addAssertDecorator.xml 5 | teardown=/mxunit/tearDown.xml 6 | istypeof=/mxunit/assert/assertIsTypeOf.xml 7 | isxmldoc=/mxunit/assert/assertIsXMLDoc.xml 8 | errorpaths=/mxunit/new test error path function cfscript.xml 9 | false=/mxunit/assert/assertFalse.xml 10 | setups=/mxunit/setUp cfscript.xml 11 | querysim=/mxunit/helpers/querysim.xml 12 | queryrowcount=/mxunit/assert/assertQueryRowCount.xml 13 | injectMethod=/mxunit/helpers/injectMethod.xml 14 | isarray=/mxunit/assert/assertIsArray.xml 15 | trycatcherrorpath=/mxunit/assert/try catch error path.xml 16 | tests=/mxunit/new test function cfscript.xml 17 | isempty=/mxunit/assert/assertIsEmpty.xml 18 | fail=/mxunit/assert/fail.xml 19 | notequals=/mxunit/assert/assertNotEquals.xml 20 | notsame=/mxunit/assert/assertNotSame.xml 21 | dts=/mxunit/testrunner/Directory Test Suite Skeleton.xml 22 | override=/mxunit/helpers/test-time override function.xml 23 | equals=/mxunit/assert/assertEquals.xml 24 | failnotequals=/mxunit/assert/failNotEquals.xml 25 | teardowns=/mxunit/tearDown cfscript.xml 26 | makepublic=/mxunit/helpers/makepublic.xml 27 | debug=/mxunit/helpers/debug.xml 28 | setup=/mxunit/setUp.xml 29 | injectmethod=/mxunit/helpers/injectMethod.xml 30 | errorpath=/mxunit/new test error path function.xml 31 | same=/mxunit/assert/assertSame.xml 32 | failequals=/mxunit/assert/failEquals.xml 33 | test=/mxunit/new test function.xml 34 | mxunits=/mxunit/new MXUnit TestCase cfscript.xml 35 | mxunit=/mxunit/new MXUnit TestCase.xml 36 | regexp=/mxunit/assert/assertRegExp.xml 37 | -------------------------------------------------------------------------------- /mxunit/tests/framework/CSVUtilityTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /mxunit/resources/theme/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Tahoma,Arial,Helvetica,sans-serif; 3 | font-size:12px; 4 | color:#333; 5 | margin:0; 6 | padding:0; 7 | } 8 | 9 | a { 10 | color: #083772; 11 | } 12 | 13 | a:hover { 14 | text-decoration: underline; 15 | color: #083772; 16 | } 17 | 18 | a img { 19 | border: none; 20 | } 21 | 22 | p { 23 | margin: .5em 0; 24 | padding: .5em; 25 | } 26 | 27 | label { 28 | margin: .5em; 29 | line-height: 2em; 30 | font-weight: bold; 31 | } 32 | 33 | input { 34 | margin: .5em 0; 35 | } 36 | 37 | .pageHeader { 38 | padding: .25em 0; 39 | background: #eeeeee; 40 | -moz-border-radius-bottomleft: 1em; 41 | -webkit-border-bottom-left-radius: 1em; 42 | -moz-border-radius-bottomright: 1em; 43 | -webkit-border-bottom-right-radius: 1em; 44 | } 45 | 46 | .pageHeader .nav { 47 | margin-top: 1.5em; 48 | } 49 | 50 | .container_12 { 51 | border-top: 5px solid #083772; 52 | } 53 | 54 | .desc { 55 | font-size: .8em; 56 | font-family: serif; 57 | } 58 | 59 | .pageFooter { 60 | padding: 1em 0; 61 | text-align: center; 62 | } 63 | 64 | .footer a:hover { 65 | color: #DD3C10; 66 | text-decoration: none; 67 | } 68 | 69 | .align-center { 70 | text-align: center; 71 | } 72 | 73 | .float-left { 74 | float: left; 75 | } 76 | 77 | .message, 78 | .failure a { 79 | color: #083772; 80 | } 81 | 82 | .nav.horizontal { 83 | padding: 0; 84 | } 85 | 86 | .nav.horizontal li { 87 | float: left; 88 | list-style: none; 89 | } 90 | 91 | .nav.horizontal a, 92 | .nav.horizontal span { 93 | font-weight: bold; 94 | display: block; 95 | padding: .5em 1.5em; 96 | } 97 | 98 | .clear { 99 | clear: both; 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /mxunit/samples/mocking/TheMockTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /* 5 | Demonstrates how to use MightyMock to stub out data provided by a 6 | collaborator. 7 | 8 | */ 9 | function mockVerificationTest(){ 10 | //The component under test needs data provided by the collaborator 11 | var comp = createObject('component','TheComponent'); 12 | 13 | //1. Create the mock 14 | var mock_collaborator = mock('mxunit.samples.mocking.TheCollaborator'); 15 | //2. Define behavior ... return void 16 | mock_collaborator.logStuff().returns(); 17 | 18 | //3. Inject mock into component under test 19 | comp.setCollaborator(mock_collaborator); 20 | 21 | //4. Exercise the component under test 22 | actual = comp.callLoggerALot(); 23 | 24 | //5. Verify that the mock was called 25 | mock_collaborator.verifyTimes(25).logStuff(); 26 | 27 | 28 | } 29 | 30 | //intentional failure 31 | function peepWhatAVerificationFailureLooksLike(){ 32 | //The component under test needs data provided by the collaborator 33 | var comp = createObject('component','TheComponent'); 34 | 35 | //1. Create the mock 36 | var mock_collaborator = mock('mxunit.samples.mocking.TheCollaborator'); 37 | //2. Define behavior ... return void 38 | mock_collaborator.logStuff().returns(); 39 | 40 | //3. Inject mock into component under test 41 | comp.setCollaborator(mock_collaborator); 42 | 43 | //4. Exercise the component under test 44 | actual = comp.callLoggerALot(); 45 | 46 | //5. Verify that the mock was called 47 | //Should be 25 and will fail intentionally 48 | mock_collaborator.verifyTimes(20).logStuff(); 49 | 50 | 51 | } 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /mxunit/tests/framework/TestCaseExtendsTest.cfc: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | assertEquals("mxunit.tests.framework.TestCaseTest",this.md.extends.name); 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | function getAnnotationReturnsValueFromTestCaseUsingMxunitNamespace() { 24 | assertEquals("valueWithNS",getAnnotation(annotationName="testCaseLevelWithNS")); 25 | } 26 | 27 | function getAnnotationReturnsValueFromTestCaseUsingJustName() { 28 | assertEquals("valueWithoutNS",getAnnotation(annotationName="testCaseLevelWithoutNS")); 29 | } 30 | 31 | function getOverwrittenAnnotationReturnsValueFromTestCaseUsingJustName() { 32 | assertTrue(getAnnotation(annotationName="overWriteMe")); 33 | } 34 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mxunit/tests/bugs/ExpectedExceptionBug147Test.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mxunit/tests/mightymock/MockPlayTest.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function $peepArgumentCollection(){ 5 | var ac = createObjecT('java','coldfusion.runtime.ArgumentCollection'); 6 | //dump(ac); 7 | var ss = {z='z', a='a', hubuh='321', oof='aff' }; 8 | _peep(1,'a','zoo','A'); 9 | 10 | } 11 | 12 | function whenShouldSetStateToRegistering(){ 13 | cut = mock( 'com.foo.bar' ); 14 | cut.when(); 15 | assert( cut._$getState()=='registering' ); 16 | debug( cut.debugMock() ); 17 | } 18 | 19 | 20 | function testWhenSomethingIsCalled(){ 21 | cut = mock( 'com.foo.bar' ); 22 | cut.when().doSomething().returns(true); 23 | assert( cut.doSomething() ); 24 | } 25 | 26 | 27 | function guaranteeSortedStruct(){ 28 | var ss = {z='z', a='a', hubuh='321', oof='aff' }; 29 | var newArgs = createObject( 'java', 'java.util.TreeMap' ).init(ss); 30 | debug(newArgs); 31 | 32 | } 33 | 34 | function peepSortedStruct(){ 35 | var s = {z='z', a='a', hubuh='321', oof='aff' }; 36 | argumentCollection=s; 37 | dumpArgs(argumentCollection); 38 | 39 | } 40 | 41 | 42 | function setUp(){ 43 | 44 | } 45 | 46 | function tearDown(){ 47 | 48 | } 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | var set = arguments.values(); 67 | var it = set.iterator(); 68 | while(it.hasNext()){ 69 | dump( it.next().toString() ); 70 | } 71 | dump(it); 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /mxunit/samples/PluginSimulator.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 19 | 20 | 24 |

#methods[test]# -- #testResult[cfc][methods[test]]["result"]#

25 |

26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /mxunit/samples/MyOtherComponentTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | var num = this.mycomp.add(100,100); 14 | addTrace("num == " & num ); 15 | assertEquals(num,200); 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | var num = this.mycomp.add(0,-0); 24 | addTrace("num == " & num ); 25 | assertEquals(num,0); 26 | 27 | 28 | 29 | 30 | 31 | var a1 = arrayNew(1); 32 | var a2 = arrayNew(1); 33 | a1[1] = 'foo'; 34 | a2[1] = 'foo'; 35 | assertEquals(a1,a2); 36 | 37 | 38 | 39 | 40 | 41 | var a1 = arrayNew(1); 42 | var a2 = arrayNew(1); 43 | a1[1] = 'foo'; 44 | a2[1] = 'foo'; 45 | assertEquals(a1,a2); 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | this.mycomp = createObject("component" ,"MyComponent"); 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /mxunit/tests/samples/MyOtherComponentTest.cfc: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | num = this.mycomp.add(100,100); 14 | addTrace("num == " & num ); 15 | assertEquals(num,200); 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | num = this.mycomp.add(0,-0); 24 | addTrace("num == " & num ); 25 | assertEquals(num,0); 26 | 27 | 28 | 29 | 30 | 31 | a1 = arrayNew(1); 32 | a1[1] = 'foo'; 33 | a2 = arrayNew(1); 34 | a2[1] = 'foo'; 35 | assertEquals(a1,a2); 36 | 37 | 38 | 39 | 40 | 41 | a1 = arrayNew(1); 42 | a1[1] = 'foo'; 43 | a2 = arrayNew(1); 44 | a2[1] = 'foo'; 45 | assertEquals(a1,a2); 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | this.mycomp = createObject("component" ,"mxunit.samples.MyComponent"); 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | --------------------------------------------------------------------------------