小编Pet*_*erg的帖子

Liquibase锁 - 原因?

我在针对Oracle服务器运行大量liquibase脚本时得到了这个.有些电脑是我.

Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Liquibase Update Failed: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
SEVERE 2013-03-20 16:59:liquibase: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by SomeComputer (192.168.15.X) since 2013-03-20 13:39
        at liquibase.lockservice.LockService.waitForLock(LockService.java:81) …
Run Code Online (Sandbox Code Playgroud)

database oracle liquibase

227
推荐指数
5
解决办法
13万
查看次数

如何在JUnit 4中运行属于某个类别的所有测试

JUnit 4.8包含一个名为"Categories"的新功能,允许您将某些类型的测试组合在一起.这非常有用,例如,为慢速和快速测试分别进行测试.我知道JUnit 4.8发行说明中提到的内容,但是想知道我如何实际运行所有使用某些类别注释的测试.

JUnit 4.8发行说明显示了一个示例套件定义,其中SuiteClasses注释选择要运行的特定类别的测试,如下所示:

@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public class SlowTestSuite {
  // Will run A.b and B.c, but not A.a
}
Run Code Online (Sandbox Code Playgroud)

有谁知道如何在SlowTests类别中运行所有测试?您似乎必须拥有SuiteClasses注释...

java junit unit-testing junit4

71
推荐指数
3
解决办法
3万
查看次数

Android Studio 2.2中的Espresso测试录制功能

在Android Studio 2.2中应该有一个测试录音功能?我在哪里找到它以及如何使用它?

android automated-tests android-espresso android-studio-2.2 android-espresso-recorder

30
推荐指数
3
解决办法
8810
查看次数

无法使用谷歌条码扫描仪

我从https://github.com/googlesamples/android-vision尝试了谷歌条码阅读器

此示例不起作用.当我选择屏幕时,它总是会检测到

"没有检测到条形码"

调试原因:

private boolean onTap(float rawX, float rawY) {

    //TODO: use the tap position to select the barcode.
    BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic();
    Barcode barcode = null;
    if (graphic != null) {
        barcode = graphic.getBarcode();
        if (barcode != null) {
            Intent data = new Intent();
            data.putExtra(BarcodeObject, barcode);
            setResult(CommonStatusCodes.SUCCESS, data);
            finish();
        }
        else {
            Log.d(TAG, "barcode data is null");
        }
    }
    else {
        Log.d(TAG,"no barcode detected");
    }
    return barcode != null;
}
Run Code Online (Sandbox Code Playgroud)

graphic 变量总是如此 Null

看图像:

Android工作室上的图像

有谁遇到过这个问题?你能告诉我怎么解决吗?非常感谢!

android android-vision

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

JPA中的事务使用多个线程

我的目标是使用单元测试在我的应用程序中激发一个乐观的锁定异常.我已经理解了如何在理论上做到这一点.但我在实践中的问题是如何在两个线程之间维护一个事务?

所以,这就是我到目前为止所做的:

我正在使用JUnit测试:

@RunWith(SpringJUnit4ClassRunner.class)
Run Code Online (Sandbox Code Playgroud)

使用EntityManager org.springframework.orm.jpa.JpaTransactionManager

每个方法的定义 @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)

然后开始一个交易entityManager.getTransaction().begin();并结束entityManager.getTransaction().rollback());

这在单线程测试中运行良好,保存,更新等.

要创建多个线程,我使用Springs TaskExecutor(类似于这里所描述的: 使用TaskExecutor示例的任何好的Spring线程?)

但是我需要做些什么来维护两个线程之间的事务呢?我尝试过使用@Transactional注释run() - 方法,但这不起作用.

java spring jpa java-ee

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

使用hibernate @NamedNativeQuery返回数值

我有这个问题:

"...如果查询只返回一个数字(即查询类似'select count(id)where ... ..)我遇到了这个错误

org.hibernate.cfg.NotYetImplementedException:尚不支持纯本机标量查询 "

有关详细信息,请参阅:http://atechnicaljourney.wordpress.com/2012/09/30/hibernate-pure-native-scalar-queries-are-not-yet-supported/

我不想有一个包装类,特别是没有一些额外的表.这样做的正确方法是什么?

hibernate jpa

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