public synchronized boolean isEmpty() { return project.getProperties().isEmpty(); }
public synchronized int size() { return project.getProperties().size(); }
public Collection values() { return project.getProperties().values(); }
public synchronized Enumeration keys() { return project.getProperties().keys(); }
public Set keySet() { return project.getProperties().keySet(); }
public synchronized Enumeration elements() { return project.getProperties().elements(); }
public synchronized Object clone() { return project.getProperties().clone(); }
public synchronized boolean containsKey(Object key) { return project.getProperties().containsKey(key); }
public synchronized Object get(Object key) { return project.getProperties().get(key); }
public Set entrySet() { return project.getProperties().entrySet(); }
public boolean containsValue(Object value) { return project.getProperties().containsValue(value); }
public synchronized int hashCode() { return project.getProperties().hashCode(); }
public synchronized boolean equals(Object o) { return project.getProperties().equals(o); }
public synchronized boolean contains(Object value) { return project.getProperties().contains(value); }
public synchronized String toString() { return project.getProperties().toString(); }
private void configure(StandardServiceRegistryBuilder registryBuilder) throws IOException { if ( configurationFile != null ) { registryBuilder.configure( configurationFile ); } Properties properties = new Properties(); if ( propertiesFile == null ) { properties.putAll( getProject().getProperties() ); } else { properties.load( new FileInputStream( propertiesFile ) ); } registryBuilder.applySettings( properties ); }
private void configure(StandardServiceRegistryBuilder registryBuilder) throws IOException { if ( configurationFile != null ) { registryBuilder.configure( configurationFile ); } Properties properties = new Properties(); if ( propertiesFile == null ) { properties.putAll( getProject().getProperties() ); } else { try (FileInputStream fip = new FileInputStream( propertiesFile )){ properties.load( fip ); } } registryBuilder.applySettings( properties ); }
private Map<String, Object> getEffectiveProperties() { final Project prj = getProject(); final Map<String, Object> result = prj == null ? getAllSystemProperties() : prj.getProperties(); //quick & dirty, to make nested mapped p-sets work: for (PropertySet set : setRefs) { result.putAll(set.getPropertyMap()); } return result; }
public void execute(Map vars) throws BuildException { if (scriptFile != null) { ensureJythonOpsExists(); jythonOps.execute(scriptFile, vars); } if (script.trim().length() > 0) { ensureJythonOpsExists(); String finalScript = ProjectHelper.replaceProperties( project, script, project.getProperties()); jythonOps.execute(finalScript, vars); } }
@Test public final void testFailureProperty() throws IOException { final CheckstyleAntTask antTask = new CheckstyleAntTask(); antTask.setConfig(getPath(CONFIG_FILE)); antTask.setFile(new File(getPath(VIOLATED_INPUT))); final Project project = new Project(); final String failurePropertyName = "myProperty"; project.setProperty(failurePropertyName, FAILURE_PROPERTY_VALUE); antTask.setProject(project); antTask.setFailureProperty(failurePropertyName); try { antTask.execute(); fail("Exception is expected"); } catch (BuildException ignored) { final Map<String, Object> hashtable = project.getProperties(); final Object propertyValue = hashtable.get(failurePropertyName); assertEquals("Number of errors is unexpected", "Got 2 errors and 0 warnings.", propertyValue); } }