Hibernate SVN: r19741 - in core/branches/Branch_3_5: annotations/src/test/java/org/hibernate/test/annotations/lob and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-15 11:53:37 -0400 (Tue, 15 Jun 2010)
New Revision: 19741
Added:
core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/DialectChecks.java
core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java
Modified:
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/id/sequences/IdTest.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java
core/branches/Branch_3_5/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java
Log:
HHH-5204 backported @RequiresDialectFeature to 3.5 branch
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/id/sequences/IdTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/id/sequences/IdTest.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/id/sequences/IdTest.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -1,10 +1,34 @@
-//$Id$
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.id.sequences;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
+import org.hibernate.junit.DialectChecks;
+import org.hibernate.junit.RequiresDialectFeature;
import org.hibernate.mapping.Column;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.test.annotations.id.sequences.entities.Ball;
@@ -29,27 +53,28 @@
* @author Emmanuel Bernard
*/
@SuppressWarnings("unchecked")
+(a)RequiresDialectFeature(DialectChecks.SupportsSequences.class)
public class IdTest extends TestCase {
public void testGenericGenerator() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
SoundSystem system = new SoundSystem();
- system.setBrand("Genelec");
- system.setModel("T234");
+ system.setBrand( "Genelec" );
+ system.setModel( "T234" );
Furniture fur = new Furniture();
- s.persist(system);
- s.persist(fur);
+ s.persist( system );
+ s.persist( fur );
tx.commit();
s.close();
s = openSession();
tx = s.beginTransaction();
- system = (SoundSystem) s.get(SoundSystem.class, system.getId());
- fur = (Furniture) s.get(Furniture.class, fur.getId());
- assertNotNull(system);
- assertNotNull(fur);
- s.delete(system);
- s.delete(fur);
+ system = ( SoundSystem ) s.get( SoundSystem.class, system.getId() );
+ fur = ( Furniture ) s.get( Furniture.class, fur.getId() );
+ assertNotNull( system );
+ assertNotNull( fur );
+ s.delete( system );
+ s.delete( fur );
tx.commit();
s.close();
@@ -59,13 +84,14 @@
* Ensures that GenericGenerator annotations wrapped inside a
* GenericGenerators holder are bound correctly
*/
+
public void testGenericGenerators() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
Monkey monkey = new Monkey();
- s.persist(monkey);
+ s.persist( monkey );
s.flush();
- assertNotNull(monkey.getId());
+ assertNotNull( monkey.getId() );
tx.rollback();
s.close();
}
@@ -77,21 +103,23 @@
Ball b = new Ball();
Dog d = new Dog();
Computer c = new Computer();
- s.persist(b);
- s.persist(d);
- s.persist(c);
+ s.persist( b );
+ s.persist( d );
+ s.persist( c );
tx.commit();
s.close();
- assertEquals("table id not generated", new Integer(1), b.getId());
- assertEquals("generator should not be shared", new Integer(1), d
- .getId());
- assertEquals("default value should work", new Long(1), c.getId());
+ assertEquals( "table id not generated", new Integer( 1 ), b.getId() );
+ assertEquals(
+ "generator should not be shared", new Integer( 1 ), d
+ .getId()
+ );
+ assertEquals( "default value should work", new Long( 1 ), c.getId() );
s = openSession();
tx = s.beginTransaction();
- s.delete(s.get(Ball.class, new Integer(1)));
- s.delete(s.get(Dog.class, new Integer(1)));
- s.delete(s.get(Computer.class, new Long(1)));
+ s.delete( s.get( Ball.class, new Integer( 1 ) ) );
+ s.delete( s.get( Dog.class, new Integer( 1 ) ) );
+ s.delete( s.get( Computer.class, new Long( 1 ) ) );
tx.commit();
s.close();
}
@@ -100,14 +128,14 @@
Session s = openSession();
Transaction tx = s.beginTransaction();
Shoe b = new Shoe();
- s.persist(b);
+ s.persist( b );
tx.commit();
s.close();
- assertNotNull(b.getId());
+ assertNotNull( b.getId() );
s = openSession();
tx = s.beginTransaction();
- s.delete(s.get(Shoe.class, b.getId()));
+ s.delete( s.get( Shoe.class, b.getId() ) );
tx.commit();
s.close();
}
@@ -116,14 +144,14 @@
Session s = openSession();
Transaction tx = s.beginTransaction();
Store b = new Store();
- s.persist(b);
+ s.persist( b );
tx.commit();
s.close();
- assertNotNull(b.getId());
+ assertNotNull( b.getId() );
s = openSession();
tx = s.beginTransaction();
- s.delete(s.get(Store.class, b.getId()));
+ s.delete( s.get( Store.class, b.getId() ) );
tx.commit();
s.close();
}
@@ -132,14 +160,14 @@
Session s = openSession();
Transaction tx = s.beginTransaction();
Department b = new Department();
- s.persist(b);
+ s.persist( b );
tx.commit();
s.close();
- assertNotNull(b.getId());
+ assertNotNull( b.getId() );
s = openSession();
tx = s.beginTransaction();
- s.delete(s.get(Department.class, b.getId()));
+ s.delete( s.get( Department.class, b.getId() ) );
tx.commit();
s.close();
}
@@ -150,16 +178,16 @@
s = openSession();
tx = s.beginTransaction();
Home h = new Home();
- s.persist(h);
+ s.persist( h );
tx.commit();
s.close();
- assertNotNull(h.getId());
+ assertNotNull( h.getId() );
s = openSession();
tx = s.beginTransaction();
- Home reloadedHome = (Home) s.get(Home.class, h.getId());
- assertEquals(h.getId(), reloadedHome.getId());
- s.delete(reloadedHome);
+ Home reloadedHome = ( Home ) s.get( Home.class, h.getId() );
+ assertEquals( h.getId(), reloadedHome.getId() );
+ s.delete( reloadedHome );
tx.commit();
s.close();
}
@@ -170,16 +198,16 @@
s = openSession();
tx = s.beginTransaction();
Home h = new Home();
- s.persist(h);
+ s.persist( h );
tx.commit();
s.close();
- assertNotNull(h.getId());
+ assertNotNull( h.getId() );
s = openSession();
tx = s.beginTransaction();
- Home reloadedHome = (Home) s.get(Home.class, h.getId());
- assertEquals(h.getId(), reloadedHome.getId());
- s.delete(reloadedHome);
+ Home reloadedHome = ( Home ) s.get( Home.class, h.getId() );
+ assertEquals( h.getId(), reloadedHome.getId() );
+ s.delete( reloadedHome );
tx.commit();
s.close();
}
@@ -190,13 +218,13 @@
s = openSession();
tx = s.beginTransaction();
FirTree chrismasTree = new FirTree();
- s.persist(chrismasTree);
+ s.persist( chrismasTree );
tx.commit();
s.clear();
tx = s.beginTransaction();
- chrismasTree = (FirTree) s.get(FirTree.class, chrismasTree.getId());
- assertNotNull(chrismasTree);
- s.delete(chrismasTree);
+ chrismasTree = ( FirTree ) s.get( FirTree.class, chrismasTree.getId() );
+ assertNotNull( chrismasTree );
+ s.delete( chrismasTree );
tx.commit();
s.close();
}
@@ -206,55 +234,58 @@
Transaction tx;
s = openSession();
tx = s.beginTransaction();
- Footballer fb = new Footballer("David", "Beckam", "Arsenal");
- GoalKeeper keeper = new GoalKeeper("Fabien", "Bartez", "OM");
- s.persist(fb);
- s.persist(keeper);
+ Footballer fb = new Footballer( "David", "Beckam", "Arsenal" );
+ GoalKeeper keeper = new GoalKeeper( "Fabien", "Bartez", "OM" );
+ s.persist( fb );
+ s.persist( keeper );
tx.commit();
s.clear();
// lookup by id
tx = s.beginTransaction();
- FootballerPk fpk = new FootballerPk("David", "Beckam");
- fb = (Footballer) s.get(Footballer.class, fpk);
- FootballerPk fpk2 = new FootballerPk("Fabien", "Bartez");
- keeper = (GoalKeeper) s.get(GoalKeeper.class, fpk2);
- assertNotNull(fb);
- assertNotNull(keeper);
- assertEquals("Beckam", fb.getLastname());
- assertEquals("Arsenal", fb.getClub());
- assertEquals(1, s.createQuery(
- "from Footballer f where f.firstname = 'David'").list().size());
+ FootballerPk fpk = new FootballerPk( "David", "Beckam" );
+ fb = ( Footballer ) s.get( Footballer.class, fpk );
+ FootballerPk fpk2 = new FootballerPk( "Fabien", "Bartez" );
+ keeper = ( GoalKeeper ) s.get( GoalKeeper.class, fpk2 );
+ assertNotNull( fb );
+ assertNotNull( keeper );
+ assertEquals( "Beckam", fb.getLastname() );
+ assertEquals( "Arsenal", fb.getClub() );
+ assertEquals(
+ 1, s.createQuery(
+ "from Footballer f where f.firstname = 'David'"
+ ).list().size()
+ );
tx.commit();
// reattach by merge
tx = s.beginTransaction();
- fb.setClub("Bimbo FC");
- s.merge(fb);
+ fb.setClub( "Bimbo FC" );
+ s.merge( fb );
tx.commit();
// reattach by saveOrUpdate
tx = s.beginTransaction();
- fb.setClub("Bimbo FC SA");
- s.saveOrUpdate(fb);
+ fb.setClub( "Bimbo FC SA" );
+ s.saveOrUpdate( fb );
tx.commit();
// clean up
s.clear();
tx = s.beginTransaction();
- fpk = new FootballerPk("David", "Beckam");
- fb = (Footballer) s.get(Footballer.class, fpk);
- assertEquals("Bimbo FC SA", fb.getClub());
- s.delete(fb);
- s.delete(keeper);
+ fpk = new FootballerPk( "David", "Beckam" );
+ fb = ( Footballer ) s.get( Footballer.class, fpk );
+ assertEquals( "Bimbo FC SA", fb.getClub() );
+ s.delete( fb );
+ s.delete( keeper );
tx.commit();
s.close();
}
public void testColumnDefinition() {
- Column idCol = (Column) getCfg().getClassMapping(Ball.class.getName())
+ Column idCol = ( Column ) getCfg().getClassMapping( Ball.class.getName() )
.getIdentifierProperty().getValue().getColumnIterator().next();
- assertEquals("ball_id", idCol.getName());
+ assertEquals( "ball_id", idCol.getName() );
}
public void testLowAllocationSize() throws Exception {
@@ -264,42 +295,39 @@
tx = s.beginTransaction();
int size = 4;
BreakDance[] bds = new BreakDance[size];
- for (int i = 0; i < size; i++) {
+ for ( int i = 0; i < size; i++ ) {
bds[i] = new BreakDance();
- s.persist(bds[i]);
+ s.persist( bds[i] );
}
s.flush();
- for (int i = 0; i < size; i++) {
- assertEquals(i + 1, bds[i].id.intValue());
+ for ( int i = 0; i < size; i++ ) {
+ assertEquals( i + 1, bds[i].id.intValue() );
}
tx.rollback();
s.close();
}
-
-
-
- @Override
- protected boolean runForCurrentDialect() {
- return super.runForCurrentDialect() && getDialect().supportsSequences();
- }
/**
* @see org.hibernate.test.annotations.TestCase#getAnnotatedClasses()
*/
protected Class[] getAnnotatedClasses() {
- return new Class[] { Ball.class, Shoe.class, Store.class,
+ return new Class[] {
+ Ball.class, Shoe.class, Store.class,
Department.class, Dog.class, Computer.class, Home.class,
Phone.class, Tree.class, FirTree.class, Footballer.class,
SoundSystem.class, Furniture.class, GoalKeeper.class,
- BreakDance.class, Monkey.class};
+ BreakDance.class, Monkey.class
+ };
}
-
+
/**
* @see org.hibernate.test.annotations.TestCase#getAnnotatedPackages()
*/
protected String[] getAnnotatedPackages() {
- return new String[] { "org.hibernate.test.annotations",
- "org.hibernate.test.annotations.id" };
+ return new String[] {
+ "org.hibernate.test.annotations",
+ "org.hibernate.test.annotations.id"
+ };
}
@Override
@@ -311,5 +339,4 @@
protected void configure(Configuration cfg) {
cfg.setProperty( AnnotationConfiguration.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
}
-
}
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -1,14 +1,38 @@
-//$Id$
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.lob;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.dialect.Dialect;
+import org.hibernate.junit.DialectChecks;
+import org.hibernate.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
/**
* @author Emmanuel Bernard
*/
+(a)RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
public class LobTest extends TestCase {
public void testSerializableToBlob() throws Exception {
Book book = new Book();
@@ -118,11 +142,6 @@
super( x );
}
- @Override
- protected boolean runForCurrentDialect() {
- return super.runForCurrentDialect() && getDialect().supportsExpectedLobUsagePattern();
- }
-
protected Class[] getAnnotatedClasses() {
return new Class[] {
Book.class,
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -1,29 +1,54 @@
-//$
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.manytoone.referencedcolumnname;
import java.math.BigDecimal;
+import org.hibernate.Session;
+import org.hibernate.junit.DialectChecks;
+import org.hibernate.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
-import org.hibernate.Session;
/**
* @author Emmanuel Bernard
*/
public class ManyToOneReferencedColumnNameTest extends TestCase {
+ @RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
public void testReoverableExceptionInFkOrdering() throws Exception {
//SF should not blow up
Vendor v = new Vendor();
Item i = new Item();
ZItemCost ic = new ZItemCost();
- ic.setCost( new BigDecimal(2) );
+ ic.setCost( new BigDecimal( 2 ) );
ic.setItem( i );
ic.setVendor( v );
WarehouseItem wi = new WarehouseItem();
wi.setDefaultCost( ic );
wi.setItem( i );
wi.setVendor( v );
- wi.setQtyInStock( new BigDecimal(2) );
- Session s = openSession( );
+ wi.setQtyInStock( new BigDecimal( 2 ) );
+ Session s = openSession();
s.getTransaction().begin();
s.save( i );
s.save( v );
@@ -32,16 +57,8 @@
s.flush();
s.getTransaction().rollback();
s.close();
-
}
-
- @Override
- protected boolean runForCurrentDialect() {
- return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
- }
-
-
protected Class[] getAnnotatedClasses() {
return new Class[] {
Item.class,
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -1,7 +1,31 @@
-//$Id:HbmTest.java 9793 2006-04-26 02:20:18 -0400 (mer., 26 avr. 2006) epbernard $
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.xml.hbm;
import org.hibernate.Session;
+import org.hibernate.junit.DialectChecks;
+import org.hibernate.junit.RequiresDialectFeature;
import org.hibernate.test.annotations.TestCase;
/**
@@ -9,6 +33,7 @@
*/
public class HbmWithIdentityTest extends TestCase {
+ @RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
public void testManyToOneAndInterface() throws Exception {
Session s = openSession();
s.getTransaction().begin();
@@ -23,11 +48,6 @@
s.close();
}
- @Override
- protected boolean runForCurrentDialect() {
- return super.runForCurrentDialect() && getDialect().supportsIdentityColumns();
- }
-
protected Class[] getAnnotatedClasses() {
return new Class[] {
Sky.class,
Copied: core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/DialectChecks.java (from rev 19739, core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java)
===================================================================
--- core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/DialectChecks.java (rev 0)
+++ core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/DialectChecks.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -0,0 +1,58 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.junit;
+
+import org.hibernate.dialect.Dialect;
+
+/**
+ * Container class for different implementation of the {@code DialectCheck} interface.
+ *
+ * @author Hardy Ferentschik
+ */
+abstract public class DialectChecks {
+
+ abstract public boolean include(Dialect dialect);
+
+ public static class SupportsSequences extends DialectChecks {
+ public boolean include(Dialect dialect) {
+ return dialect.supportsSequences();
+ }
+ }
+
+ public static class SupportsExpectedLobUsagePattern extends DialectChecks {
+ public boolean include(Dialect dialect) {
+ return dialect.supportsExpectedLobUsagePattern();
+ }
+ }
+
+ public static class SupportsIdentityColumns extends DialectChecks {
+ public boolean include(Dialect dialect) {
+ return dialect.supportsIdentityColumns();
+ }
+ }
+
+
+}
+
+
Modified: core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java
===================================================================
--- core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -33,14 +33,15 @@
/**
* Annotation used to indicate that a test should be run only when run against the
* indicated dialects.
- *
+ *
* @author Hardy Ferentschik
*/
-(a)Target({ElementType.METHOD, ElementType.TYPE})
+@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiresDialect {
/**
* The dialects against which to run the test
+ *
* @return The dialects
*/
Class<? extends Dialect>[] value();
@@ -48,7 +49,22 @@
/**
* Used to indicate if the dialects should be matched strictly (classes equal) or
* non-strictly (instanceof).
+ *
* @return Should strict matching be used?
*/
boolean strictMatching() default false;
+
+ /**
+ * Comment describing the reason why the dialect is required.
+ *
+ * @return The comment
+ */
+ String comment() default "";
+
+ /**
+ * The key of a JIRA issue which relates this this restriction
+ *
+ * @return The jira issue key
+ */
+ String jiraKey() default "";
}
Copied: core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java (from rev 19739, core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialect.java)
===================================================================
--- core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java (rev 0)
+++ core/branches/Branch_3_5/testing/src/main/java/org/hibernate/junit/RequiresDialectFeature.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -0,0 +1,58 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. 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 Inc.
+ *
+ * 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.junit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate that a test should be run only when the current dialect supports the
+ * specified feature.
+ *
+ * @author Hardy Ferentschik
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface RequiresDialectFeature {
+ /**
+ * @return The name of the dialect feature.
+ */
+ Class<? extends DialectChecks> value();
+
+ /**
+ * Comment describing the reason why the feature is required.
+ *
+ * @return The comment
+ */
+ String comment() default "";
+
+ /**
+ * The key of a JIRA issue which relates this this feature requirement.
+ *
+ * @return The jira issue key
+ */
+ String jiraKey() default "";
+}
Modified: core/branches/Branch_3_5/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java
===================================================================
--- core/branches/Branch_3_5/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java 2010-06-15 14:53:17 UTC (rev 19740)
+++ core/branches/Branch_3_5/testing/src/main/java/org/hibernate/test/annotations/HibernateTestCase.java 2010-06-15 15:53:37 UTC (rev 19741)
@@ -1,4 +1,3 @@
-// $Id$
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
@@ -30,8 +29,6 @@
import java.lang.reflect.Modifier;
import java.sql.Connection;
import java.sql.SQLException;
-import java.util.HashSet;
-import java.util.Set;
import junit.framework.TestCase;
import org.slf4j.Logger;
@@ -40,8 +37,10 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.Dialect;
import org.hibernate.jdbc.Work;
+import org.hibernate.junit.DialectChecks;
import org.hibernate.junit.FailureExpected;
import org.hibernate.junit.RequiresDialect;
+import org.hibernate.junit.RequiresDialectFeature;
import org.hibernate.junit.SkipForDialect;
import org.hibernate.junit.SkipLog;
import org.hibernate.tool.hbm2ddl.SchemaExport;
@@ -60,23 +59,6 @@
protected static Configuration cfg;
private static Class<?> lastTestClass;
-
- /**
- * Flag indicating whether the test should be run or skipped.
- */
- private boolean runTest = true;
-
- /**
- * List of required dialect for the current {@code runMethod}. If the list is empty any dialect is allowed.
- * Otherwise the current dialect or a superclass of the current dialect must be in the list.
- */
- private final Set<Class<? extends Dialect>> requiredDialectList = new HashSet<Class<? extends Dialect>>();
-
- /**
- * List of dialects for which the current {@code runMethod} should be skipped.
- */
- private final Set<Class<? extends Dialect>> skipForDialectList = new HashSet<Class<? extends Dialect>>();
-
public HibernateTestCase() {
super();
}
@@ -172,7 +154,7 @@
}
}
- protected final Skip determineSkipByDialect(Dialect dialect, Method runMethod) {
+ protected final Skip determineSkipByDialect(Dialect dialect, Method runMethod) throws Exception {
// skips have precedence, so check them first
SkipForDialect skipForDialectAnn = locateAnnotation( SkipForDialect.class, runMethod );
if ( skipForDialectAnn != null ) {
@@ -195,18 +177,28 @@
if ( requiresDialectAnn != null ) {
for ( Class<? extends Dialect> dialectClass : requiresDialectAnn.value() ) {
if ( requiresDialectAnn.strictMatching() ) {
- if ( dialectClass.equals( dialect.getClass() ) ) {
+ if ( !dialectClass.equals( dialect.getClass() ) ) {
return buildSkip( dialect, null, null );
}
}
else {
- if ( dialectClass.isInstance( dialect ) ) {
- return buildSkip( dialect, null, null );
+ if ( !dialectClass.isInstance( dialect ) ) {
+ return buildSkip( dialect, requiresDialectAnn.comment(), requiresDialectAnn.jiraKey() );
}
}
}
}
+ // then check against a dialect feature
+ RequiresDialectFeature requiresDialectFeatureAnn = locateAnnotation( RequiresDialectFeature.class, runMethod );
+ if ( requiresDialectFeatureAnn != null ) {
+ Class<? extends DialectChecks> checkClass = requiresDialectFeatureAnn.value();
+ DialectChecks check = checkClass.newInstance();
+ boolean skip = check.include( dialect );
+ if ( skip ) {
+ return buildSkip( dialect, requiresDialectFeatureAnn.comment(), requiresDialectFeatureAnn.jiraKey() );
+ }
+ }
return null;
}
@@ -244,30 +236,6 @@
return this.getClass().getName() + "#" + this.getName();
}
- protected boolean runForCurrentDialect() {
- boolean runTestForCurrentDialect = true;
-
- // check whether the current dialect is assignableFrom from any of the specified required dialects.
- for ( Class<? extends Dialect> dialect : requiredDialectList ) {
- if ( dialect.isAssignableFrom( Dialect.getDialect().getClass() ) ) {
- runTestForCurrentDialect = true;
- break;
- }
- runTestForCurrentDialect = false;
- }
-
- // check whether the current dialect is assignableFrom from any of the specified skip for dialects.
- for ( Class<? extends Dialect> dialect : skipForDialectList ) {
- if ( dialect.isAssignableFrom( Dialect.getDialect().getClass() ) ) {
- runTestForCurrentDialect = false;
- break;
- }
- runTestForCurrentDialect = true;
- }
-
- return runTestForCurrentDialect;
- }
-
private Method findTestMethod() {
String fName = getName();
assertNotNull( fName );
@@ -289,7 +257,7 @@
protected abstract Class<?>[] getAnnotatedClasses();
protected String[] getMappings() {
- return new String[]{};
+ return new String[] { };
}
protected abstract void handleUnclosedResources();
13 years, 11 months
Hibernate SVN: r19740 - in core/trunk/entitymanager/src: test/java/org/hibernate/ejb/test/util and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-15 10:53:17 -0400 (Tue, 15 Jun 2010)
New Revision: 19740
Added:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
Log:
HHH-5094 applied some changes as on 3.5 branch
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-06-15 14:39:39 UTC (rev 19739)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-06-15 14:53:17 UTC (rev 19740)
@@ -5,7 +5,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Member;
-import java.lang.reflect.Modifier;
import java.lang.reflect.AccessibleObject;
import java.util.ArrayList;
import java.util.HashMap;
@@ -24,6 +23,7 @@
/**
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class PersistenceUtilHelper {
public static LoadState isLoadedWithoutReference(Object proxy, String property, MetadataCache cache) {
@@ -112,10 +112,8 @@
}
private static void setAccessibility(Member member) {
- if ( !Modifier.isPublic( member.getModifiers() ) ) {
- //Sun's ease of use, sigh...
- ( ( AccessibleObject ) member ).setAccessible( true );
- }
+ //Sun's ease of use, sigh...
+ ( ( AccessibleObject ) member ).setAccessible( true );
}
public static LoadState isLoaded(Object o) {
@@ -146,10 +144,10 @@
string[0] = Character.toUpperCase( string[0] );
methodName = new String( string );
try {
- return clazz.getMethod( "get" + methodName );
+ return clazz.getDeclaredMethod( "get" + methodName );
}
catch ( NoSuchMethodException e ) {
- return clazz.getMethod( "is" + methodName );
+ return clazz.getDeclaredMethod( "is" + methodName );
}
}
catch ( NoSuchMethodException e ) {
Added: core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
===================================================================
--- core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java 2010-06-15 14:53:17 UTC (rev 19740)
@@ -0,0 +1,109 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @author tags or express
+ * copyright attribution statements applied by the authors. All
+ * third-party contributions are distributed under license by Red Hat Inc.
+ *
+ * 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.ejb.test.util;
+
+import javax.persistence.spi.LoadState;
+
+import org.hibernate.ejb.util.PersistenceUtilHelper;
+
+/**
+ * Tests for HHH-5094
+ *
+ * @author Hardy Ferentschik
+ */
+public class PersistenceUtilHelperTest extends junit.framework.TestCase {
+ private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
+
+ public static class FieldAccessBean {
+ public String publicAccessProperty;
+ protected String protectedAccessProperty;
+ private String privateAccessProperty;
+ }
+
+ public static class MethodAccessBean {
+ private String publicAccessProperty;
+ private String protectedAccessProperty;
+ private String privateAccessProperty;
+
+ public String getPublicAccessPropertyValue() {
+ return publicAccessProperty;
+ }
+
+ protected String getProtectedAccessPropertyValue() {
+ return protectedAccessProperty;
+ }
+
+ private String getPrivateAccessPropertyValue() {
+ return privateAccessProperty;
+ }
+ }
+
+ public void testIsLoadedWithReferencePublicField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "publicAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferencePublicMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "publicAccessPropertyValue", cache
+ )
+ );
+ }
+
+ public void testIsLoadedWithReferenceProtectedField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "protectedAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferenceProtectedMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "protectedAccessPropertyValue", cache
+ )
+ );
+ }
+
+ public void testIsLoadedWithReferencePrivateField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "privateAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferencePrivateMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "privateAccessPropertyValue", cache
+ )
+ );
+ }
+}
13 years, 11 months
Hibernate SVN: r19739 - in core/branches/Branch_3_5/entitymanager/src: test/java/org/hibernate/ejb/test/util and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-15 10:39:39 -0400 (Tue, 15 Jun 2010)
New Revision: 19739
Added:
core/branches/Branch_3_5/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
Modified:
core/branches/Branch_3_5/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
Log:
HHH-5094 made non-plubic fields/methods are accessible
Modified: core/branches/Branch_3_5/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
===================================================================
--- core/branches/Branch_3_5/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-06-15 10:29:41 UTC (rev 19738)
+++ core/branches/Branch_3_5/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-06-15 14:39:39 UTC (rev 19739)
@@ -5,7 +5,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Member;
-import java.lang.reflect.Modifier;
import java.lang.reflect.AccessibleObject;
import java.util.ArrayList;
import java.util.HashMap;
@@ -24,6 +23,7 @@
/**
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class PersistenceUtilHelper {
public static LoadState isLoadedWithoutReference(Object proxy, String property, MetadataCache cache) {
@@ -112,10 +112,8 @@
}
private static void setAccessibility(Member member) {
- if ( !Modifier.isPublic( member.getModifiers() ) ) {
- //Sun's ease of use, sigh...
- ( ( AccessibleObject ) member ).setAccessible( true );
- }
+ //Sun's ease of use, sigh...
+ ( ( AccessibleObject ) member ).setAccessible( true );
}
public static LoadState isLoaded(Object o) {
@@ -146,10 +144,10 @@
string[0] = Character.toUpperCase( string[0] );
methodName = new String( string );
try {
- return clazz.getMethod( "get" + methodName );
+ return clazz.getDeclaredMethod( "get" + methodName );
}
catch ( NoSuchMethodException e ) {
- return clazz.getMethod( "is" + methodName );
+ return clazz.getDeclaredMethod( "is" + methodName );
}
}
catch ( NoSuchMethodException e ) {
Added: core/branches/Branch_3_5/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
===================================================================
--- core/branches/Branch_3_5/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java (rev 0)
+++ core/branches/Branch_3_5/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java 2010-06-15 14:39:39 UTC (rev 19739)
@@ -0,0 +1,109 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @author tags or express
+ * copyright attribution statements applied by the authors. All
+ * third-party contributions are distributed under license by Red Hat Inc.
+ *
+ * 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.ejb.test.util;
+
+import javax.persistence.spi.LoadState;
+
+import org.hibernate.ejb.util.PersistenceUtilHelper;
+
+/**
+ * Tests for HHH-5094
+ *
+ * @author Hardy Ferentschik
+ */
+public class PersistenceUtilHelperTest extends junit.framework.TestCase {
+ private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
+
+ public static class FieldAccessBean {
+ public String publicAccessProperty;
+ protected String protectedAccessProperty;
+ private String privateAccessProperty;
+ }
+
+ public static class MethodAccessBean {
+ private String publicAccessProperty;
+ private String protectedAccessProperty;
+ private String privateAccessProperty;
+
+ public String getPublicAccessPropertyValue() {
+ return publicAccessProperty;
+ }
+
+ protected String getProtectedAccessPropertyValue() {
+ return protectedAccessProperty;
+ }
+
+ private String getPrivateAccessPropertyValue() {
+ return privateAccessProperty;
+ }
+ }
+
+ public void testIsLoadedWithReferencePublicField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "publicAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferencePublicMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "publicAccessPropertyValue", cache
+ )
+ );
+ }
+
+ public void testIsLoadedWithReferenceProtectedField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "protectedAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferenceProtectedMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "protectedAccessPropertyValue", cache
+ )
+ );
+ }
+
+ public void testIsLoadedWithReferencePrivateField() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference( new FieldAccessBean(), "privateAccessProperty", cache )
+ );
+ }
+
+ public void testIsLoadedWithReferencePrivateMethod() {
+ assertEquals(
+ LoadState.UNKNOWN,
+ PersistenceUtilHelper.isLoadedWithReference(
+ new MethodAccessBean(), "privateAccessPropertyValue", cache
+ )
+ );
+ }
+}
13 years, 11 months
Hibernate SVN: r19738 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-15 06:29:41 -0400 (Tue, 15 Jun 2010)
New Revision: 19738
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java
Log:
HV-332 REmoved the default usage of the caching resource bundle locator. If you want to use bundle caching you have to wrap your bundle locator manually.
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java 2010-06-15 10:26:04 UTC (rev 19737)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java 2010-06-15 10:29:41 UTC (rev 19738)
@@ -26,7 +26,6 @@
import java.util.regex.Pattern;
import javax.validation.MessageInterpolator;
-import org.hibernate.validator.resourceloading.CachingResourceBundleLocator;
import org.hibernate.validator.resourceloading.PlatformResourceBundleLocator;
import org.hibernate.validator.resourceloading.ResourceBundleLocator;
@@ -52,7 +51,7 @@
/**
* Regular expression used to do message interpolation.
*/
- private static final Pattern messageParameterPattern = Pattern.compile( "(\\{[^\\}]+?\\})" );
+ private static final Pattern MESSAGE_PARAMETER_PATTERN = Pattern.compile( "(\\{[^\\}]+?\\})" );
/**
* The default locale for the current user.
@@ -108,21 +107,13 @@
defaultLocale = Locale.getDefault();
if ( userResourceBundleLocator == null ) {
- this.userResourceBundleLocator = new CachingResourceBundleLocator(
- new PlatformResourceBundleLocator(
- USER_VALIDATION_MESSAGES
- )
- );
+ this.userResourceBundleLocator = new PlatformResourceBundleLocator( USER_VALIDATION_MESSAGES );
}
else {
- this.userResourceBundleLocator = new CachingResourceBundleLocator( userResourceBundleLocator );
+ this.userResourceBundleLocator = userResourceBundleLocator;
}
- this.defaultResourceBundleLocator =
- new CachingResourceBundleLocator(
- new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES )
- );
-
+ this.defaultResourceBundleLocator = new PlatformResourceBundleLocator( DEFAULT_VALIDATION_MESSAGES );
this.cacheMessages = cacheMessages;
}
@@ -204,7 +195,7 @@
}
private String replaceVariables(String message, ResourceBundle bundle, Locale locale, boolean recurse) {
- Matcher matcher = messageParameterPattern.matcher( message );
+ Matcher matcher = MESSAGE_PARAMETER_PATTERN.matcher( message );
StringBuffer sb = new StringBuffer();
String resolvedParameterValue;
while ( matcher.find() ) {
@@ -220,7 +211,7 @@
}
private String replaceAnnotationAttributes(String message, Map<String, Object> annotationParameters) {
- Matcher matcher = messageParameterPattern.matcher( message );
+ Matcher matcher = MESSAGE_PARAMETER_PATTERN.matcher( message );
StringBuffer sb = new StringBuffer();
while ( matcher.find() ) {
String resolvedParameterValue;
13 years, 11 months
Hibernate SVN: r19737 - core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-15 06:26:04 -0400 (Tue, 15 Jun 2010)
New Revision: 19737
Added:
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java
Modified:
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationDisabledTest.java
Log:
HHH-4968 Do not activate Bean Validation listeners when only DDL is requested (Vladimir Klyushnikov).
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationDisabledTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationDisabledTest.java 2010-06-15 10:25:26 UTC (rev 19736)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationDisabledTest.java 2010-06-15 10:26:04 UTC (rev 19737)
@@ -3,8 +3,10 @@
import java.math.BigDecimal;
import javax.validation.ConstraintViolationException;
+import org.hibernate.mapping.PersistentClass;
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.mapping.Column;
import org.hibernate.cfg.Configuration;
import org.hibernate.test.annotations.TestCase;
@@ -27,6 +29,12 @@
tx.rollback();
s.close();
}
+
+ public void testDDLDisabled() {
+ PersistentClass classMapping = getCfg().getClassMapping( Address.class.getName() );
+ Column countryColumn = (Column) classMapping.getProperty( "country" ).getColumnIterator().next();
+ assertTrue("DDL constraints are applied", countryColumn.isNullable() );
+ }
@Override
protected void configure(Configuration cfg) {
@@ -36,7 +44,8 @@
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] {
+ Address.class,
CupHolder.class
};
}
-}
\ No newline at end of file
+}
Copied: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java (from rev 19736, core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationDisabledTest.java)
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java (rev 0)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java 2010-06-15 10:26:04 UTC (rev 19737)
@@ -0,0 +1,51 @@
+package org.hibernate.test.annotations.beanvalidation;
+
+import java.math.BigDecimal;
+import javax.validation.ConstraintViolationException;
+
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.mapping.Column;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.test.annotations.TestCase;
+
+/**
+ * @author Vladimir Klyushnikov
+ */
+public class DDLWithoutCallbackTest extends TestCase {
+ public void testListeners() {
+ CupHolder ch = new CupHolder();
+ ch.setRadius( new BigDecimal( "12" ) );
+ Session s = openSession( );
+ Transaction tx = s.beginTransaction();
+ try {
+ s.persist( ch );
+ s.flush();
+ }
+ catch ( ConstraintViolationException e ) {
+ fail("invalid object should not be validated");
+ }
+ tx.rollback();
+ s.close();
+ }
+
+ public void testDDLEnabled() {
+ PersistentClass classMapping = getCfg().getClassMapping( Address.class.getName() );
+ Column countryColumn = (Column) classMapping.getProperty( "country" ).getColumnIterator().next();
+ assertFalse("DDL constraints are not applied", countryColumn.isNullable() );
+ }
+
+ @Override
+ protected void configure(Configuration cfg) {
+ super.configure( cfg );
+ cfg.setProperty( "javax.persistence.validation.mode", "ddl" );
+ }
+
+ protected Class<?>[] getAnnotatedClasses() {
+ return new Class<?>[] {
+ Address.class,
+ CupHolder.class
+ };
+ }
+}
13 years, 11 months
Hibernate SVN: r19736 - core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/beanvalidation.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-15 06:25:26 -0400 (Tue, 15 Jun 2010)
New Revision: 19736
Modified:
core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationActivator.java
Log:
HHH-4968 do not activate Bean Validation listeners when only DDL is requested.
Modified: core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationActivator.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationActivator.java 2010-06-15 09:40:40 UTC (rev 19735)
+++ core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationActivator.java 2010-06-15 10:25:26 UTC (rev 19736)
@@ -50,7 +50,7 @@
properties.setProperty( Environment.CHECK_NULLABILITY, "false" );
}
- if ( modes.contains( ValidationMode.NONE ) ) return;
+ if ( ! ( modes.contains( ValidationMode.CALLBACK ) || modes.contains( ValidationMode.AUTO ) ) ) return;
try {
Class<?> activator = ReflectHelper.classForName( TYPE_SAFE_ACTIVATOR_CLASS, BeanValidationActivator.class );
13 years, 11 months
Hibernate SVN: r19735 - in validator/trunk: hibernate-validator and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-06-15 05:40:40 -0400 (Tue, 15 Jun 2010)
New Revision: 19735
Added:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/engine/messageinterpolation/MessageInterpolatorContextTest.java
Modified:
validator/trunk/hibernate-validator/pom.xml
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/MessageInterpolatorContext.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidationContext.java
validator/trunk/pom.xml
Log:
HV-333 Makde sure the actual validated value is passed to interpolate via MessageInterpolatorContext
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2010-06-15 06:40:13 UTC (rev 19734)
+++ validator/trunk/hibernate-validator/pom.xml 2010-06-15 09:40:40 UTC (rev 19735)
@@ -82,6 +82,11 @@
<classifier>jdk15</classifier>
</dependency>
<dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>test</scope>
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/MessageInterpolatorContext.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/MessageInterpolatorContext.java 2010-06-15 06:40:13 UTC (rev 19734)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/MessageInterpolatorContext.java 2010-06-15 09:40:40 UTC (rev 19735)
@@ -21,9 +21,10 @@
import javax.validation.MessageInterpolator;
/**
- * Takes mandatory elements in the constructor
+ * Implementation of the context used during message interpolation.
*
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
public class MessageInterpolatorContext implements MessageInterpolator.Context {
private final ConstraintDescriptor<?> constraintDescriptor;
@@ -41,4 +42,42 @@
public Object getValidatedValue() {
return validatedValue;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if ( this == o ) {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() ) {
+ return false;
+ }
+
+ MessageInterpolatorContext that = ( MessageInterpolatorContext ) o;
+
+ if ( constraintDescriptor != null ? !constraintDescriptor.equals( that.constraintDescriptor ) : that.constraintDescriptor != null ) {
+ return false;
+ }
+ if ( validatedValue != null ? !validatedValue.equals( that.validatedValue ) : that.validatedValue != null ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = constraintDescriptor != null ? constraintDescriptor.hashCode() : 0;
+ result = 31 * result + ( validatedValue != null ? validatedValue.hashCode() : 0 );
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( "MessageInterpolatorContext" );
+ sb.append( "{constraintDescriptor=" ).append( constraintDescriptor );
+ sb.append( ", validatedValue=" ).append( validatedValue );
+ sb.append( '}' );
+ return sb.toString();
+ }
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidationContext.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidationContext.java 2010-06-15 06:40:13 UTC (rev 19734)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/engine/ValidationContext.java 2010-06-15 09:40:40 UTC (rev 19735)
@@ -149,7 +149,7 @@
String messageTemplate = messageAndPath.getMessage();
String interpolatedMessage = messageInterpolator.interpolate(
messageTemplate,
- new MessageInterpolatorContext( descriptor, localContext.getCurrentBean() )
+ new MessageInterpolatorContext( descriptor, localContext.getCurrentValidatedValue() )
);
return new ConstraintViolationImpl<T>(
messageTemplate,
Copied: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/engine/messageinterpolation/MessageInterpolatorContextTest.java (from rev 19558, validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/engine/messageinterpolation/MessageInterpolationTest.java)
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/engine/messageinterpolation/MessageInterpolatorContextTest.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/test/engine/messageinterpolation/MessageInterpolatorContextTest.java 2010-06-15 09:40:40 UTC (rev 19735)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id$
+
+package org.hibernate.validator.test.engine.messageinterpolation;
+
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.MessageInterpolator;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+import javax.validation.metadata.BeanDescriptor;
+import javax.validation.metadata.ConstraintDescriptor;
+import javax.validation.metadata.PropertyDescriptor;
+
+import org.hibernate.validator.HibernateValidator;
+import org.hibernate.validator.HibernateValidatorConfiguration;
+import org.hibernate.validator.cfg.ConstraintMapping;
+import org.hibernate.validator.cfg.defs.MinDef;
+import org.hibernate.validator.engine.MessageInterpolatorContext;
+import org.hibernate.validator.test.util.TestUtil;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.hibernate.validator.test.util.TestUtil.assertNumberOfViolations;
+import static org.testng.Assert.assertTrue;
+
+
+/**
+ * Tests for HV-333
+ *
+ * @author Hardy Ferentschik
+ */
+public class MessageInterpolatorContextTest {
+
+ @org.testng.annotations.Test
+ public void testInterpolatorContext() throws Exception {
+
+ // use programmatic mapping api to configure constraint
+ ConstraintMapping mapping = new ConstraintMapping();
+ mapping.type( Test.class )
+ .property( "test", FIELD )
+ .constraint( MinDef.class )
+ .value( 10 )
+ .message( "{foo}" );
+
+ // use a easy mock message interpolator to verify the right for verifying that the right MessageInterpolatorContext
+ // will be passed
+ MessageInterpolator mock = createMock( MessageInterpolator.class );
+ HibernateValidatorConfiguration config = TestUtil.getConfiguration( HibernateValidator.class );
+ config.messageInterpolator( mock );
+ config.addMapping( mapping );
+
+ ValidatorFactory factory = config.buildValidatorFactory();
+ Validator validator = factory.getValidator();
+
+ BeanDescriptor beanDescriptor = validator.getConstraintsForClass( Test.class );
+ PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty( "test" );
+ Set<ConstraintDescriptor<?>> constraintDescriptors = propertyDescriptor.getConstraintDescriptors();
+ assertTrue( constraintDescriptors.size() == 1 );
+
+ // prepare the mock interpolator to expect the right interpolate call
+ String validatedValue = "value";
+ expect(
+ mock.interpolate(
+ "{foo}",
+ new MessageInterpolatorContext( constraintDescriptors.iterator().next(), validatedValue )
+ )
+ ).andReturn( "{foo}" );
+ replay( mock );
+
+ Set<ConstraintViolation<Test>> violations = validator.validate( new Test( validatedValue ) );
+ assertNumberOfViolations( violations, 1 );
+
+ // verify that the right validatedValue was passed
+ verify( mock );
+ }
+
+
+ public static class Test {
+ private String test;
+
+ public Test(String test) {
+ this.test = test;
+ }
+
+ public String getTest() {
+ return test;
+ }
+
+ public void setTest(String test) {
+ this.test = test;
+ }
+ }
+}
\ No newline at end of file
Modified: validator/trunk/pom.xml
===================================================================
--- validator/trunk/pom.xml 2010-06-15 06:40:13 UTC (rev 19734)
+++ validator/trunk/pom.xml 2010-06-15 09:40:40 UTC (rev 19735)
@@ -105,6 +105,11 @@
<classifier>jdk15</classifier>
</dependency>
<dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.2.124</version>
13 years, 11 months
Hibernate SVN: r19734 - core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/instrument/domain.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-06-15 02:40:13 -0400 (Tue, 15 Jun 2010)
New Revision: 19734
Modified:
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/instrument/domain/Documents.hbm.xml
Log:
HHH-5231 : Unit test locks up with db2 on Branch_3_5
Modified: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/instrument/domain/Documents.hbm.xml
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/instrument/domain/Documents.hbm.xml 2010-06-15 03:23:37 UTC (rev 19733)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/instrument/domain/Documents.hbm.xml 2010-06-15 06:40:13 UTC (rev 19734)
@@ -56,7 +56,7 @@
<property name="sizeKb" lazy="true">
<column name="size_mb"
read="size_mb * 1024.0"
- write="? / 1024.0"/>
+ write="? / cast( 1024.0 as float )"/>
</property>
</class>
13 years, 11 months
Hibernate SVN: r19733 - core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/naturalid/mutable.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-06-14 23:23:37 -0400 (Mon, 14 Jun 2010)
New Revision: 19733
Modified:
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java
Log:
HHH-5231 : Unit test locks up on postgresql on Branch_3_5
Modified: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java 2010-06-15 02:46:11 UTC (rev 19732)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java 2010-06-15 03:23:37 UTC (rev 19733)
@@ -327,6 +327,8 @@
.setCacheable( true )
.uniqueResult();
assertNotNull( u );
+ s.getTransaction().commit();
+ s.close();
assertEquals( getSessions().getStatistics().getQueryExecutionCount(), 1 );
assertEquals( getSessions().getStatistics().getQueryCacheHitCount(), 0 );
13 years, 11 months
Hibernate SVN: r19732 - core/branches/Branch_3_5/parent.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-06-14 22:46:11 -0400 (Mon, 14 Jun 2010)
New Revision: 19732
Modified:
core/branches/Branch_3_5/parent/pom.xml
Log:
HHH-5312 update the db account used in branch 35 test
Modified: core/branches/Branch_3_5/parent/pom.xml
===================================================================
--- core/branches/Branch_3_5/parent/pom.xml 2010-06-15 02:45:35 UTC (rev 19731)
+++ core/branches/Branch_3_5/parent/pom.xml 2010-06-15 02:46:11 UTC (rev 19732)
@@ -626,9 +626,9 @@
<properties>
<db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
- <jdbc.url>jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.url>jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com/hibbr35</jdbc.url>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -647,9 +647,9 @@
<properties>
<db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
- <jdbc.url>jdbc:mysql://vmg02.mw.lab.eng.bos.redhat.com/hibbrtru</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.url>jdbc:mysql://vmg02.mw.lab.eng.bos.redhat.com/hibbr35</jdbc.url>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -668,10 +668,10 @@
<properties>
<db.dialect>org.hibernate.dialect.MySQL5Dialect</db.dialect>
<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
- <jdbc.url>jdbc:mysql:loadbalance://dev61.qa.atl2.redhat.com:3306,dev62.qa.atl2.redhat.com:3306/hibbrtru
+ <jdbc.url>jdbc:mysql:loadbalance://dev61.qa.atl2.redhat.com:3306,dev62.qa.atl2.redhat.com:3306/hibbr35
</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -690,9 +690,9 @@
<properties>
<db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
- <jdbc.url>jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.url>jdbc:postgresql://vmg01.mw.lab.eng.bos.redhat.com:5432:hibbr35</jdbc.url>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -711,9 +711,9 @@
<properties>
<db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
- <jdbc.url>jdbc:postgresql://vmg03.mw.lab.eng.bos.redhat.com:5432:hibbrtru</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.url>jdbc:postgresql://vmg03.mw.lab.eng.bos.redhat.com:5432:hibbr35</jdbc.url>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -744,8 +744,8 @@
<db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<jdbc.url>jdbc:db2://dev32.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -770,8 +770,8 @@
<db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<jdbc.url>jdbc:db2://dev67.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -796,8 +796,8 @@
<db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
<jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
<jdbc.url>jdbc:db2://vmg06.mw.lab.eng.bos.redhat.com:50000/jbossqa</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -818,8 +818,8 @@
<db.dialect>org.hibernate.dialect.Oracle9iDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@dev20.qa.atl.jboss.com:1521:qa</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -840,8 +840,8 @@
<db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -861,8 +861,8 @@
<db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<jdbc.url>jdbc:oracle:thin:@dev04.qa.atl2.redhat.com:1521:qaora11</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -884,8 +884,8 @@
<jdbc.url>
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))
</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -904,9 +904,9 @@
<properties>
<db.dialect>org.hibernate.dialect.SybaseASE15Dialect</db.dialect>
<jdbc.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.driver>
- <jdbc.url>jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbrtru</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.url>jdbc:sybase:Tds:vmg07.mw.lab.eng.bos.redhat.com:5000/hibbr35</jdbc.url>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation />
</properties>
</profile>
@@ -926,8 +926,8 @@
<db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
<jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
<jdbc.url>jdbc:sqlserver://dev30.qa.atl.jboss.com:3918</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation>4096</jdbc.isolation>
</properties>
</profile>
@@ -947,8 +947,8 @@
<db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
<jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
<jdbc.url>jdbc:sqlserver://vmg04.mw.lab.eng.bos.redhat.com:1433</jdbc.url>
- <jdbc.user>hibbrtru</jdbc.user>
- <jdbc.pass>hibbrtru</jdbc.pass>
+ <jdbc.user>hibbr35</jdbc.user>
+ <jdbc.pass>hibbr35</jdbc.pass>
<jdbc.isolation>4096</jdbc.isolation>
</properties>
</profile>
13 years, 11 months