296
reputation
2
7
17

simpatico

Author of dp4j.jar, 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 at www.dp4j.com

2
answers
10
questions
~85k
people reached
  • Bolzano, Italy
  • Member for 8 years, 4 months
  • 31 profile views
  • Last seen Jan 26 at 14:08

Top tags (32)

Score 1
Posts 4
Posts % 33
Score 1
Posts 2
Score 1
Posts 2
Score 1
Posts 2
Score 1
Posts 2
Score 0
Posts 3

Top posts (12) All Questions Answers | Votes Newest

View all questions and answers

Badges (26)

Gold

2

Rarest

Silver

7

Rarest

Bronze

17

Rarest