private void travelDir(String filepath) {
String threadName = Thread.currentThread().toString();
logger.info("TargetDir:" + threadName + "==>" + filepath);
File dir = new File(filepath);
logger.info("dir.exists():" + threadName + "==>" + dir.exists()); if (dir.exists()) {
logger.info("dir.isDirectory():" + threadName + "==>"
+ dir.isDirectory());
File[] files = dir.listFiles();
for (File file : files) {
logger.info("file.getAbsolutePath():" + threadName + "==>"
+ file.getAbsolutePath());
}
}
}
public class CalcutateTest {
@Test
public void testAdd() {
Calcutate cal = new Calcutate();
Class<Calcutate> c = Calcutate.class;// 获得class类 try {
Method method = c.getDeclaredMethod("add", new Class[] { int.class,
int.class });// 获得method.注意,这里不能使用getMethod方法,因为这个方法只能获取public修饰的方法..
method.setAccessible(true);// 这个设置为true.可以无视java的封装..不设置这个也无法获取这个Method
Object result = method.invoke(cal, new Object[] { 2, 10 });
Assert.assertEquals("Must equals.",12, result);// 这里自动拆箱..
} catch (Exception e) {
e.printStackTrace();
} }
}

Code digest的更多相关文章

  1. nginx HttpLuaModule

    http://wiki.nginx.org/HttpLuaModule#Directives Name ngx_lua - Embed the power of Lua into Nginx This ...

  2. ruby md5 sha1 base64加密

    #md5加密 require 'md5' puts MD5.hexdigest('admin') #sha1加密 require 'digest/sha1' puts Digest::SHA1.hex ...

  3. IPFS - 可快速索引的版本化的点对点文件系统(草稿3)

    摘要 星际文件系统是一种点对点的分布式文件系统, 旨在连接所有有相同的文件系统的计算机设备.在某些方面, IPFS类似于web, 但web 是中心化的,而IPFS是一个单一的Bittorrent 群集 ...

  4. Tomcat的安全性

    Web应用程序的一些内容是受限的,只有授权的用户在提供了正确的用户名和密码后才能查看他们,servlet技术支持通过配置部署 描述器(web.xml)来对这些内容进行访问控制,那么web容器是怎么样支 ...

  5. Nginx+lua+openresty精简系列

    1. CentOS系统安装openresty 你可以在你的 CentOS 系统中添加 openresty 仓库,这样就可以便于未来安装或更新我们的软件包(通过 yum update 命令).运行下面的 ...

  6. Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结

    Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...

  7. 【java】之 apache commons-codec 与Apache Digest demo实例,支持md5 sha1 base64 hmac urlencode

    使用commons-codec 进行加密的一些操作 package com.jiepu.ApacheDigest; import java.io.FileInputStream; import org ...

  8. [转载]iOS Provisioning Profile(Certificate)与Code Signing详解

    原文:http://blog.csdn.net/phunxm/article/details/42685597 引言 关于开发证书配置(Certificates & Identifiers & ...

  9. iOS Provisioning Profile(Certificate)与Code Signing详解

    引言 关于开发证书配置(Certificates & Identifiers & Provisioning Profiles),相信做 iOS 开发的同学没少被折腾.对于一个 iOS ...

随机推荐

  1. sdut 6-2 多态性与虚函数

    6-2 多态性与虚函数 nid=24#time" title="C.C++.go.haskell.lua.pascal Time Limit1000ms Memory Limit ...

  2. bestcoder Round#52 1001(最短路+状压dp)

    求从1点出发,走遍所有的点,然后回到1点的最小代价. 每个点可以走若干遍. 如果每个点只能走一遍,那么设dp[i][s]为走完s状态个点(s是状态压缩),现在位于i的最小花费. 然后枚举从哪个点回到原 ...

  3. 网络协议——IP

    IPv4地址 不论什么网络设备能够经过一个网络接口卡(NIC)接入网,假定该设备要能够访问的其它设备,然后该卡必须有一个唯一的地址.候接入多个网络,相应地该设备就有多个地址.假设这个设备是主机的话.一 ...

  4. NDK/JNI学习--进口hello-jniproject

    上一篇文章,简单的设置NDK开发环境,本文通过导入C:\android-ndk-r9d\samples\hello-jni(NDK自带example)来疏通真个环境. 打开Eclipse IDE.指定 ...

  5. 足球和oracle列(4):巴西惨败于德国,认为,差额RAC拓扑控制!

    足球与oracle系列(4):从巴西慘败于德国,想到,差异的RAC拓扑对照! 前期回想: 本来想说今晚,回头一想,应该是今早第二场半决赛就要开战了!先来回味一下之前的比赛,本届8支小组赛第一名已经所有 ...

  6. Parallel Python——一个简单的分布式计算系统

    如何建立一个高速的分布式计算平台?Parallel python此目的. Parallel Python(http://www.parallelpython.com/content/view/15/3 ...

  7. hdu 4557 非诚勿扰 vector的应用 原来vector 可以删除指定位置元素 不过消耗大

    非诚勿扰 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submi ...

  8. 获取listboxitem在ListBox中的index并转换成abcd

    原文 获取listboxitem在ListBox中的index并转换成abcd 截图如下: 1.实现Converter  获取到listbox,并得到listitem在listbox中的index p ...

  9. 产品经理(五岁以下儿童)myVegas Slots排名上升的秘密

    myVEGAS Slots于AppStore上排名在今年也就是2月份时候飙升,那么什么情况导致这个现象的呢,我们试图通过App Annie的分析给出答案. 上面是myVegas的排名情况,我们能够看到 ...

  10. Ubuntu 13.04/12.10安装Oracle 11gR2图文教程(转)

    Ubuntu 13.04/12.10安装Oracle 11gR2图文教程 原文标题:How to Install Oracle 11G R2 Enterprise Edition Database U ...