background preloader

Mockito - simpler & better mocking

Mockito - simpler & better mocking
06-10-2012: Mockito 1.9.5 released! See the release notes. Should appear in maven central shortly. Mockito is a mocking framework that tastes really good. "We decided during the main conference that we should use JUnit 4 and Mockito because we think they are the future of TDD and mocking in Java" - Dan North, the originator of BDD More quotes Over 15000 downloads of 1.9.0 version ('12), excluding maven/Gradle users. More about the user base Download mockito-all-x.x.x.jar and put it on the classpath. Then you can verify interactions: Or stub method calls Click here for more documentation and examples. If you have any suggestions, find documentation unclear or you found a bug, write to our mailing list. Mockito is served to you by Szczepan Faber and friends. Firstly, hats down before EasyMock folks for their ideas on beautiful and refactorable mocking syntax. Special thanks to Steve Christou for setting up the continuous builds at his Hudson server. Thanks to YourKit for the profiler! Related:  DEVOPS

FindBugs™ - Find Bugs in Java Programs Test Driven Development (TDD): Best Practices Using Java Examples | Technology In the previous article Test Driven Development (TDD): Example Walkthrough an example of TDD was given. It went from writing first test and its implementation to having a set of requirements fully tested and developed. Now it’s time to learn what the best TDD practices are. This article will be built on examples from the previous one. Best practices are solutions to a set of problems under certain situations. Some of the best practices described here are inherited from other sets of practices and used when doing TDD. Source code for all examples can be found in the github repository Before explaining best practices, it is important to understand the TDD life-cycle. Write the testRun the test (there is no implementation code, test does not pass)Write just enough implementation code to make the test passRun all tests (tests pass)RefactorRepeat Test-driven development is not about testing. Naming Conventions [GRADLE: build.gradle] Tools

JAutodoc - Eclipse Plugin Continuous Integration I vividly remember one of my first sightings of a large software project. I was taking a summer internship at a large English electronics company. My manager, part of the QA group, gave me a tour of a site and we entered a huge depressing warehouse stacked full with cubes. But this needn't be the way. This contrast isn't the result of an expensive and complex tool. When I've described this practice to people, I commonly find two reactions: "it can't work (here)" and "doing it won't make much difference". The term 'Continuous Integration' originated with the Extreme Programming development process, as one of its original twelve practices. Although Continuous Integration is a practice that requires no particular tooling to deploy, we've found that it is useful to use a Continuous Integration server. Building a Feature with Continuous Integration I begin by taking a copy of the current integrated source onto my local development machine. However my commit doesn't finish my work.

ModelGoon UML4Java ContinuousDelivery delivery · version control · continuous integration tags: Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to production at any time. You’re doing continuous delivery when: [1] Your software is deployable throughout its lifecycle Your team prioritizes keeping the software deployable over working on new features Anybody can get fast, automated feedback on the production readiness of their systems any time somebody makes a change to them You can perform push-button deployments of any version of the software to any environment on demand You achieve continuous delivery by continuously integrating the software done by the development team, building executables, and running automated tests on those executables to detect problems. To achieve continuous delivery you need: a close, collaborative working relationship between everyone involved in delivery (often referred to as a "DevOps culture" [2]).

Codenvy Introduces Docker-Powered Developer Workspaces Codenvy has evolved its flagship service from a cloud-based code editor to a full fledged, container-based development environment. Codenvy CEO and Founder Tyler Jewell told InfoQ that Codenvy is no longer an “IDE, but an orchestration engine” that wants to optimize “everything before the commit.” Codenvy claims that developers spend more than thirteen hours per week configuring and maintaining their development environment. Codenvy is microservices-powered to deliver workspaces that are responsive and fast-loading. “Runners” are Docker-encapsulated processes that execute all the components of an application. With native git support, the Developer Environment Cloud lets developers clone public or private repositories into the internal git repository. When a Project is created, its Project tree is populated with a set of files that are the code, assets, and resources. This product evolution resulted from a gap in the developer workflow noticed by Codenvy CEO Tyler Jewell.

For unit testing, I find this far easier to work with than or One thing it cannot do is mock static methods. I of the other 2 can do that by superunknown Apr 10