Package com.buschmais.jqassistant.plugin.java.api.model

Examples of com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor


    }

    @Override
    public Iterable<? extends FileDescriptor> scan(InputStream stream, String path, Scope scope, Scanner scanner) throws IOException {
        new ClassReader(stream).accept(visitor, 0);
        ClassFileDescriptor classFileDescriptor = visitor.getTypeDescriptor();
        classFileDescriptor.setFileName(path);
        return asList(classFileDescriptor);
    }
View Full Code Here


    public void attributes() throws IOException {
        scanClasses(Pojo.class);
        store.beginTransaction();
        TestResult testResult = query("MATCH (t:Type:Class) WHERE t.fqn =~ '.*Pojo' RETURN t as types");
        assertThat(testResult.getRows().size(), equalTo(1));
        ClassFileDescriptor typeDescriptor = (ClassFileDescriptor) testResult.getRows().get(0).get("types");
        assertThat(typeDescriptor, is(typeDescriptor(Pojo.class)));
        assertThat(typeDescriptor.getFileName(), equalTo("/" + Pojo.class.getName().replace('.', '/') + ".class"));
        assertThat(query("MATCH (t:Type:Class) WHERE t.fqn =~ '.*Pojo' RETURN t.name as name").getColumn("name"), hasItem(equalTo("Pojo")));

        testResult = query("MATCH (t:Type:Class)-[:DECLARES]->(f:Field) RETURN f.signature as signature, f.name as name");
        assertThat(testResult.getColumn("signature"), allOf(hasItem(equalTo("java.lang.String stringValue")), hasItem(equalTo("int intValue"))));
        assertThat(testResult.getColumn("name"), allOf(hasItem(equalTo("stringValue")), hasItem(equalTo("intValue"))));
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.