Please refer Hibernate4NativeAPISetupwithMetaDataTestCase using SFSBHibernatewithMetaDataSession:
If you run test,first you will get the following exception in server log:
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at org.hibernate.metamodel.MetadataSources.<init>(MetadataSources.java:83) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.metamodel.MetadataSources.<init>(MetadataSources.java:75) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.jboss.as.test.integration.hibernate.SFSBHibernatewithMetaDataSession.setupConfig(SFSBHibernatewithMetaDataSession.java:91) [beans.jar:]
... 138 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException from [Module "org.hibernate:main" from local module loader @b01d43 (roots: /home/msadhukh/REDHAT/jbossAS7/jboss-as/testsuite/integration/basic/../../../build/target/jboss-as-7.1.1.Final-SNAPSHOT/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
The javax.xml.bind.api dependency is missing in module.xml within /jboss-as/build/target/jboss-as-7.1.1.Final-SNAPSHOT/modules/org/hibernate/main and build should accomodate it.