- 浏览: 12212 次
最新评论
文章列表
powermock 常遇到的问题之一,
如果你需要mock一个静态方法,可能你会发现抛出如下异常
org.mockito.exceptions.misusing.MissingMethodInvocationException:
when() requires an argument which has to be 'a method call on a mock'.
For example:
when(mock.getArticles()).thenReturn(articles);
Also, this error might show up because: ...
D:\tools\HBuilder5.5\workplaces\gulp-demo>gulp jshint
module.js:471
throw err;
^
Error: Cannot find module 'jshint/src/cli'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at ...
刚出来的eclipse oxgen 练练手,在使用eclipse创建maven项目的时候,有时候会出现这个问题
web.xml is missing and <failOnMissingWebXml> is set to true
百度了一下原来是resoures/webapp 没有web.xml文件,这时候可以在resoures/webapp 新建一个WEB-IN ...
异常情况:
org.mocktio.internal.createion.instance.InstiatorProvider.getInstantiator(Long/mockito/mock/MockCreationSettings;)Lorg/mockito.internal/creation/instance/Instantiator
这种情况是mocktio jar 和powermock jar包冲突 ,所以建议把mocktio pom去掉
<dependency>
<grouId>org.mockito</grouId> ...
form表单文件上传后台处理
- 博客分类:
- java
fileUpload接收到form提交请求,DefaultMultipartHttpServletRequest类封装了form提交的所有信息,包括文件上传信息
@RequestMapping(name="/fileUpload",method=RequestMethod.POST)
public String upload(DefaultMultipartHttpServletRequest request,HttpServletResponse response){
try {
MultipartFile multipartFiles = requ ...
当前引用版本:poi 3.10.1版本
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.List;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.Workb ...