@@ -0,0 +1,1374 @@
+package org.sagebionetworks.profiler;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0Aimport static org.junit.Assert.assertNotNull;%0D%0A%0D%0Aimport java.io.IOException;%0D%0A%0D%0Aimport org.codehaus.jackson.JsonGenerationException;%0D%0Aimport org.codehaus.jackson.map.JsonMappingException;%0D%0Aimport org.json.JSONException;%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0A%0D%0A/**%0D%0A * Test for Frame.%0D%0A *%0D%0A */%0D%0Apublic class FrameTest %7B%0D%0A%09%0D%0A%09Frame root = null;%0D%0A%09%0D%0A%09@Before%0D%0A%09public void before()%7B%0D%0A%09%09// Create a frame that is a few levels deep%0D%0A%09%09root = new Frame(0, %22root%22);%0D%0A%09%09root.setEnd(12);%0D%0A%09%09// Add some children%0D%0A%09%09for(int i=0; i%3C4; i++)%7B%0D%0A%09%09%09Frame child = new Frame(i, %22child%22+1);%0D%0A%09%09%09child.setEnd(i+1);%0D%0A%09%09%09root.addChild(child);%0D%0A%09%09%09// Add one more level%0D%0A%09%09%09for(int j=0; j%3C2; j++)%7B%0D%0A%09%09%09%09Frame grand = new Frame(i, %22grand%22+j);%0D%0A%09%09%09%09grand.setEnd(i);%0D%0A%09%09%09%09child.addChild(grand);%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * @throws JSONException %0D%0A%09 * @throws IOException %0D%0A%09 * @throws JsonMappingException %0D%0A%09 * @throws JsonGenerationException %0D%0A%09 * %0D%0A%09 */%0D%0A%09@Test%0D%0A%09public void testJSONRoundTrip() throws JSONException %7B%0D%0A%09%09// Write it to json%0D%0A%09%09String json = Frame.writeFrameJSON(root);%0D%0A%09%09assertNotNull(json);%0D%0A%09%09System.out.println(json);%0D%0A%09%09// Now convert back to Frames%0D%0A%09%09Frame cloneRoot = Frame.readFrameFromJSON(json);%0D%0A%09%09assertNotNull(cloneRoot);%0D%0A%09%09assertEquals(root, cloneRoot);%0D%0A%09%7D%0D%0A%7D%0D%0A

Move the unit tests of the profiler package to logging