runCount++;
}
}
public void testFreshFileTreeWontDestroyLinks() {
CodeGraphResponseImpl response = DtoClientImpls.MockCodeGraphResponseImpl.make();
response.setFreshness(createFreshness("0", "1", "1"));
{
CodeBlock fileBlock = createCodeBlock("0", "/foo.js", CodeBlock.Type.FILE, 0, 0, 10, 0);
CodeBlock foo = createCodeBlock(fileBlock, "1", "foo", CodeBlock.Type.FIELD, 0, 0, 1, 0);
CodeBlock bar = createCodeBlock(fileBlock, "2", "bar", CodeBlock.Type.FIELD, 1, 0, 2, 0);
createCodeBlock(fileBlock, "3", "bar.doThis", CodeBlock.Type.FUNCTION, 1, 10, 2, 0);
TypeAssociation typeLink = createTypeAssociation(fileBlock, foo, fileBlock, bar);
CodeGraphImpl codeGraph = createCodeGraph(fileBlock);
codeGraph.setTypeAssociations(JsoArray.<TypeAssociation>from(typeLink));
response.setFullGraphJson(codeGraph.serialize());
}
{
CodeBlockImpl freshFileBlock = createCodeBlock(
"1", "/foo.js", CodeBlock.Type.FILE, 0, 0, 10, 0);
createCodeBlock(freshFileBlock, "1", "foo", CodeBlock.Type.FIELD, 0, 0, 1, 0);
createCodeBlock(freshFileBlock, "2", "foo.baz", CodeBlock.Type.FIELD, 1, 0, 2, 0);
createCodeBlock(freshFileBlock, "3", "bar", CodeBlock.Type.FIELD, 2, 0, 3, 0);
createCodeBlock(freshFileBlock, "4", "bar.doThis", CodeBlock.Type.FUNCTION, 2, 10, 3, 0);
response.setFileTreeJson(Jso.serialize(freshFileBlock));
}
MockCubeClient cubeClient = MockCubeClient.create();
UpdateReceiver updateListener = new UpdateReceiver();