public void testExampleComplex() throws Exception {
DataSource ds = new DriverManagerDataSource();
String resource = "/org/springframework/orm/jpa/persistence-complex.xml";
MapDataSourceLookup dataSourceLookup = new MapDataSourceLookup();
Map<String, DataSource> dataSources = new HashMap<String, DataSource>();
dataSources.put("jdbc/MyPartDB", ds);
dataSources.put("jdbc/MyDB", ds);
dataSourceLookup.setDataSources(dataSources);
PersistenceUnitReader reader = new PersistenceUnitReader(
new PathMatchingResourcePatternResolver(), dataSourceLookup);
PersistenceUnitInfo[] info = reader.readPersistenceUnitInfos(resource);
assertEquals(2, info.length);