UnittestsXP Compiler on Travisat 2013-05-05 in Unittests, Language by friebeRFC #0267: Unittest parameterizationat 2013-04-01 in Unittests, RFCs by friebeScope of Change This will extend the unittest API by adding a facility for providing values to a test. Rationale This will make it easier to discover problems in tests written using foreach loops currently, and at the same time reduce the amount of code that needs to be written for tests with separate test methods for every value. Read the full RFC here. Ubuntu users: Heads up!at 2012-09-04 in Announcements, Unittests by friebeIf you recently updated your runners using the xprt-update.sh script distributed alongside them, you would start receiving errors such as ./unittest: 99: ./unittest: Bad substitutionon certain platforms (this included our Travis CI build, which was broken today because of this). We could verify this would happen on two separate Ubuntu instances. The problem was that we were using the string-replace feature not supported by "pure" shell - ${string//substring/replacement} - we'd tested on Windows / Cygwin and Gentoo installations before releasing, but both symlink /bin/sh with /bin/bash, while Ubuntu (and probably also others) don't. A fix for this was committed and a new version was released. To update your runners, use the manual way (the update script mentioned above relies on functioning xp runners): $ cd /path/to/xp/runnersThis will overwrite the runners with the newer versions. 5.8.6-RELEASE: Unittestsat 2012-07-09 in Releases, Unittests, Announcements, 5.8-SERIES by friebeThe XP Group is proud to announce the immediate availability of the XP Framework release 5.8.6. This release has focussed on improving the unittests APIs:
Go get it! $ cd ~/xp Enjoy Surpassed 5000 unittestsat 2012-07-07 in Unittests by friebeOn a short note: The XP Framework's core now surpassed 5000 unittests: $ unittest src/test/resources/*iniAlthough can never have enough tests, this is a tenfold compared to a couple of years ago, when we had reached 500+ "Infinitest" with the XP Frameworkat 2012-06-30 in Unittests by friebeThinking about our upcoming 5.8.6 release whose focus is on unittesting, I recently came up with the idea to have unittests run whenever I change, and save, the code I'm working on (yesterday evening I found out in the Java world this is called "infinitest" - my focus though was to get this done on the command line, without the necessity to plug in to various IDEs). Searching for utilities to monitor the file system for changes, I found the "inotify tools". Since I work on Windows using Cygwin though, I decided to "port" them using the .NET Framework's FileSystemWatcher class. The results can be found here (just clone and run "make" - prerequisites are .NET Framework v3.5). Given this, the basic command line is: $ inotifywait -r -m src/ | while read line ; do \ Extending this example to run unittests is easy, especially with unittest now accepting paths as command line argument. Last but not least, we use an additional listener to update the xterm or xterm compatible shell's title with the progress and the "executive summary" later on, so we only have to glance at the console's title bar to see what's going on. ![]() infinittest for XP running in a mintty window Putting it all together, we now end up with the following command line: $ inotifywait -r -m src/ | while read line ; do \ Pretty cool, I'd say! RFC #0255: Allow multiple @beforeClass / @afterClass methodsat 2012-06-30 in RFCs, Unittests by friebeScope of Change The unittest runner will support running multiple @beforeClass / @afterClass methods. Rationale Greater flexibility Read the full RFC here Continuous integration in the cloudat 2012-05-09 in Announcements, Unittests by friebeTo learn more about Travis CI, visit their about page. 5.8.4-RELEASE: Multiple config sources, selectable database drivers, SQLite3, MySQL local sockets, mocking libraryat 2012-02-26 in Releases, Unittests, Databases, Announcements, 5.8-SERIES by friebeThe XP group is proud to announce the immediate availability of framework release 5.8.4. After four release candidates and about three and a half months, we deliver a bigger release, including the following: Multiple config sources This feature described in RFC #0221 enables combining properties from more than one source (e.g., ini-files). For example, one can now have a global, system-wide configuration and extend on that in your application. This feature is supported by "XPCLI" commands and the web runner - details can be found here. Selectable database drivers With more and more database protocols appearing as userland implementation (MySQL, Sybase, MSSQL), the urge to be able to chose between drivers has come up; and be it just for testing. To select a specific driver, append the implementation name to the driver, e.g. mysql+std to select ext/mysql. To retrieve the default MySQL driver, one can still use mysql://user@host DSN syntax. SQLite3 With the deprecation of SQLIte2 in PHP 5.4, we have decided to implement SQLIte3 support in the XP Framework. At the same time, and because we now offer selectable drivers, the default is SQLIte3. MySQL local sockets We now support local socket connectivity in our MySQL driver implementation by using the special hostname ".": By using "mysql://./DATABASE", we connect through a local socket, while "mysql://localhost/DATABASE" uses TCP/IP. This has been unified throughout the various MySQL drivers. Mocking library The package unittest.mock contains the all-new mocking library. The API is modeled in a fashion similar to EasyMock (Java), Rhino Mocks (.Net). You can read all about the details in RFC #219. ...and more We have almost 20 bugfixes and various features included in this release - all of which can be seen in the ChangeLog. Go get it! $ cd ~/xp Enjoy Overwriting Testcase's special methodsat 2011-03-21 in Unittests, Announcements by friebeA fix has been committed to the unittest API that prevents (accidentally) overwriting special methods from unittest.TestCase. What had happened is the following: class SystemPropertyTest extends TestCase { As the XP Framework doesn't require a "test" prefix on the method names, it has become common practice to name the test methods after the methods they're testing, usually appending or prepending the variant (e.g. "singleAddItem" and "multipleAddItem"); in this case there was no variation and thus the simple name. Unintentionally, this was now overwriting the unittest.TestCase::getName() method, which in turn was creating faulty output when rendering the test result. If you made the above testcase fail, the test runner would even raise an uncaught exception and not report any results at all. This has now been fixed; and the erroneous overwriting will be reported early along as lang.IllegalStateException: Cannot override unittest.TestCase::getName with test method in com.example.unittest.systems.SystemPropertyTest. |
|