@Test public void properties() { String version = System.getProperty("java.version"); Assume.assumeNotNull(version); AsakusaProject project = provider.newInstance("testing"); assertThat(project.property("java.version"), is(version)); }
public AsakusaProject newInstance(String name) { if (active.get() == false) { throw new IllegalStateException("provider has not been yet initialized"); } Path base; try { base = temporary.newFolder().toPath(); } catch (IOException e) { throw new IllegalStateException(e); } AtomicInteger counter = new AtomicInteger(); Path project = folder(base, name); Path home = base.resolve(String.format("%s-fw", name)); Supplier<Path> temporaries = () -> folder(base, String.format("%s-tmp%d", name, counter.incrementAndGet())); AsakusaProject result = new AsakusaProject(project, home, temporaries); projectConfigurators.forEach(result::with); result.with(EnvironmentConfigurator.of("ASAKUSA_HOME", home)); return result; }
AsakusaProjectProvider implements TestRule { public AsakusaProject newInstance(String name) { if (active.get() == false) { throw new IllegalStateException("provider has not been yet initialized"); } Path base; try { base = temporary.newFolder().toPath(); } catch (IOException e) { throw new IllegalStateException(e); } AtomicInteger counter = new AtomicInteger(); Path project = folder(base, name); Path home = base.resolve(String.format("%s-fw", name)); Supplier<Path> temporaries = () -> folder(base, String.format("%s-tmp%d", name, counter.incrementAndGet())); AsakusaProject result = new AsakusaProject(project, home, temporaries); projectConfigurators.forEach(result::with); result.with(EnvironmentConfigurator.of("ASAKUSA_HOME", home)); return result; } }
AsakusaProjectProvider implements TestRule { public AsakusaProject newInstance(String name) { if (active.get() == false) { throw new IllegalStateException("provider has not been yet initialized"); } Path base; try { base = temporary.newFolder().toPath(); } catch (IOException e) { throw new IllegalStateException(e); } AtomicInteger counter = new AtomicInteger(); Path project = folder(base, name); Path home = base.resolve(String.format("%s-fw", name)); Supplier<Path> temporaries = () -> folder(base, String.format("%s-tmp%d", name, counter.incrementAndGet())); AsakusaProject result = new AsakusaProject(project, home, temporaries); projectConfigurators.forEach(result::with); result.with(EnvironmentConfigurator.of("ASAKUSA_HOME", home)); return result; }  }
AsakusaProjectProvider implements TestRule { public AsakusaProject newInstance(String name) { if (active.get() == false) { throw new IllegalStateException("provider has not been yet initialized"); } Path base; try { base = temporary.newFolder().toPath(); } catch (IOException e) { throw new IllegalStateException(e); } AtomicInteger counter = new AtomicInteger(); Path project = folder(base, name); Path home = base.resolve(String.format("%s-fw", name)); Supplier<Path> temporaries = () -> folder(base, String.format("%s-tmp%d", name, counter.incrementAndGet())); AsakusaProject result = new AsakusaProject(project, home, temporaries); projectConfigurators.forEach(result::with); result.with(EnvironmentConfigurator.of("ASAKUSA_HOME", home)); return result; }  @Override Statement apply(Statement base, Description description); AsakusaProjectProvider withProvider(Consumer<? super AsakusaProjectProvider> configurator); AsakusaProjectProvider withProject(Consumer<? super AsakusaProject> configurator); AsakusaProject newInstance(String name); }
AsakusaProjectProvider implements TestRule { public AsakusaProject newInstance(String name) { if (active.get() == false) { throw new IllegalStateException("provider has not been yet initialized"); } Path base; try { base = temporary.newFolder().toPath(); } catch (IOException e) { throw new IllegalStateException(e); } AtomicInteger counter = new AtomicInteger(); Path project = folder(base, name); Path home = base.resolve(String.format("%s-fw", name)); Supplier<Path> temporaries = () -> folder(base, String.format("%s-tmp%d", name, counter.incrementAndGet())); AsakusaProject result = new AsakusaProject(project, home, temporaries); projectConfigurators.forEach(result::with); result.with(EnvironmentConfigurator.of("ASAKUSA_HOME", home)); return result; }  @Override Statement apply(Statement base, Description description); AsakusaProjectProvider withProvider(Consumer<? super AsakusaProjectProvider> configurator); AsakusaProjectProvider withProject(Consumer<? super AsakusaProject> configurator); AsakusaProject newInstance(String name); static final String PATH_PROPERTIES; }