Created
October 19, 2016 08:31
-
-
Save flying3615/af265cb53e8aae96d51a18a328ca3aa1 to your computer and use it in GitHub Desktop.
create junit test for Timing code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Java_FP.Timing; | |
import java.util.concurrent.atomic.AtomicReference; | |
/** | |
* Created by liuyufei on 19/10/16. | |
*/ | |
public class TimingTest { | |
@org.junit.Test | |
public void testTimed() throws Exception { | |
final String description = "Supply carrot"; | |
AtomicReference<String> output = new AtomicReference<>(); | |
Timing.timed(description,output::set,()->"carrot"); | |
assert(output.get().contains(description)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment