请问各位大神,断言测试结果是false,哪里出问题了?

来源:2-3 用户业务逻辑接口和类

baker_Uzi

2016-12-07 22:53

07, 2016 10:49:50 下午 org.hibernate.annotations.common.Version <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

十二月 07, 2016 10:49:50 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.2.Final}

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000205: Loaded properties from resource hibernate.properties: {hibernate.max_fetch_depth=5, hibernate.cache.region_prefix=hibernate.search.test, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.dialect=org.hibernate.dialect.H2Dialect, hibernate.show_sql=false, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.isolation=${jdbc.isolation}, hibernate.format_sql=false}

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Configuration configure

INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

INFO: HHH000040: Configuration resource: /hibernate.cfg.xml

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: entity/Manager.hbm.xml

十二月 07, 2016 10:49:50 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity

WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: entity/Users.hbm.xml

十二月 07, 2016 10:49:50 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity

WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

十二月 07, 2016 10:49:50 下午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

十二月 07, 2016 10:49:50 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)

十二月 07, 2016 10:49:51 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

十二月 07, 2016 10:49:51 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

十二月 07, 2016 10:49:51 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:MySQL://localhost:3306/test]

十二月 07, 2016 10:49:51 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000046: Connection properties: {user=root}

十二月 07, 2016 10:49:51 下午 org.hibernate.dialect.Dialect <init>

INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

十二月 07, 2016 10:49:51 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService

INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)

十二月 07, 2016 10:49:51 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>

INFO: HHH000397: Using ASTQueryTranslatorFactory

十二月 07, 2016 10:49:52 下午 org.hibernate.tuple.PojoInstantiator <init>

INFO: HHH000182: No default (no-argument) constructor for class: entity.Users (class must be instantiated by Interceptor)

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute

INFO: HHH000228: Running hbm2ddl schema update

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute

INFO: HHH000102: Fetching database metadata

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute

INFO: HHH000396: Updating schema

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000261: Table found: test.manager

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000037: Columns: [magname, magid, magpassword]

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000108: Foreign keys: []

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000126: Indexes: [primary]

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000261: Table found: test.users

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000037: Columns: [usersex, birthday, uid, password, usertel, username]

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000108: Foreign keys: []

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>

INFO: HHH000126: Indexes: [primary]

十二月 07, 2016 10:49:53 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute

INFO: HHH000232: Schema update complete

十二月 07, 2016 10:49:53 下午 org.hibernate.hql.internal.ast.HqlSqlWalker generatePositionalParameter

WARN: [DEPRECATION] Encountered positional parameter near line 1, column 34.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.

十二月 07, 2016 10:49:53 下午 org.hibernate.hql.internal.ast.HqlSqlWalker generatePositionalParameter

WARN: [DEPRECATION] Encountered positional parameter near line 1, column 49.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.

java.lang.ClassCastException: org.hibernate.internal.QueryImpl cannot be cast to javax.persistence.Query

at service.impl.UsersDAOImpl.usersLogin(UsersDAOImpl.java:30)

at service.impl.TestUsersDAOImpl.testUsersLogin(TestUsersDAOImpl.java:17)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

at org.junit.runners.ParentRunner.run(ParentRunner.java:300)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


写回答 关注

1回答

  • Java_study
    2016-12-08 11:14:03

    WARN:[DEPRECATION]在第1行第34列附近遇到位置参数。位置参数被视为已弃用; 请使用命名参数或JPA样式位置参数。

    十二月07,2016 10:49:53下午org.hibernate.hql.internal.ast.HqlSqlWalker generatePositionalParameter

    WARN:[DEPRECATION]在第1行第49列附近遇到位置参数。位置参数被视为已弃用;


使用Struts2+Hibernate开发学生信息管理功能

Strust2+Hibernate整合开发案例,Java Web开发技能更上一层楼

80701 学习 · 754 问题

查看课程

相似问题