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

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


    }

    @Override
    public Iterable<? extends FileDescriptor> scan(InputStream item, String path, Scope scope, Scanner scanner) throws IOException {
        Store store = getStore();
        PropertyFileDescriptor propertyFileDescriptor = store.create(PropertyFileDescriptor.class);
        Properties properties = new Properties();
        properties.load(item);
        for (String name : properties.stringPropertyNames()) {
            String value = properties.getProperty(name);
            PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
            propertyDescriptor.setName(name);
            propertyDescriptor.setValue(value);
            propertyFileDescriptor.getProperties().add(propertyDescriptor);
        }
        propertyFileDescriptor.setFileName(path);
        return asList(propertyFileDescriptor);
    }
View Full Code Here


    public void propertyFile() throws IOException {
        scanResource(JavaScope.CLASSPATH, "/META-INF/test.properties");
        store.beginTransaction();
        List<PropertyFileDescriptor> propertyFileDescriptors = query("MATCH (p:Properties:File) RETURN p").getColumn("p");
        assertThat(propertyFileDescriptors.size(), equalTo(1));
        PropertyFileDescriptor propertyFileDescriptor = propertyFileDescriptors.get(0);
        Matcher<? super PropertyDescriptor> valueMatcher = valueDescriptor("foo", equalTo("bar"));
        assertThat(propertyFileDescriptor.getFileName(), endsWith("/META-INF/test.properties"));
        assertThat(propertyFileDescriptor.getProperties(), hasItem(valueMatcher));
        store.commitTransaction();
    }
View Full Code Here

TOP

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

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.