Permalink
Browse files

Revert "AS7-5474 fix 'jboss.as.jpa.vfs' support in PersistenceUnitInf…

…o.getPersistenceUnitRootUrl() to return contents of persistence unit root"

This reverts commit 0922104.
  • Loading branch information...
1 parent 82bd8ec commit a6c5b4375990e2f7ccf432591186413d3ec11e67 @scottmarlow scottmarlow committed with jaikiran Nov 17, 2012
View
2 jpa/core/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitParseProcessor.java
@@ -283,7 +283,7 @@ private URL getPersistenceUnitURL(VirtualFile persistence_xml, boolean convertVF
try {
VirtualFile metaData = persistence_xml;// di.getMetaDataFile("persistence.xml");
return convertVFS ?
- metaData.getPhysicalFile().getParentFile().getParentFile().toURI().toURL() :
+ metaData.getParent().getParent().getPhysicalFile().toURI().toURL() :
metaData.getParent().getParent().toURL();
} catch (Exception e) {
View
26 .../jboss/as/test/integration/jpa/mockprovider/classtransformer/TestPersistenceProvider.java
@@ -22,16 +22,16 @@
package org.jboss.as.test.integration.jpa.mockprovider.classtransformer;
-import java.io.File;
import java.lang.reflect.Proxy;
-import java.net.URL;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import javax.persistence.spi.PersistenceProvider;
import javax.persistence.spi.PersistenceUnitInfo;
import javax.persistence.spi.ProviderUtil;
+import org.jboss.as.jpa.container.EntityManagerUnwrappedTargetInvocationHandler;
+
/**
* TestPersistenceProvider
*
@@ -84,32 +84,10 @@ public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitI
testEntityManagerFactory
);
- testGetPersistenceUnitRootUrl(info);
-
System.out.println("TestPersistenceProvider.createContainerEntityManagerFactory() is returning " + proxyEntityManagerFactory);
return proxyEntityManagerFactory;
}
- private void testGetPersistenceUnitRootUrl(PersistenceUnitInfo info) {
- URL rootUrl = info.getPersistenceUnitRootUrl();
- File topFolder = new File(rootUrl.getFile());
- if (topFolder == null) {
- throw new RuntimeException("couldn't get root file representation of getPersistenceUnitRootUrl");
- }
- File metainfFolder[] = topFolder.listFiles(); // META-INF
- File containedFiles[] = metainfFolder[0].listFiles();
-
- for (File file :containedFiles) {
-
- System.out.println("getPersistenceUnitRootUrl contains " + file.getName());
- if (file.getName().equals("persistence.xml")) {
- System.out.println("success: found persistence.xml");
- return ;
- }
- }
- throw new RuntimeException("failed to find 'persistence.xml' in PersistenceUnitInfo.getPersistenceUnitRootUrl() to verify that it contains 'persistence.xml'");
- }
-
@Override
public ProviderUtil getProviderUtil() {
return null;

0 comments on commit a6c5b43

Please sign in to comment.