HHH-16887 update tests
This commit is contained in:
parent
f61e00c642
commit
13877a9a3e
|
@ -19,10 +19,9 @@ import static org.hibernate.jpamodelgen.test.util.TestUtil.assertPresenceOfNameF
|
||||||
*/
|
*/
|
||||||
public class AuxiliaryTest extends CompilationTest {
|
public class AuxiliaryTest extends CompilationTest {
|
||||||
@Test
|
@Test
|
||||||
@WithClasses({ Book.class, Main.class, Dao.class })
|
@WithClasses({ Book.class, Main.class })
|
||||||
public void testGeneratedAnnotationNotGenerated() {
|
public void testGeneratedAnnotationNotGenerated() {
|
||||||
System.out.println( TestUtil.getMetaModelSourceAsString( Main.class ) );
|
System.out.println( TestUtil.getMetaModelSourceAsString( Main.class ) );
|
||||||
System.out.println( TestUtil.getMetaModelSourceAsString( Dao.class ) );
|
|
||||||
assertMetamodelClassGeneratedFor( Book.class );
|
assertMetamodelClassGeneratedFor( Book.class );
|
||||||
assertMetamodelClassGeneratedFor( Main.class );
|
assertMetamodelClassGeneratedFor( Main.class );
|
||||||
assertPresenceOfNameFieldInMetamodelFor(
|
assertPresenceOfNameFieldInMetamodelFor(
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package org.hibernate.jpamodelgen.test.noentity;
|
||||||
|
|
||||||
|
import jakarta.persistence.TypedQuery;
|
||||||
|
import org.hibernate.annotations.processing.HQL;
|
||||||
|
|
||||||
|
public interface Dao {
|
||||||
|
@HQL("select upper('Hibernate')")
|
||||||
|
TypedQuery<String> getName();
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
|
*/
|
||||||
|
package org.hibernate.jpamodelgen.test.noentity;
|
||||||
|
|
||||||
|
import org.hibernate.jpamodelgen.test.util.CompilationTest;
|
||||||
|
import org.hibernate.jpamodelgen.test.util.TestUtil;
|
||||||
|
import org.hibernate.jpamodelgen.test.util.WithClasses;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Gavin King
|
||||||
|
*/
|
||||||
|
public class NoEntityTest extends CompilationTest {
|
||||||
|
@Test
|
||||||
|
@WithClasses({ Dao.class })
|
||||||
|
public void testGeneratedAnnotationNotGenerated() {
|
||||||
|
System.out.println( TestUtil.getMetaModelSourceAsString( Dao.class ) );
|
||||||
|
assertMetamodelClassGeneratedFor( Dao.class );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package org.hibernate.jpamodelgen.test.querymethod;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.NamedEntityGraph;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Book {
|
||||||
|
@Id String isbn;
|
||||||
|
String title;
|
||||||
|
String text;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package org.hibernate.jpamodelgen.test.namedquery;
|
package org.hibernate.jpamodelgen.test.querymethod;
|
||||||
|
|
||||||
import jakarta.persistence.TypedQuery;
|
import jakarta.persistence.TypedQuery;
|
||||||
import org.hibernate.annotations.processing.HQL;
|
import org.hibernate.annotations.processing.HQL;
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
|
*/
|
||||||
|
package org.hibernate.jpamodelgen.test.querymethod;
|
||||||
|
|
||||||
|
import org.hibernate.jpamodelgen.test.util.CompilationTest;
|
||||||
|
import org.hibernate.jpamodelgen.test.util.TestUtil;
|
||||||
|
import org.hibernate.jpamodelgen.test.util.WithClasses;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.hibernate.jpamodelgen.test.util.TestUtil.assertMetamodelClassGeneratedFor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Gavin King
|
||||||
|
*/
|
||||||
|
public class QueryMethodTest extends CompilationTest {
|
||||||
|
@Test
|
||||||
|
@WithClasses({ Book.class, Dao.class })
|
||||||
|
public void testGeneratedAnnotationNotGenerated() {
|
||||||
|
System.out.println( TestUtil.getMetaModelSourceAsString( Dao.class ) );
|
||||||
|
assertMetamodelClassGeneratedFor( Book.class );
|
||||||
|
assertMetamodelClassGeneratedFor( Dao.class );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue