2. About me
•Hendrik Ebbers
•Lead of development at SIC GmbH in
Dortmund, Germany
•Lead of JUG Dortmund
@hendrikEbbers
www.guigarage.com
hendrik.ebbers@web.de
19. Builder API
VagrantVmConfig vmConfig = new VagrantVmConfigBuilder()
! ! ! ! .withLucid32Box()
! ! ! ! .withName("myLittleVm") builder API for VM
! ! ! ! .withHostOnlyIp("192.168.50.4")
! ! ! ! .build();
also builder API
VagrantEnvironment environment = ...; available
environment.up(); mana ge VM lifecycle
! ! !
environment.getVm(0).createConnection().execute("touch /tmp1");
environment.destroy(); ssh connection
20. JUnit support
@Test wh at if host not
public void testJdbc() { reachable?
dbHandler = new MySql(ip, db, user, pwd);
dbHandler.createMyTable(); what if table
already exists?
dbHandler.insertRow();
assertEquals(1, dbHandler.getRowCount());
dbHandler.close(); parallel proces
ses?
}
21. JUnit support
JUnit annotation manage VM lifecycle
@Rule
public VagrantTestRule testRule =
new VagrantTestRule(createConfig());
public static VagrantConfiguration createConfig() {
//Configure VM with MySQL-Server & static ip
} use builder API for VM spec
ification
create VM start VM run UnitTest destroy VM
22. Vagrant-Binding
fork me
on github
https://github.com/guigarage/vagrant-binding
23. Thanks
for
watching
@hendrikEbbers
www.guigarage.com
hendrik.ebbers@web.de