Using the idea of the class and the reflection of Java, build a flexible, reasonable system (2) - write to Java beginners
Part II: Analysis of the system
First, the determination of system configuration mode
For a flexible system, the configuration file is indispensable (everyone has heard of Struts, knowing a struts-config.xml file). Here, I also use XML as the profile of our automation test system. And, I chose the DOM API as a resolution tool for the XML configuration file.
At the same time, give you XML enthusiasts. If you need to design an XML file format during work or learning. It is recommended that you start designing from DTD / Schema, after designing DTD / Schema, then writing XML files based on them. Don't write the XML file directly at the beginning, this is not good. At least I think it doesn't meet the XP style, and it is not easy to verify that your XML is correct.
In addition, for DTD / Schema and XML writing, I also recommend that you use some professional tools. Do not use Notepad or UltraEdit or EditPlus.
Although they also support XML syntax highlights, it looks clear, and the lookup feature is also very powerful. However, I still recommend everyone to use professional XML editing development tools, to do things! I use Xmlspy, which can be checked for the XML file you have written!
Second, the choice of test tools:
In today, this is very particular about XP (extreme programming), it seems to be popular in Test First First! I am no exception.
Since the main goal of this article is testing, then the choice of test tools is inevitably a major goal, here I choose: httpunit.
For the veteran of the test world, it will definitely know why I choose httpunit. Perhaps they choose a better test tool (I hope the element of the software test world will also introduce their thoughts).
Here, for those Java beginners, and I want to know XP thinking, I will briefly introduce the reason I choose HTTPUNIT.
It may, in the world of Java and XP, the name of JUnit is very popular. However, JUnit is not very suitable for the automated test system that we envisaged; because I think it is mainly a unit test of the class's function, and I am currently tested is a web-based test framework. If, I use Junit as a test tool, I have to make further packages (please note, here, we have appeared in the package! The idea of packaging will also run through this article!).
Perhaps, some friends will say that Can StrutstestCase can also test the web? Moreover, he has made a package for JUnit, why not do it.
Reasons for it, it is: it is mainly tested for Struts.
I have been so thinking: an object (in Java, we can call it for classes: class), you should, don't have a kitchen;
This also reflects the highner gathering and low coupling ideas of software engineering. So I chose HTTPUnit as my main test tool. It is mainly for HTTP to make functional tests and also encapsulated JUnit. Regarding the specific usage of HTTPUNIT, it is not within the scope of this article, please refer to the relevant information. I am here only to choose the test depending on the test, I hope everyone can establish a good habit of "first analysis, post-design, and re-encoding" from the beginning. Using class ideas and Java reflex (Reflect) technology, build a flexible, reasonable system (1) http://www.9cbs.net/develop/read_article.asp?id=23408 use the idea of using classes and Java Reflecting technology, constructing a flexible, reasonable system (2) http://www.9cbs.net/develop/read_article.asp?id=23409 Application class's ideology and Java reflection (reflect) technology, construction A flexible, reasonable system (3) http://www.9cbs.net/develop/read_article.asp?id=23410 Using the idea of using classes and Java reflexes, build a flexible, reasonable system (4) http://www.9cbs.net/develop/read_article.asp?id=23411 Using the idea of using classes and the reflection of Java, build a flexible, reasonable system (5) http: // Www.9cbs.net/develop/read_article.asp?id=23412 Using the idea of the class and the reflection of Java (Reflect) technology, build a flexible, reasonable system (6) http://www.9cbs.net/develop /READ_Article.asp?id=23413