From a12b9d7fd5c42b5b0ab4c44bddad73c8cc35d05c Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Thu, 24 Oct 2013 16:36:33 +0200 Subject: [PATCH] METAGEN-103 Fixing existing checkstyle violations --- .../jpamodelgen/test/accesstype/Shop.java | 1 + .../mappedsuperclasswithoutid/Shop.java | 1 + .../jpamodelgen/test/util/TestUtil.java | 2 +- ...DataCompleteSinglePersistenceUnitTest.java | 19 +++++-------------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/accesstype/Shop.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/accesstype/Shop.java index c37addbec0..5b917ec00e 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/accesstype/Shop.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/accesstype/Shop.java @@ -31,4 +31,5 @@ public class Shop { String name; } + \ No newline at end of file diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/mappedsuperclass/mappedsuperclasswithoutid/Shop.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/mappedsuperclass/mappedsuperclasswithoutid/Shop.java index 2706461f39..7750a42cb8 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/mappedsuperclass/mappedsuperclasswithoutid/Shop.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/mappedsuperclass/mappedsuperclasswithoutid/Shop.java @@ -29,4 +29,5 @@ public class Shop { String name; } + \ No newline at end of file diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java index 7ba35e2144..2aafffb3b8 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/util/TestUtil.java @@ -174,7 +174,7 @@ public class TestUtil { String metaModelClassName = entityClass.getName() + META_MODEL_CLASS_POSTFIX; try { URL outDirUrl = OUT_BASE_DIR.toURI().toURL(); - URL urls[] = new URL[1]; + URL[] urls = new URL[1]; urls[0] = outDirUrl; URLClassLoader classLoader = new URLClassLoader( urls, TestUtil.class.getClassLoader() ); return classLoader.loadClass( metaModelClassName ); diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/xmlmetacomplete/singlepu/XmlMetaDataCompleteSinglePersistenceUnitTest.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/xmlmetacomplete/singlepu/XmlMetaDataCompleteSinglePersistenceUnitTest.java index dea3eff885..63a85d507e 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/xmlmetacomplete/singlepu/XmlMetaDataCompleteSinglePersistenceUnitTest.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/xmlmetacomplete/singlepu/XmlMetaDataCompleteSinglePersistenceUnitTest.java @@ -16,12 +16,10 @@ */ package org.hibernate.jpamodelgen.test.xmlmetacomplete.singlepu; -import java.util.HashMap; -import java.util.Map; - import org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor; import org.hibernate.jpamodelgen.test.util.CompilationTest; -import org.hibernate.jpamodelgen.test.util.TestUtil; +import org.hibernate.jpamodelgen.test.util.WithClasses; +import org.hibernate.jpamodelgen.test.util.WithProcessorOption; import org.junit.Test; import static org.hibernate.jpamodelgen.test.util.TestUtil.assertNoSourceFileGeneratedFor; @@ -31,19 +29,12 @@ import static org.hibernate.jpamodelgen.test.util.TestUtil.assertNoSourceFileGen */ public class XmlMetaDataCompleteSinglePersistenceUnitTest extends CompilationTest { @Test + @WithClasses(org.hibernate.jpamodelgen.test.xmlmetacomplete.multiplepus.Dummy.class) + @WithProcessorOption(key = JPAMetaModelEntityProcessor.PERSISTENCE_XML_OPTION, + value = "org/hibernate/jpamodelgen/test/xmlmetacomplete/singlepu/persistence.xml") public void testNoMetaModelGenerated() { // the xml mapping files used in the example say that the xml data is meta complete. For that // reason there should be no meta model source file for the annotated Dummy entity assertNoSourceFileGeneratedFor( Dummy.class ); } - -// @Override -// protected Map getProcessorOptions() { -// Map properties = new HashMap(); -// properties.put( -// JPAMetaModelEntityProcessor.PERSISTENCE_XML_OPTION, -// TestUtil.fcnToPath( XmlMetaDataCompleteSinglePersistenceUnitTest.class.getPackage().getName() ) + "/persistence.xml" -// ); -// return properties; -// } }