Code example for ServiceRegistryBuilder

0
 */ 
public class MetadataImplTest extends BaseUnitTestCase { 
 
	@Test(expected = IllegalArgumentException.class)
	public void testAddingNullClass() { 
		MetadataSources sources = new MetadataSources( new ServiceRegistryBuilder().buildServiceRegistry() );
		sources.addClass( null );
		sources.buildMetadata();
	} 
 
	@Test(expected = IllegalArgumentException.class)
	public void testAddingNullPackageName() { 
		MetadataSources sources = new MetadataSources( new ServiceRegistryBuilder().buildServiceRegistry() );
		sources.addPackage( null );
		sources.buildMetadata();
	} 
 
	@Test(expected = HibernateException.class)
	public void testAddingNonExistingPackageName() { 
		MetadataSources sources = new MetadataSources( new ServiceRegistryBuilder().buildServiceRegistry() );