add test for include/exclude
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
ccaefc168a
commit
503cd3e9ed
|
@ -0,0 +1,9 @@
|
||||||
|
package org.hibernate.processor.test.includeexclude;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Bar {
|
||||||
|
@Id long id;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package org.hibernate.processor.test.includeexclude;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import org.hibernate.annotations.processing.Exclude;
|
||||||
|
|
||||||
|
@Exclude
|
||||||
|
@Entity
|
||||||
|
public class Baz {
|
||||||
|
@Id long id;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package org.hibernate.processor.test.includeexclude;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Foo {
|
||||||
|
@Id long id;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.hibernate.processor.test.includeexclude;
|
||||||
|
|
||||||
|
import org.hibernate.processor.HibernateProcessor;
|
||||||
|
import org.hibernate.processor.test.util.CompilationTest;
|
||||||
|
import org.hibernate.processor.test.util.WithClasses;
|
||||||
|
import org.hibernate.processor.test.util.WithProcessorOption;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.hibernate.processor.test.util.TestUtil.assertMetamodelClassGeneratedFor;
|
||||||
|
import static org.hibernate.processor.test.util.TestUtil.assertNoMetamodelClassGeneratedFor;
|
||||||
|
|
||||||
|
public class IncludeExcludeTest extends CompilationTest {
|
||||||
|
@Test
|
||||||
|
@WithClasses({ Foo.class, Bar.class, Baz.class })
|
||||||
|
@WithProcessorOption(key = HibernateProcessor.INCLUDE, value = "org.hibernate.processor.test.includeexclude.*")
|
||||||
|
@WithProcessorOption(key = HibernateProcessor.EXCLUDE, value = "org.hibernate.processor.test.includeexclude.F*")
|
||||||
|
public void testQueryMethod() {
|
||||||
|
assertNoMetamodelClassGeneratedFor( Foo.class );
|
||||||
|
assertMetamodelClassGeneratedFor( Bar.class );
|
||||||
|
assertNoMetamodelClassGeneratedFor( Baz.class );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue