小编cre*_*ijn的帖子

好的java库比较xml文件进行单元测试?

我正在寻找一个好的java库来比较单元测试中的xml文件.Currenly我们使用简单的字符串比较,但这需要以相同的方式打印xml文件(当前在1行).

我在网上找到了以下内容:http://xmlunit.sourceforge.net/.但我看起来很旧(2009年9月的最新版本).有人知道一个更新的图书馆还是这个仍然是使用的?

谢谢

java xml unit-testing

5
推荐指数
1
解决办法
3639
查看次数

如何将测试类添加到导入的ear文件并使用arquillian运行服务器端?

我想用arquillian创建集成测试.作为部署,我想使用也用于在生产中部署的耳朵.

所以这是我的部署:

@Deployment(testable = true)
public static Archive<?> createDeployment() {
    return ShrinkWrap
            .create(ZipImporter.class, "test.ear")
            .importFrom(new File("simple-webservice-ear-1.0.0-SNAPSHOT.ear"))
            .as(EnterpriseArchive.class);
}
Run Code Online (Sandbox Code Playgroud)

当我运行我的测试类时,我得到一个java.lang.ClassNotFoundException,因为找不到测试类.我知道我可以在部署上设置testable = false但是持久性扩展不起作用:请参阅arquillian持久性扩展不起作用.

我怎么解决这个问题?有没有办法将我的测试类添加到部署中?或者我应该以另一种方式创建我的部署?

jboss-arquillian

5
推荐指数
0
解决办法
4812
查看次数

如何使用angular.js在chrome打包应用中进行导航?

我正在尝试使用Chrome打包的应用程序,我的第一个屏幕有一个项目列表,当我点击一个项目时,应该可以看到详细信息页面.

我只是一个普通的网络应用程序:

<a href="#/detail/{{item.name}}">{{item.name}}</a>
Run Code Online (Sandbox Code Playgroud)

但在打包的应用程序中,我收到以下错误:

无法打开同一窗口链接到"unsafe:chrome-extension://fsdjiojkljkljdfijkjkijkjkjijikf/index.html#/detail/blablabla"; 尝试target ="_ blank".

那么我如何在Chrome打包的应用程序中进行某种导航?

谢谢

navigation google-chrome angularjs google-chrome-app

5
推荐指数
1
解决办法
2573
查看次数

如何在jpa中创建两列左连接?

有没有办法在jpa中使用左连接在两列上进行查询,如下面的普通sql?

select
    combinedin1_.SHIPMENTNUMBER ,
    shipmentin3_.INBOUNDDELIVERYITEM ,
    combinedin1_.PURCHASEORDERNUMBER,
    combinedin1_.PURCHASEORDERITEMNUMBER ,
    purchaseor2_.FACTORY 
from
    REPORT.REPORTLINK this_
left outer join
    REPORT.COMBINEDINFO combinedin1_
        on this_.COMBINEDINFOID=combinedin1_.COMBINEDINFOID
left outer join
    REPORT.PURCHASEORDERINFO purchaseor2_
        on this_.PURCHASEORDERINFOID=purchaseor2_.PURCHASEORDERINFOID and purchaseor2_.DELETED='N'
left outer join
    REPORT.SHIPMENTINFO shipmentin3_
        on this_.SHIPMENTINFOID=shipmentin3_.SHIPMENTINFOID and shipmentin3_.DELETED='N'
Run Code Online (Sandbox Code Playgroud)

更具体地说,这是用纯SQL编写的左连接:

left outer join
    REPORT.SHIPMENTINFO shipmentin3_
        on this_.SHIPMENTINFOID=shipmentin3_.SHIPMENTINFOID and shipmentin3_.DELETED='N'
Run Code Online (Sandbox Code Playgroud)

这是我在JPA中的reportLink实体:

@Entity
@Table(name = "REPORTLINK")
public class ReportLinkFull implements Serializable {

private static final long serialVersionUID = -2330676941570524461L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "REPORTLINKID")
private Integer id;

@ManyToOne
@JoinColumn(name = "SALESORDERINFOID") …
Run Code Online (Sandbox Code Playgroud)

java hibernate jpa

4
推荐指数
1
解决办法
4372
查看次数

是否可以在 sqlite 中使用“索引”作为列名?

是否可以index在sqlite中用作列名?

当我尝试执行此查询时,它是使用 hibernate/jpa 生成的:

select
    metadatait0_.id as id25_,
    metadatait0_.guid as guid25_,
    metadatait0_.index as index25_,
    metadatait0_.library_section_id as library7_25_,
    metadatait0_.metadata_type as metadata4_25_,
    metadatait0_.parent_id as parent5_25_,
    metadatait0_.title as title25_ 
from
    metadata_items metadatait0_
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
...
Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "index": syntax error)
Run Code Online (Sandbox Code Playgroud)

sqlite hibernate

2
推荐指数
1
解决办法
1682
查看次数

如何将文件移动到错误目录并使用apache camel回滚其他移动?

首先:我是一个骆驼新手:-)

我想将文件从输入目录传输到输出目录并做一些java的东西.如果出现问题,我想将文件移动到错误目录并回滚以移动到输出目录.

这是我在java dsl中的路线:

onException(Exception.class).handled(true).to("file://C:/temp/camel/error");
from("file://C:/temp/camel/in?delete=true").to("file://C:/temp/camel/out").bean(ServiceBean.class, "callWebservice");
Run Code Online (Sandbox Code Playgroud)

如果在ServiceBean中引发错误,则该文件将复制到错误文件夹,但它也会保留在out目录中.

回滚的最佳方法是什么?

谢谢

apache-camel

2
推荐指数
1
解决办法
6169
查看次数

如何将 Intellij 连接到远程 Wildfly 服务器

我在远程服务器上安装了干净的 wildfly 8.1。请注意,这个远程服务器是一个用 vagrant 创建的虚拟服务器。

现在我想使用远程 JBoss 服务器连接 IntelliJ。

首先我创建了一个虚拟用户,用户名/密码为:jboss/jboss

[root@localhost bin]# ./add-user.sh 

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : jboss
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values …
Run Code Online (Sandbox Code Playgroud)

intellij-idea wildfly

2
推荐指数
1
解决办法
6028
查看次数