Package org.eluder.coveralls.maven.plugin.domain

Examples of org.eluder.coveralls.maven.plugin.domain.Job


            return;
        }
       
        try {
            createEnvironment().setup();
            Job job = createJob();
            job.validate().throwOrInform(getLog());
            SourceLoader sourceLoader = createSourceLoader(job);
            List<CoverageParser> parsers = createCoverageParsers(sourceLoader);
            JsonWriter writer = createJsonWriter(job);
            CoverallsClient client = createCoverallsClient();
            List<Logger> reporters = new ArrayList<Logger>();
            reporters.add(new JobLogger(job));
            SourceCallback sourceCallback = createSourceCallbackChain(writer, reporters);
            reporters.add(new DryRunLogger(job.isDryRun(), writer.getCoverallsFile()));
           
            report(reporters, Position.BEFORE);
            writeCoveralls(writer, sourceLoader, sourceCallback, parsers);
            report(reporters, Position.AFTER);
           
            if (!job.isDryRun()) {
                submitData(client, writer.getCoverallsFile());
            }
        } catch (ProcessingException ex) {
            throw new MojoFailureException("Processing of input or output data failed", ex);
        } catch (IOException ex) {
View Full Code Here


     * @return job that describes the coveralls report
     * @throws IOException if an I/O error occurs
     */
    protected Job createJob() throws IOException {
        Git git = new GitRepository(project.getBasedir()).load();
        return new Job()
            .withRepoToken(repoToken)
            .withServiceName(serviceName)
            .withServiceJobId(serviceJobId)
            .withServiceBuildNumber(serviceBuildNumber)
            .withServiceBuildUrl(serviceBuildUrl)
View Full Code Here

    }
   
    @Test
    @SuppressWarnings("resource")
    public void testGetJob() throws Exception {
        Job job = job();
        assertSame(job, new JsonWriter(job, file).getJob());
    }
View Full Code Here

    }
   
    @Test
    @SuppressWarnings("resource")
    public void testGetCoverallsFile() throws Exception {
        Job job = job();
        assertSame(file, new JsonWriter(job, file).getCoverallsFile());
       
    }
View Full Code Here

    private Job job() {
        Git.Head head = new Git.Head("aefg837fge", "john", "john@mail.com", "john", "john@mail.com", "test commit");
        Git.Remote remote = new Git.Remote("origin", "git@git.com:foo.git");
        Properties environment = new Properties();
        environment.setProperty("custom_property", "foobar");
        return new Job()
            .withServiceName("service")
            .withServiceJobId("job123")
            .withServiceBuildNumber("build5")
            .withServiceBuildUrl("http://ci.com/build5")
            .withServiceEnvironment(environment)
View Full Code Here

        new JobValidator(null);
    }
   
    @Test
    public void testValidateWithoutRepoTokenOrTravis() {
        ValidationErrors errors = new JobValidator(new Job()).validate();
        assertThat(errors, hasSize(1));
        assertThat(errors.get(0).getLevel(), is(Level.ERROR));
    }
View Full Code Here

        assertThat(errors.get(0).getLevel(), is(Level.ERROR));
    }
   
    @Test
    public void testValidateWithoutRepoTokenOrTravisForDryRun() {
        ValidationErrors errors = new JobValidator(new Job().withDryRun(true)).validate();
        assertThat(errors, hasSize(1));
        assertThat(errors.get(0).getLevel(), is(Level.WARN));
    }
View Full Code Here

        assertThat(errors.get(0).getLevel(), is(Level.WARN));
    }
   
    @Test
    public void testValidateWithInvalidTravis() {
        ValidationErrors errors = new JobValidator(new Job().withServiceName("travis-ci")).validate();
        assertThat(errors, hasSize(1));
        assertThat(errors.get(0).getLevel(), is(Level.ERROR));
    }
View Full Code Here

        assertThat(errors.get(0).getLevel(), is(Level.ERROR));
    }
   
    @Test
    public void testValidateWithRepoToken() {
        ValidationErrors errors = new JobValidator(new Job().withRepoToken("ad3fg5")).validate();
        assertThat(errors, is(empty()));
    }
View Full Code Here

        assertThat(errors, is(empty()));
    }
   
    @Test
    public void testValidateWithTravis() {
        ValidationErrors errors = new JobValidator(new Job().withServiceName("travis-ci").withServiceJobId("123")).validate();
        assertThat(errors, is(empty()));
    }
View Full Code Here

TOP

Related Classes of org.eluder.coveralls.maven.plugin.domain.Job

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.