securedbindingtest.java

来自「hibernate3.2.6源码和jar包」· Java 代码 · 共 45 行

JAVA
45
字号
//$Id: SecuredBindingTest.java 11282 2007-03-14 22:05:59Z epbernard $package org.hibernate.test.annotations;import java.util.Properties;import junit.framework.TestCase;import org.hibernate.HibernateException;import org.hibernate.SessionFactory;import org.hibernate.cfg.AnnotationConfiguration;import org.hibernate.cfg.Environment;/** * @author Emmanuel Bernard */public class SecuredBindingTest extends TestCase {	public SecuredBindingTest(String x) {		super( x );	}	public void testConfigurationMethods() throws Exception {		AnnotationConfiguration ac = new AnnotationConfiguration();		Properties p = new Properties();		p.put( Environment.DIALECT, "org.hibernate.dialect.HSQLDialect" );		p.put( "hibernate.connection.driver_class", "org.hsqldb.jdbcDrive" );		p.put( "hibernate.connection.url", "jdbc:hsqldb:." );		p.put( "hibernate.connection.username", "sa" );		p.put( "hibernate.connection.password", "" );		p.put( "hibernate.show_sql", "true" );		ac.setProperties( p );		ac.addAnnotatedClass( Plane.class );		SessionFactory sf;		try {			sf = ac.buildSessionFactory();			fail( "Driver property overriding should work" );			sf.close();		}		catch (HibernateException he) {			//success		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?