HHH-7569 Correct multiple failures/issues in

hibernate-core-master-matrix CI job
This commit is contained in:
brmeyer 2012-09-06 23:02:43 -04:00
parent 86deac49f7
commit f63b0c5f69
3 changed files with 12 additions and 3 deletions

View File

@ -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();

View File

@ -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() {

View File

@ -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" );
}