• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why XML for units tests?

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Writing tests should be easy and fast.
Why did you decide to use XML files to configure test suites?
Thanks.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first you talked about writing tests and then latter you are asking why about configuring. So, its clear and you know that we write test in Java using JUnit or other extensions and then configure the test suite using XML.

Now there are several benefits of configuring a test suite.

- You can use your test suite in continuous integration
- You can use your test suite to analyse code coverage
- Typically test suites are flexible enough to run a single test.
- Sometimes you need different database configuration say, test, prod, dev. It helps configuring these.

Its not at all difficult to configure a test suite. There are lots of tools available for that.
[ December 18, 2007: Message edited by: Adeel Ansari ]
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I understand this but writing XML file for test seems overkill to me.
Why not to write a Java class instead of XML?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Todd:
Yes, I understand this but writing XML file for test seems overkill to me.

Me too!


Yes, I understand this but writing XML file for test seems overkill to me.

One reason listed frequently is that it avoids a recompile. I don't fully understand the benefits of avoiding the recompile though, hence my question:
Why is recompiling bad?
 
Hani Suleiman
author
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing worth clarifying, you do NOT need an xml configuration file to run a test, it's just one of the (many) options.

Other options include:
- ant
- IDEA
- Eclipse
- command line

None of the above require an xml file, you can just select a test class and run it directly.

I'll cover the benefits of using an xml configuration file in another thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic