Skip to main content
simpatico's user avatar
simpatico's user avatar
simpatico's user avatar
simpatico
  • Member for 1 year, 7 months
  • Last seen more than a week ago
  • Doha, Qatar
About

Author of [dp4j.jar][1], which lets you test access private methods in Java without writing any reflection API code. The necessary reflection code is injected by dp4j at compile-time. So you only write:

@Test
public void aTest(){
  PrivateConstructor pc = new PrivateConstructor("Hello!");

Instead of:

import java.lang.reflect.*;

@Test
public void aTest() throws IllegalAccessException, NoSuchMethodException
, InvocationTargetException, InstantiationException {
    Constructor pcInit = PrivateConstructor.class.getDeclaredConstructor(String.class);
    pcInit.setAccessible(true);
    PrivateConstructor pc = (PrivateConstructor) pcInit.newInstance("Hello!");

Check it out.

Badges
This user doesn’t have any gold badges yet.
This user doesn’t have any silver badges yet.
2
bronze badges
0
Score
4
Posts
80
Posts %
0
Score
3
Posts
60
Posts %
0
Score
2
Posts
40
Posts %
0
Score
1
Posts
20
Posts %
0
Score
1
Posts
20
Posts %
0
Score
1
Posts
20
Posts %
Top posts