
org.jnario.spec.jvmmodel.SpecExecutableProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jnario.standalone Show documentation
Show all versions of org.jnario.standalone Show documentation
The required libraries to execute Jnario specifications without Eclipse.
The newest version!
package org.jnario.spec.jvmmodel;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Lists.newArrayList;
import java.util.List;
import org.jnario.Executable;
import org.jnario.jvmmodel.ExecutableProvider;
public class SpecExecutableProvider implements ExecutableProvider {
public List getExecutables(Executable executable) {
List result = newArrayList();
addExecutables(result, executable);
return result;
}
private void addExecutables(List result, Executable executable) {
Iterable children = getChildren(executable);
for (Executable child : children) {
result.add(child);
addExecutables(result, child);
}
}
private Iterable getChildren(Executable specification) {
return filter(specification.eContents(), Executable.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy