use of com.buschmais.jqassistant.plugin.java.api.model.VariableDescriptor in project jqa-java-plugin by buschmais.
the class PojoIT method variables.
@Test
public void variables() throws IOException {
scanClasses(Pojo.class);
store.beginTransaction();
List<VariableDescriptor> variables = query("MATCH (:Java:Method{name:'equals'})-[:DECLARES]->(v:Java:Variable) return v").getColumn("v");
assertThat(variables.size(), equalTo(2));
Map<String, VariableDescriptor> map = new HashMap<>();
for (VariableDescriptor variable : variables) {
map.put(variable.getName(), variable);
}
VariableDescriptor o = map.get("o");
assertThat(o, notNullValue());
assertThat(o.getSignature(), equalTo(Object.class.getName() + " o"));
assertThat(o.getType(), typeDescriptor(Object.class));
VariableDescriptor pojo = map.get("pojo");
assertThat(pojo, notNullValue());
assertThat(pojo.getSignature(), equalTo(Pojo.class.getName() + " pojo"));
assertThat(pojo.getType(), typeDescriptor(Pojo.class));
store.commitTransaction();
}
Aggregations