Goingmm

  BlogJava :: 首页 :: 新随笔 ::  :: 聚合  :: 管理 ::
  82 随笔 :: 15 文章 :: 452 评论 :: 0 Trackbacks

------------------------------------------------------------------------------------------------
   Eclipse Platform
Version: 3.1.0 Build id: I20050219-1500

   
  Junit Version:
3.8.1

------------------------------------------------------------------------------------------------

EclipseJunit 大家应该都很熟悉了。这里我也不打算去讲为什么需要做这样的组合。为什么需要测试。为什么测试还有那么多讲究和学问。用一个最简单的例子,让还没有使用过的朋友,有一个简单的认识。主要是发图玩玩

 

1)看看完成后的效果图
Project.JPG

2)      
运行Eclipse。新建一个workplace项目,点击 file->new->project,选择Java项目,点击下一步。写一个项目名称,例如UseJUnit。点击Finish。这样就完成新项目的建立。再来配置一下Eclipse,在构建路径中添加JUnit类库。在工具条上点击项目->属性,选择Java Build Path,Libraries,选择 Add external JARs,浏览Junit被存储的目录,选择junit.jar,点击打开。你将会看见JUnit出现在库的列表中。点击确定,让Eclipse重建路径。
addJar.JPG

         

3)新建一个Class Person
Person.JPG

4) 新建一个Test Class TestCaseWithJunit
newJunit.JPG

代码如下:public void testSay() 方法是我自己加进去的

TestCaseWithJunit.JPG

5) Run Test case
   runJunit.JPG

6) 看看测试结果
      result-1.JPG

7)修改一下测试代码
   modifiedcode.JPG

8)再看测试结果
result-2.JPG

result-3.JPG



呵呵! 第一次发图。如果上面的过程描述有什么不清楚的地方。请与我联系

2005-11-13  听涛 窗台


posted on 2005-11-13 13:45 Goingmm 阅读(365) 评论(1)  编辑  收藏 所属分类: Reading Note

评论

# re: Eclipse + Junit 2005-11-13 14:28 _
这个 blog 居然会这样:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: