Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.jboss.qa.jenkins.jobs.quickstarts;
- import static org.jboss.qa.phaser.ExceptionHandling.Execution.IMMEDIATELY_STOP;
- import static org.jboss.qa.phaser.ExceptionHandling.Report.THROW_AT_END;
- import static org.junit.Assert.assertEquals;
- import org.jboss.qa.jcontainer.fuse.FuseClient;
- import org.jboss.qa.jenkins.test.executor.beans.Destination;
- import org.jboss.qa.jenkins.test.executor.phase.staticconfiguration.StaticConfiguration;
- import org.jboss.qa.jenkins.test.executor.utils.MavenCli;
- import org.jboss.qa.jenkins.utils.JobUtils;
- import org.jboss.qa.jenkins.utils.wrappers.ClientWrapper;
- import org.jboss.qa.phaser.Create;
- import org.jboss.qa.phaser.Inject;
- import org.jboss.qa.phaser.OnException;
- import java.io.File;
- import lombok.extern.slf4j.Slf4j;
- @Slf4j
- public abstract class QuickstartBase {
- protected File quickstartDir;
- protected final static int STATIC_CONFIG_CREATE_SQDIR = 1;
- protected final static int STATIC_CONFIG_BEFORE_QS_BUILD = 2;
- protected final static int STATIC_CONFIG_QA_BUILD = 3;
- @Inject(id = "container-home")
- protected Destination fuseHome;
- @Inject
- protected ClientWrapper clientWrapper;
- protected FuseClient getClient() {
- return (FuseClient) clientWrapper.getClient();
- }
- @StaticConfiguration(download = "container", order = STATIC_CONFIG_CREATE_SQDIR)
- public void createQuickstartDirs() throws Exception {
- quickstartDir = new File(fuseHome.getDestination(), getRelativeQuickstartHomePath());
- }
- @StaticConfiguration(download = "container", order = STATIC_CONFIG_QA_BUILD)
- @OnException(execution = IMMEDIATELY_STOP, report = THROW_AT_END)
- public void buildQuickstart(@Create MavenCli.Builder builder) throws Exception {
- JobUtils.initMavenBuilder(builder, new File(quickstartDir, "pom.xml")).goals("clean", "install");
- final int exitCode = builder.build().run();
- assertEquals("Quickstart was not built", 0, exitCode);
- }
- protected abstract String getRelativeQuickstartHomePath();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement