锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕亚洲一区二区va在线,91精品国产高清久久久久久91裸体,久久久五月天http://www.aygfsteel.com/tufanshu/category/9675.html娌℃湁椋庨洦韜茬殑榪囷紝 娌℃湁鍧庡澐涓嶅繀璧扳︹? zh-cnWed, 28 Feb 2007 23:36:51 GMTWed, 28 Feb 2007 23:36:51 GMT60appfuse鐨勫畨瑁呴厤緗瘒http://www.aygfsteel.com/tufanshu/archive/2006/04/07/39904.html闆湴瀛ら縛闆湴瀛ら縛Fri, 07 Apr 2006 11:55:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2006/04/07/39904.htmlhttp://www.aygfsteel.com/tufanshu/comments/39904.htmlhttp://www.aygfsteel.com/tufanshu/archive/2006/04/07/39904.html#Feedback0http://www.aygfsteel.com/tufanshu/comments/commentRss/39904.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/39904.html 鍦ㄧ綉涓婃壘浜嗗緢涔咃紝鐪嬩簡寰堝鐨勬枃妗o紝緇堜簬灝哸ppfuse鎴愬姛鐨勭紪璇戯紝鍙戝竷浜嗭細榪欐牱鎰熻阿騫垮ぇ緗戝弸鐨勬棤縐佸鐚簡錛屽ソ浜嗭紝闂茶瘽灝戣浜嗭紝鍏蜂綋鐨勬搷浣滃涓嬶細
Appfuse1.9,JDK1.5,ANT1.6.2,Mysql5.0,Tomcat5.5

涓.鐜璁劇疆錛?br />浠ヤ笅鐜鍙橀噺鍧囨寜鏈満鐨勫畨瑁呰礬寰勮緗嵆鍙?br />ANT_HOME,
JAVA_HOME,
CATALINA_HOME,
MYSQL_HOME
Path涓姞鍏?br />%JAVA_HOME%bin;%ANT_HOME%bin;%CATALINA_HOME%bin;%MYSQL_HOME%bin;
浜?鍦╡clipse涓嬌鐢╝nt緙栬瘧錛屽彂甯冿紝嫻嬭瘯appfuse
1.Create New Java Project in Eclipse
Open Eclipse (either with an existing or a new workspace) and to go File 鈫?New 鈫?Project. Then select "Java Project" and hit the Next button. In the Project Name field, enter the name of your project (i.e. appfuse) and the directory that your project lives (i.e. c:\source\appfuse) in the box below. If you're prompted to switch the Java Perspective, choose Yes.
If you try to build the project at this point, you'll likely get numerous errors. Most of them involve the fact that the UserForm class can not be found. This is because all of the ActionForms in AppFuse (if you're using the Struts version) are generated from POJOs with XDoclet.

All of the tasks for XDoclet are configured in the Ant build.xml file so the easiest thing to do is to run "ant gen-forms" to generate the ActionForms. If you have Ant 1.6.2+ installed and in your path, you can do this from the command line. The next step shows you how configure Eclipse to run your AppFuse build.xml.

2.Configuring Ant in Eclipse

The easiest way to configure Eclipse for AppFuse is to install Ant on your hard drive (i.e. c:\Tools\apache-ant-1.6.2) and then point Eclipse's ANT_HOME to this directory. To do this, go to Window 鈫?Preferences 鈫?Ant 鈫?Runtime. Then click the "Ant Home" button and select the installation folder on your hard drive.

If you'd rather use Eclipse's built-in Ant, you'll need to add junit.jar to its classpath. To do this, go to Window 鈫?Preferences 鈫?Ant 鈫?Runtime. Then click the "Add JARs" button and select junit.jar from appfuse/lib/junit3.8.1/lib/junit.jar. Click OK until you arrive back at the workbench view.

Next, add the catalina-ant.jar (from $CATALINA_HOME/server/lib) to the ant classpath. Then in the property tab, add tomcatTasks.properties (in lib/ant-contrib) file as a global properties file.

Below is a screenshot of what your Ant Runtime classpath should look like after the above modifications:
ant-runtime.png

3.Add build.xml to Ant View
Now we need to add the build.xml to Eclipse's Ant View. To do this, go to Window 鈫?Show View 鈫?Ant. Then click on the first icon in this view (screenshot below) to add AppFuse's build file.
ant-view.png

4.Run Ant
After adding the build.xml, you should be able to expand it in the Ant View and execute any of the targets. I usually do "test-all" to verify all the tests pass in my initial project. For a list of targets I use most often, see AppFuse Ant Targets.
Now if you run the "compile" target and then refresh the project (right-click on project 鈫?Refresh) you shouldn't see any errors in the "Problems" pane. You should now be able to compile and create classes as you normally would. Sometimes when my imports aren't resolving correctly in Eclipse, I do have to run Project 鈫?Clean in Eclipse.

NOTE: If you're using the internal version of Ant, you may get an error message like the one below:
BUILD FAILED: C:\source\appfuse\build.xml:802: The following error occurred while executing this line:
C:\source\appfuse\build.xml:780: The following error occurred while executing this line:
java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat
This is because there are tasks that require Xerces to be in your Ant classpath [reference]. I added xercesImpl.jar and xml-apis.jar (from my self-installed version of Ant) to Eclipse's Ant classpath to solve this.
5.Run JUnit Tests in Eclipse
It's also possible to run your JUnit tests in Eclipse. But before running them, you need to run the "war" target. After this target completes, refresh your project.
After you have successfully done so, in Eclipse open a test you'd like to run (i.e. UserDaoTest) and go to Run 鈫?Debug As 鈫?JUnit Test. Note that you may have to run the "db-load" target before you run your tests every so often. I did have the following method in the Base*TestCase class for each layer, but this caused DBUnit to reload the database before every test in a Test class. Removing it reduces the execution time of "test-all" by more than 30 seconds.

聽聽聽 protected void setUp() throws Exception {
聽聽聽聽聽聽聽 DataSource ds = (DataSource) ctx.getBean("dataSource");
聽聽聽聽聽聽聽 IDatabaseConnection conn = new DatabaseConnection(ds.getConnection());
聽聽聽聽聽聽聽 IDataSet dataSet =
聽聽聽聽聽聽聽聽聽聽聽 new XmlDataSet(new FileInputStream("metadata/sql/sample-data.xml"));
聽聽聽聽聽聽聽 // clear table and insert only sample data
聽聽聽聽聽聽聽 DatabaseOperation.CLEAN_INSERT.execute(conn, dataSet);
聽聽聽聽聽聽聽 conn.close();
聽聽聽 }聽


If the instructions above don't work for running JUnit tests in Eclipse, I suggest just using the command line - i.e. ant test-dao -Dtestcase=UserDAO. Running tests from the command line always works. ;-)

濂戒簡 錛屽湪eclipse涓熀鏈寜浠ヤ笂鎿嶄綔灝卞彲浠ユ垚鍔熶簡錛岀瓑鏈夋椂闂達紝鎴戞潵緲昏瘧涓涓嬶紝铏界劧鎴戠殑e鏂囨瘮杈冪儌錛屼絾鏄繕鏄箰浜庤澶у鏍℃鐨?br />錛氾級鍘熸枃鐨勫湴鍧錛?a >http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseEclipse
闂鎻忚堪
1.鍒氬紑濮嬬殑鏃跺欙紝鎴戜滑鐨刴ysql鐨勭敤鎴峰悕鍜屽瘑鐮佸彲鑳藉拰appfuse鐨勯粯璁ょ殑鐢ㄦ埛鍜屽瘑鐮佷細涓嶄竴鏍風殑錛岃繖涓彲浠ュ埌properties.xml鏂囦歡涓慨鏀逛負鎴戜滑瀹夎mysql鏄緗殑鐢ㄦ埛鍚嶅拰瀵嗙爜錛屾垜鐨勪慨鏀瑰涓嬶細
聽<!-- Defaults for database.properties -->
聽聽聽 <property name="database.jar" location="${mysql.jar}"/>
聽聽聽 <property name="database.type" value="mysql"/>
聽聽聽 <property name="database.name" value="appfuse"/>
聽聽聽 <property name="database.host" value="localhost"/>
聽聽聽 <property name="database.username" value="root"/>
聽聽聽 <property name="database.password" value="780121"/>
聽聽聽
聽聽聽 <!-- database URL for creating other dbs - used in db-create target -->
聽聽聽 <property name="database.admin.url" value="jdbc:${database.type}://${database.host}/mysql"/>
聽聽聽 <property name="database.admin.username" value="root"/>
聽聽聽 <property name="database.admin.password" value="780121"/>
聽聽聽 <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
聽聽聽 <property name="database.driver_class" value="com.mysql.jdbc.Driver"/>
聽聽聽 <property name="database.url"
聽聽聽聽聽聽聽 value="jdbc:${database.type}://${database.host}/${database.name}?useUnicode=true&amp;amp;characterEncoding=utf-8"/>
聽聽聽 <property name="database.show_sql" value="true"/>

鎴戞槸淇敼浜唕oot鐢ㄦ埛鐨勫瘑鐮侊紝褰撶劧浣犱篃鍙互寤虹珛test鐢ㄦ埛騫剁粰鍒濆瀵嗙爜錛氾級
2.榪炴帴鏁版嵁搴撶殑闂瑙e喅鍚庯紝鍙﹀涓涓棶棰樻湁鍑烘潵浜嗭紝寤虹珛user_role琛ㄧ殑鏃跺欏嚭闂浜嗭細org.dbunit.dataset.NoSuchTableException: user_role
榪欎釜闂鐨勮В鍐蟲柟寮忓涓嬶細
setup-tomcat deploy
ant setup -Ddatabase.username=foo -Ddatabase.password=bar
榪欎釜涓昏鏄厛鎵ц浠ヤ笅build.xml涓殑setup-tomcate deploy鎸囦護灝卞彲浠ヤ簡錛氾級
鍘熻澆鍦板潃錛?a >http://b0r0j0.blogbus.com/logs/2005/12/1725103.html



闆湴瀛ら縛 2006-04-07 19:55 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 昆山市| 维西| 安康市| 伊宁县| 黑水县| 海南省| 昌都县| 调兵山市| 慈利县| 茶陵县| 唐河县| 松江区| 宁城县| 墨竹工卡县| 深泽县| 广灵县| 甘肃省| 虞城县| 维西| 桂东县| 藁城市| 金川县| 柏乡县| 上蔡县| 巩留县| 杨浦区| 龙陵县| 沧州市| 中方县| 尖扎县| 油尖旺区| 黄山市| 祁东县| 儋州市| 渝北区| 合山市| 长岛县| 西峡县| 洪泽县| 石柱| 桃源县|