Skip to content

Commit

Permalink
LPS-47199 Namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Jul 27, 2015
1 parent feea887 commit a747968
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions util-java/test/unit/com/liferay/util/dao/orm/CustomSQLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ public class CustomSQLTest {

@BeforeClass
public static void setUpClass() throws Exception {
Field pacl = ReflectionUtil.getDeclaredField(DataAccess.class, "_pacl");
Field paclField = ReflectionUtil.getDeclaredField(
DataAccess.class, "_pacl");

_pacl = (DataAccess.PACL)pacl.get(null);
_pacl = (DataAccess.PACL)paclField.get(null);

pacl.set(
paclField.set(
null,
ProxyUtil.newProxyInstance(
ClassLoader.getSystemClassLoader(),
Expand Down Expand Up @@ -86,12 +87,12 @@ public Object invoke(

}));

Field portal = ReflectionUtil.getDeclaredField(
Field portalField = ReflectionUtil.getDeclaredField(
PortalUtil.class, "_portal");

_portal = (Portal)portal.get(null);
_portal = (Portal)portalField.get(null);

portal.set(
portalField.set(
null,
ProxyUtil.newProxyInstance(
ClassLoader.getSystemClassLoader(),
Expand All @@ -108,12 +109,12 @@ public Object invoke(

}));

Field props = ReflectionUtil.getDeclaredField(
Field propsField = ReflectionUtil.getDeclaredField(
PropsUtil.class, "_props");

_props = (Props)props.get(null);
_props = (Props)propsField.get(null);

props.set(
propsField.set(
null,
ProxyUtil.newProxyInstance(
ClassLoader.getSystemClassLoader(),
Expand All @@ -133,19 +134,20 @@ public Object invoke(

@AfterClass
public static void tearDownClass() throws Exception {
Field pacl = ReflectionUtil.getDeclaredField(DataAccess.class, "_pacl");
Field paclField = ReflectionUtil.getDeclaredField(
DataAccess.class, "_pacl");

pacl.set(null, _pacl);
paclField.set(null, _pacl);

Field portal = ReflectionUtil.getDeclaredField(
Field portalField = ReflectionUtil.getDeclaredField(
PortalUtil.class, "_portal");

portal.set(null, _portal);
portalField.set(null, _portal);

Field props = ReflectionUtil.getDeclaredField(
Field propsField = ReflectionUtil.getDeclaredField(
PropsUtil.class, "_props");

props.set(null, _props);
propsField.set(null, _props);
}

@Before
Expand Down

0 comments on commit a747968

Please sign in to comment.