JAVA常用的第三方类库 水深无声 2022-07-12 14:30 220阅读 0赞 转 :[http://www.softhouse.com.cn/news/show/104559.html][http_www.softhouse.com.cn_news_show_104559.html] Java第三方library ecosystem是一个很广阔的范畴。 单元测试 1.DBUnit([http://www.dbunit.org/][http_www.dbunit.org]) DBunit是一个基于junit扩展的数据库测试框架。它提供了大量的类对与数据库相关的操作进行了抽象和封装。 2.MOckito([http://mockito.org/][http_mockito.org]) Mockito是一个针对Java的mocking框架。你可以使用简洁的API编写出漂亮的测试。 3.Hamcrest Matchers([http://code.google.com/p/hamcrest/][http_code.google.com_p_hamcrest]) Hamcrest 是一个测试辅助工具,提供了一套通用的匹配符 Matcher,灵活使用这些匹配符定义的规则,程序员可以更加精确的表达自己的测试思想,指定所想设定的测试条件。 Junit4结合Hamcrest提供了新的断言语句-assertThat,只需一个assertThat语句,结合Hamcrest提供的匹配符,就可以表达全部的测试思想。 Apache Commons 4.Configuration([http://commons.apache.org/configuration/][http_commons.apache.org_configuration]) 这个工具是用来帮助处理配置文件的,支持很多种存储方式 5.DbUtils([http://commons.apache.org/dbutils/][http_commons.apache.org_dbutils]) DbUtils可以将数据库操作单独做成一个包,简化数据库操作。 6.IO([http://commons.apache.org/io/][http_commons.apache.org_io]) 可以看成是java.io的扩展。它提供了文件阅读功能,以及一些使用的方法,类似于DbUtils。 7.Lang([http://commons.apache.org/lang/][http_commons.apache.org_lang]) 如果你要问我还有哪个库一会在此名单之上,我会告诉你是Lang或者google Collections。lang可以看成是对java.lang的扩展,提供了诸如StringUtils, StringEscapeUtils, RandomStringUtils, Tokenizer, WordUtils等工具类。 8.SLF4J([http://www.slf4j.org/][http_www.slf4j.org]) SLF4J是为各种loging APIs提供一个简单统一的接口,从而使得最终用户能够在部署的时候配置自己希望的loging APIs实现。Slf4j类似于Apache Common-Logging和Log4J,但Slf4j比它们都要优秀。 9.Google Collections([http://code.google.com/p/google-collections/][http_code.google.com_p_google-collections]) Java的集合框架是Java类库当中使用频率最高的部分之一,而Google Collections库是由Google基于Java5.0 Collections Framework开发的一套新的Java集合框架,提供一些高级集合操作的API。 10.c3p0([http://www.mchange.com/projects/c3p0/index.html][http_www.mchange.com_projects_c3p0_index.html]) C3P0是一个随Hibernate一同分发的开源的JDBC连接池, 它位于lib目录下。 包括了实现jdbc3和jdbc2扩展规范说明的Connection 和Statement 池的DataSources 对象。 11.Joda Time([http://joda-time.sourceforge.net/][http_joda-time.sourceforge.net]) Joda Time是一个强大易用的日期和时间库,可以完全取代JDKDate和Calendar类。 [http_www.softhouse.com.cn_news_show_104559.html]: http://www.softhouse.com.cn/news/show/104559.html [http_www.dbunit.org]: http://www.dbunit.org/ [http_mockito.org]: http://mockito.org/ [http_code.google.com_p_hamcrest]: http://code.google.com/p/hamcrest/ [http_commons.apache.org_configuration]: http://commons.apache.org/configuration/ [http_commons.apache.org_dbutils]: http://commons.apache.org/dbutils/ [http_commons.apache.org_io]: http://commons.apache.org/io/ [http_commons.apache.org_lang]: http://commons.apache.org/lang/ [http_www.slf4j.org]: http://www.slf4j.org/ [http_code.google.com_p_google-collections]: http://code.google.com/p/google-collections/ [http_www.mchange.com_projects_c3p0_index.html]: http://www.mchange.com/projects/c3p0/index.html [http_joda-time.sourceforge.net]: http://joda-time.sourceforge.net/
还没有评论,来说两句吧...