diff --git a/hibernate-core/src/test/java/org/hibernate/test/tm/TransactionTimeoutTest.java b/hibernate-core/src/test/java/org/hibernate/test/tm/TransactionTimeoutTest.java index 69448207fc..26fb4a7dd3 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/tm/TransactionTimeoutTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/tm/TransactionTimeoutTest.java @@ -79,7 +79,7 @@ public class TransactionTimeoutTest extends BaseCoreFunctionalTestCase { public void testTransactionTimeoutSuccess() { Session session = openSession(); Transaction transaction = session.getTransaction(); - transaction.setTimeout( 2 ); + transaction.setTimeout( 5 ); transaction.begin(); session.persist( new Person( "Lukasz", "Antoniak" ) ); transaction.commit(); diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/JarVisitorTest.java b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/JarVisitorTest.java index d0ae475032..80c8e8a441 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/JarVisitorTest.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/JarVisitorTest.java @@ -226,6 +226,8 @@ public class JarVisitorTest extends PackagingTestCase { @Test @TestForIssue(jiraKey = "HHH-6806") public void testJarVisitorFactory() throws Exception{ + + addPackageToClasspath( buildExplodedPar(), buildDefaultPar() ); //setting URL to accept vfs based protocol URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() { diff --git a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/PackagingTestCase.java b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/PackagingTestCase.java index 77926e7892..12a82dcd76 100644 --- a/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/PackagingTestCase.java +++ b/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/packaging/PackagingTestCase.java @@ -84,8 +84,15 @@ public abstract class PackagingTestCase extends BaseCoreFunctionalTestCase { URL myUrl = originalClassLoader.getResource( PackagingTestCase.class.getName().replace( '.', '/' ) + ".class" ); - // this is assuming that there is a target directory - int index = myUrl.getFile().lastIndexOf( "target" ); + int index; + if (myUrl.getFile().contains( "target" )) { + // assume there's normally a /target + index = myUrl.getFile().lastIndexOf( "target" ); + } else { + // if running in some IDEs, may be in /bin instead + index = myUrl.getFile().lastIndexOf( "bin" ); + } + if ( index == -1 ) { fail( "Unable to setup packaging test" ); }