Skip to content

Instantly share code, notes, and snippets.

View igor-suhorukov's full-sized avatar

Igor Suhorukov igor-suhorukov

View GitHub Profile
package org.springframework.test.context.junit4.spr16716;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.core.NestedExceptionUtils;
import org.springframework.test.context.junit4.statements.SpringFailOnTimeout;
Document document = DocumentBuilderFactory.newInstance().newInstance().newDocumentBuilder().parse(new File("pom.xml"));
try(QueryProcessor proc = new QueryProcessor("declare variable $mydoc external; $mydoc//node()[text()='Igor Sukhorukov']", context)) {
proc.bind("mydoc", document);
// Execute the query
Value result = proc.value();
// Print result as string.
System.out.println(result);
}
public static void main(String[] args) throws Exception{
CliClient cliClient = new CliClient();
Map<String, MethodCall> connect = cliClient.connect(UUID.randomUUID().toString(), "127.0.0.1", 60001, "org.springframework.boot.*");
Set<Map.Entry<String, MethodCall>> entries = connect.entrySet();
for(Map.Entry<String, MethodCall> entry : entries){
if(entry.getKey().endsWith("<init>") ||
entry.getKey().endsWith("<clinit>")) continue;
String diagram = SdEditDataRenderer.getSequenceDiagram(entry.getValue());
if(diagram.split("\n").length>100){
System.out.println("diagram too large "+entry.getKey());