233 reputation
411
bio website dp4j.com
location Bolzano, Italy
age
visits member for 3 years, 7 months
seen Dec 24 '11 at 23:43

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


May
14
asked Is there a OS/user-wide log to log to?
May
10
accepted How to copy all html files from a directory tree to a single directory?
May
10
comment How to copy all html files from a directory tree to a single directory?
on the mac I don't have -t but $ find MR -name "*.html" -exec cp ~/debug {} \; prints: "cp: /Users/simpatico/debug is a directory (not copied)." for each html file
May
10
comment How to copy all html files from a directory tree to a single directory?
@lain - did you notice my mac limited cp w/o -t? I actually intend not to copy the structure, so cmd would be ideal if it worked, but writing the cmd w/o -t doesn't do the trick (I still get the usage printed).
May
10
asked How to copy all html files from a directory tree to a single directory?
Apr
12
accepted How do I execute a script later?
Apr
10
answered How do I execute a script later?
Apr
10
asked How do I execute a script later?
Mar
22
awarded  Commentator
Mar
22
comment How can I keep processes running on a remote server even after turning off the terminal machine?
@Faheem: I still don't get it to work. I connect to the remote server through ssh and when I connect back to it from my home through vpn screen ls prints what I pasted in the 1st comment
Mar
21
accepted How can I find and replace with a new line?
Mar
21
awarded  Supporter
Mar
19
awarded  Editor
Mar
19
revised How can I find and replace with a new line?
added 175 characters in body
Mar
19
comment How can I find and replace with a new line?
@lain: this doens't work with \n . Did you try it? the \ disappears while the n is appended. a, b --> an b
Mar
19
comment How can I find and replace with a new line?
@Mrozek: how do I use tr with the input and output file?
Mar
19
awarded  Student
Mar
19
comment How can I keep processes running on a remote server even after turning off the terminal machine?
I execute $ screen -ls on my terminal. Before $ screen -d == $ screen ls, since I had multiple screens. N offense, is there how I could execute the command with some log to prove/track things?
Mar
19
comment How can I keep processes running on a remote server even after turning off the terminal machine?
$ screen -ls No Sockets found in /var/folders/Am/AmQYwuIoFSO0BNhXmOGzQU+++TI/-Tmp-/.screen. But I had detached sessions before turning off my machine, how do I attach to them again now?
Mar
19
asked How can I keep processes running on a remote server even after turning off the terminal machine?