运行IntelliJ IDEA(10.5.4).这是一个Seam应用程序.
在项目结构 - >工件 - >输出目录中,默认值为
...../proj/proj-web/target/classes.
Run Code Online (Sandbox Code Playgroud)
我一直在改变它......./proj/src/main/webapp
,这意味着Web服务器从我正在编辑的相同目录中读取,我的更改可以立即查看.
我的麻烦是IntelliJ经常恢复到默认状态并且它变得很烦人.有谁知道怎么做这个棒.在早期版本中,这"不会发生".
紧跟这个例子,我正在上传一个小文件并尝试存储到postgresql bytea列中.
这是错误(前两个输出是在尝试INSERT之前输出bean属性的日志语句:
SAGE 1 - action.registration.LetterTemplateHome - 内容类型:text/xml
SAGE 1 - action.registration.LetterTemplateHome - letterTemplateText:[B @ 48c7aaef
SAGE 1 - action.registration.LetterTemplateHome - 内容为字符串:xml version ="1.0"encoding ="UTF-8"standalone ="yes".... etc
SAGE 1 - org.hibernate.util.JDBCExceptionReporter - 批量输入0插入letter_template(content_type,file_name_template,fileSize,letter_template_name,letter_template_text,letter_template_id)值('text/xml','letterDate.xml','0',' yu','37078','202')已中止.调用getNextException以查看原因.
SAGE 1 - org.hibernate.util.JDBCExceptionReporter - 错误:列"letter_template_text"的类型为bytea但表达式的类型为bigint提示:您需要重写或转换表达式.位置:162
这里是如何在bean中定义字段:
private byte[] letterTemplateText;
@Lob
@Column(name = "letter_template_text")
@Basic(fetch = FetchType.LAZY)
public byte[] getLetterTemplateText() {
return this.letterTemplateText;
}
public void setLetterTemplateText(byte[] letterTemplateText) {
this.letterTemplateText = letterTemplateText;
}
Run Code Online (Sandbox Code Playgroud) 我是Seam的新手,我一直在寻找互联网和Seam in Action的书,但我正在寻找在今天的缝合页面中插入今天日期的方法(myReport.xhtml或myPdfReport.xhtml)
我是testng的新手.我想从命令行运行它时看到Expected和Actual消息.当我从IDE运行它时,它可以工作:
java.lang.AssertionError:预期:3实际:2
当我从命令行运行它时使用:
java org.testng.TestNG -testclass SimpleTest
Run Code Online (Sandbox Code Playgroud)
我明白了:
命令行套件总测试运行:2,失败:2,跳过:0
(没有消息)当我将测试包装在try ... catch块中时,它看起来像:
try{
int x = 3;
Assert.assertEquals(2,x);
} catch (AssertionError ae){
System.out.println(ae.getMessage());
}
Run Code Online (Sandbox Code Playgroud)
然后我得到了我的信息.
expected:<3> but was:<2>
Run Code Online (Sandbox Code Playgroud)
这似乎不是编写测试代码的简洁方法.你会怎么做?