use of powermock.classloading.classes.MyStaticFinalNumberHolder in project powermock by powermock.
the class XStreamClassloaderExecutorTest method clonesStaticFinalNumberFields.
@Test
public void clonesStaticFinalNumberFields() throws Exception {
MockClassLoader classloader = createClassloader();
final MyStaticFinalNumberHolder expected = new MyStaticFinalNumberHolder();
MyStaticFinalNumberHolder actual = new SingleClassloaderExecutor(classloader).execute(new Callable<MyStaticFinalNumberHolder>() {
public MyStaticFinalNumberHolder call() throws Exception {
assertEquals(MockClassLoader.class.getName(), this.getClass().getClassLoader().getClass().getName());
MyStaticFinalNumberHolder actual = new MyStaticFinalNumberHolder();
assertEquals(expected.getMyLong(), actual.getMyLong());
return actual;
}
});
assertFalse(MockClassLoader.class.getName().equals(this.getClass().getClassLoader().getClass().getName()));
assertEquals(expected.getMyLong(), actual.getMyLong());
}
use of powermock.classloading.classes.MyStaticFinalNumberHolder in project powermock by powermock.
the class ObjenesisClassloaderExecutorTest method clonesStaticFinalNumberFields.
@Test
public void clonesStaticFinalNumberFields() throws Exception {
MockClassLoader classloader = createClassloader();
final MyStaticFinalNumberHolder expected = new MyStaticFinalNumberHolder();
MyStaticFinalNumberHolder actual = new SingleClassloaderExecutor(classloader).execute(new Callable<MyStaticFinalNumberHolder>() {
public MyStaticFinalNumberHolder call() throws Exception {
assertEquals(MockClassLoader.class.getName(), this.getClass().getClassLoader().getClass().getName());
MyStaticFinalNumberHolder actual = new MyStaticFinalNumberHolder();
assertEquals(expected.getMyLong(), actual.getMyLong());
return actual;
}
});
assertFalse(MockClassLoader.class.getName().equals(this.getClass().getClassLoader().getClass().getName()));
assertEquals(expected.getMyLong(), actual.getMyLong());
}
Aggregations