HHH-6113 change to a better class name

This commit is contained in:
Strong Liu 2011-05-17 20:14:32 +08:00
parent cb63f03437
commit 2abbe4d841
3 changed files with 16 additions and 16 deletions

View File

@ -28,7 +28,7 @@ import org.jboss.jandex.DotName;
/** /**
* @author Strong Liu * @author Strong Liu
*/ */
public interface MockedNames { public interface PseudoJpaDotNames {
public static final DotName DEFAULT_ACCESS = DotName.createSimple( "default.access" ); public static final DotName DEFAULT_ACCESS = DotName.createSimple( "default.access" );
public static final DotName DEFAULT_DELIMITED_IDENTIFIERS = DotName.createSimple( "default.delimited.identifiers" ); public static final DotName DEFAULT_DELIMITED_IDENTIFIERS = DotName.createSimple( "default.delimited.identifiers" );
public static final DotName DEFAULT_ENTITY_LISTENERS = DotName.createSimple( "default.entity.listeners" ); public static final DotName DEFAULT_ENTITY_LISTENERS = DotName.createSimple( "default.entity.listeners" );

View File

@ -10,7 +10,7 @@ import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName; import org.jboss.jandex.DotName;
import org.hibernate.metamodel.source.annotation.xml.XMLPersistenceUnitDefaults; import org.hibernate.metamodel.source.annotation.xml.XMLPersistenceUnitDefaults;
import org.hibernate.metamodel.source.annotations.xml.MockedNames; import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames;
/** /**
* @author Strong Liu * @author Strong Liu
@ -21,16 +21,16 @@ class PersistenceMetadataMocker extends AbstractMocker {
private static Map<DotName, DotName> nameDotNameMap = new HashMap<DotName, DotName>(); private static Map<DotName, DotName> nameDotNameMap = new HashMap<DotName, DotName>();
static { static {
nameDotNameMap.put( ACCESS, MockedNames.DEFAULT_ACCESS ); nameDotNameMap.put( ACCESS, PseudoJpaDotNames.DEFAULT_ACCESS );
nameDotNameMap.put( ENTITY_LISTENERS, MockedNames.DEFAULT_ENTITY_LISTENERS ); nameDotNameMap.put( ENTITY_LISTENERS, PseudoJpaDotNames.DEFAULT_ENTITY_LISTENERS );
nameDotNameMap.put( POST_LOAD, MockedNames.DEFAULT_POST_LOAD ); nameDotNameMap.put( POST_LOAD, PseudoJpaDotNames.DEFAULT_POST_LOAD );
nameDotNameMap.put( POST_REMOVE, MockedNames.DEFAULT_POST_REMOVE ); nameDotNameMap.put( POST_REMOVE, PseudoJpaDotNames.DEFAULT_POST_REMOVE );
nameDotNameMap.put( POST_UPDATE, MockedNames.DEFAULT_POST_UPDATE ); nameDotNameMap.put( POST_UPDATE, PseudoJpaDotNames.DEFAULT_POST_UPDATE );
nameDotNameMap.put( POST_PERSIST, MockedNames.DEFAULT_POST_PERSIST ); nameDotNameMap.put( POST_PERSIST, PseudoJpaDotNames.DEFAULT_POST_PERSIST );
nameDotNameMap.put( PRE_REMOVE, MockedNames.DEFAULT_PRE_REMOVE ); nameDotNameMap.put( PRE_REMOVE, PseudoJpaDotNames.DEFAULT_PRE_REMOVE );
nameDotNameMap.put( PRE_UPDATE, MockedNames.DEFAULT_PRE_UPDATE ); nameDotNameMap.put( PRE_UPDATE, PseudoJpaDotNames.DEFAULT_PRE_UPDATE );
nameDotNameMap.put( PRE_PERSIST, MockedNames.DEFAULT_PRE_PERSIST ); nameDotNameMap.put( PRE_PERSIST, PseudoJpaDotNames.DEFAULT_PRE_PERSIST );
nameDotNameMap.put( MockedNames.DEFAULT_DELIMITED_IDENTIFIERS, MockedNames.DEFAULT_DELIMITED_IDENTIFIERS ); nameDotNameMap.put( PseudoJpaDotNames.DEFAULT_DELIMITED_IDENTIFIERS, PseudoJpaDotNames.DEFAULT_DELIMITED_IDENTIFIERS );
} }
PersistenceMetadataMocker(IndexBuilder indexBuilder, XMLPersistenceUnitDefaults persistenceUnitDefaults) { PersistenceMetadataMocker(IndexBuilder indexBuilder, XMLPersistenceUnitDefaults persistenceUnitDefaults) {
@ -51,7 +51,7 @@ class PersistenceMetadataMocker extends AbstractMocker {
final void process() { final void process() {
parserAccessType( persistenceUnitDefaults.getAccess(), null ); parserAccessType( persistenceUnitDefaults.getAccess(), null );
if ( persistenceUnitDefaults.getDelimitedIdentifiers() != null ) { if ( persistenceUnitDefaults.getDelimitedIdentifiers() != null ) {
create( MockedNames.DEFAULT_DELIMITED_IDENTIFIERS, null ); create( PseudoJpaDotNames.DEFAULT_DELIMITED_IDENTIFIERS, null );
} }
if ( persistenceUnitDefaults.getEntityListeners() != null ) { if ( persistenceUnitDefaults.getEntityListeners() != null ) {
new DefaultListenerMocker( indexBuilder, null ).parser( persistenceUnitDefaults.getEntityListeners() ); new DefaultListenerMocker( indexBuilder, null ).parser( persistenceUnitDefaults.getEntityListeners() );

View File

@ -30,7 +30,7 @@ import org.jboss.jandex.Index;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import org.hibernate.metamodel.source.annotations.xml.MockedNames; import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames;
/** /**
* @author Strong Liu * @author Strong Liu
@ -39,8 +39,8 @@ public class PersistenceMetadataMockerTest extends AbstractMockerTest {
@Test @Test
public void testPersistenceMetadata() { public void testPersistenceMetadata() {
Index index = getMockedIndex( "persistence-metadata.xml" ); Index index = getMockedIndex( "persistence-metadata.xml" );
assertHasAnnotation( index, null, MockedNames.DEFAULT_ACCESS, 1 ); assertHasAnnotation( index, null, PseudoJpaDotNames.DEFAULT_ACCESS, 1 );
assertAnnotationValue(index,null,MockedNames.DEFAULT_ACCESS,new AnnotationValueChecker(){ assertAnnotationValue(index,null, PseudoJpaDotNames.DEFAULT_ACCESS,new AnnotationValueChecker(){
@Override @Override
public void check(AnnotationInstance annotationInstance) { public void check(AnnotationInstance annotationInstance) {
assertEquals( AccessType.FIELD.toString(), annotationInstance.value().asEnum()); assertEquals( AccessType.FIELD.toString(), annotationInstance.value().asEnum());