Personal tools
You are here: Home Documentation Manuals ArchGenXML 2 - Developers Manual Step by Step Instructions Setup of a Testcase Environment using UML and ArchGenXML
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

5.1. Setup of a Testcase Environment using UML and ArchGenXML

Up one level
Environment for test-driven and architecture centric development.

TODO: Check if it works in 2.0. Add some information how to run the tests.

About Testing

Since development is going on at many places in the Plone system, it is important to have a way ready to test if the software you wrote is affected by the changes. And, more important the other way around, if your work, in case it makes it way into the Plone core or other add-on products, affects the work of others.

There are several documents available to read on why testing is important, so feel free to have a look:

and there are many more: Try the testing. Some of these documents are describing in detail how to write the tests itself, which this manual page is not intended for.

Testing and UML/ ArchGenXML

This document describes the few steps necessary to setup your testing environment when using an UML diagram and ArchGenXML. It generates your projects with the test infrastructure and you can focus on writing the test itself

ArchGenXML provides a pre-configured testing environment - no more hand-work to create it !

Steps:

  1. Check if PloneTestCase product was shipped with your Plone. If not install it in the version for your Plone.
  2. Create a package in your model and name it tests and give it the stereotype <<tests>>
  3. Inside the new tests package create class MyFancyTestcase (in the uml below named testPlone) and give it the stereotype <<plone_testcase>>. This is your main testcase class.
  4. Create an additional class inside the test package, call it testSetup, and give it the stereotype <<setup_testcase>>. Let it derive from the main testcase class using the generalization arrow.
  5. Testing methods/behaviour of archetypes classes: Create a class inside the test package. Give it the stereotype <<testcase>> or <<doc_testcase>>. Make them derive from main testcase class using the generalization arrow. On a testcase class you can add methods starting with test such as testMyFancyFeature. After code generation you just need to fill in your test code. A doc_testcase class creates an empty doctest text-file in the /docs directory of your product. There are some tagged value available to control the testcase in detail. Please look at the chapter Reference - Tagged Values for more information.
  6. To generate all imports and some startup code, you can use the dependency arrow from the testcase class to the archetypes class.
  7. You can repeat 5 and 6 for every class you want to include in yout test. You can organize your tests also different, like one integration test, as you like.
  8. Generate and run the tests. (TODO: steps needed to get the test fly, such as zopectl test or setting SOFTWAREHOME and INSTANCEHOME environment.

sample UML

These are the basic steps necessary to get it running.

by Jens W. Klein last modified November 15, 2007 - 08:55
Contributors: Jens W. Klein (jensens), Reinout van Rees (reinout), Martin Aspelli (optilude), Harald Frisnegger (frisi), Bernhard Snizek (drzoltron), Richard Amerman (fifer), Torsten Dieter Kuehnel, Encolpe Degoute (encolpe), et al
All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by