[hibernate-commits] Hibernate SVN: r18785 - in annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations: entity and 1 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Thu Feb 11 13:43:21 EST 2010
Author: stliu
Date: 2010-02-11 13:43:21 -0500 (Thu, 11 Feb 2010)
New Revision: 18785
Removed:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
Log:
JBPAPP-3379 remove the fix I did, it does not work on hudson
Deleted: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java 2010-02-11 17:50:02 UTC (rev 18784)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java 2010-02-11 18:43:21 UTC (rev 18785)
@@ -1,118 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-/**
- *
- */
-package org.hibernate.test.annotations;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import org.hibernate.util.ConfigHelper;
-
-/**
- * This util class is for setting some system-level properties It is used before
- * Environment be loaded into jvm.
- *
- * @author Strong Liu <stliu at redhat.com>
- */
-public class SystemLevelPropertyUtil {
- /**
- * find is the property <tt>prop</tt> is in System properties or in
- * hibernate.properties.
- *
- *
- * @param prop
- * @return
- */
- public static boolean isPropertyExist( Object prop ) {
- if ( System.getProperties().containsKey( prop ) ) {
- return true;
- }
- return getHibernateProperties().containsKey( prop );
- }
-
- /**
- * get the property <tt>prop</tt> value
- * @param prop
- * @return
- */
- public static Object getSystemLevelProperty( Object prop ) {
- if ( !isPropertyExist( prop ) ) {
- return null;
- }
- if ( System.getProperties().containsKey( prop ) ) {
- return System.getProperties().get( prop );
- }
- if ( getHibernateProperties().containsKey( prop ) ) {
- return getHibernateProperties().get( prop );
- }
- return null;
- }
-
- private static Properties getHibernateProperties() {
- Properties properties = new Properties();
- try {
- properties.load( findAsResource( "hibernate.properties" )
- .openStream() );
- } catch (IOException e) {
-
- }
- return properties;
- }
-
- /**
- * Try to locate a local URL representing the incoming path. This method
- * <b>only</b> attempts to locate this URL as a java system resource.
- *
- * @param path
- * The path representing the config location.
- * @return An appropriate URL or null.
- */
- private static final URL findAsResource( final String path ) {
- URL url = null;
-
- // First, try to locate this resource through the current
- // context classloader.
- ClassLoader contextClassLoader = Thread.currentThread()
- .getContextClassLoader();
- if ( contextClassLoader != null ) {
- url = contextClassLoader.getResource( path );
- }
- if ( url != null )
- return url;
-
- // Next, try to locate this resource through this class's classloader
- url = ConfigHelper.class.getClassLoader().getResource( path );
- if ( url != null )
- return url;
-
- // Next, try to locate this resource through the system classloader
- url = ClassLoader.getSystemClassLoader().getResource( path );
-
- // Anywhere else we should look?
- return url;
- }
-}
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java 2010-02-11 17:50:02 UTC (rev 18784)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java 2010-02-11 18:43:21 UTC (rev 18785)
@@ -6,7 +6,6 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.DB2Dialect;
-import org.hibernate.test.annotations.SystemLevelPropertyUtil;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.util.ConfigHelper;
@@ -18,15 +17,6 @@
super( x );
}
- //https://jira.jboss.org/jira/browse/JBPAPP-3379
- @Override
- protected void setUp() throws Exception {
- String dialect = (String)SystemLevelPropertyUtil.getSystemLevelProperty( "hibernate.dialect" );
- if(dialect.equals( "org.hibernate.dialect.DB2Dialect" )){
- System.setProperty( "hibernate.jdbc.use_streams_for_binary" , "false" );
- }
- super.setUp();
- }
public void testSerializableObject() throws Exception {
Session s;
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-02-11 17:50:02 UTC (rev 18784)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-02-11 18:43:21 UTC (rev 18785)
@@ -3,24 +3,12 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.test.annotations.SystemLevelPropertyUtil;
import org.hibernate.test.annotations.TestCase;
/**
* @author Emmanuel Bernard
*/
public class LobTest extends TestCase {
-
-
- //https://jira.jboss.org/jira/browse/JBPAPP-3379
- @Override
- protected void setUp() throws Exception {
- String dialect = (String)SystemLevelPropertyUtil.getSystemLevelProperty( "hibernate.dialect" );
- if(dialect.equals( "org.hibernate.dialect.DB2Dialect" )){
- System.setProperty( "hibernate.jdbc.use_streams_for_binary" , "false" );
- }
- super.setUp();
- }
public void testSerializableToBlob() throws Exception {
Book book = new Book();
More information about the hibernate-commits
mailing list