Package org.sonar.api.utils.command

Examples of org.sonar.api.utils.command.StreamConsumer.consumeLine()


      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame.xml"), "UTF-8");
        for (String line : lines) {
          outConsumer.consumeLine(line);
        }
        return 0;
      }
    });
View Full Code Here


      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame-with-anonymous-commit.xml"), "UTF-8");
        for (String line : lines) {
          outConsumer.consumeLine(line);
        }
        return 0;
      }
    });
View Full Code Here

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame-with-merge-history.xml"), "UTF-8");
        for (String line : lines) {
          outConsumer.consumeLine(line);
        }
        return 0;
      }
    });
View Full Code Here

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        List<String> lines = IOUtils.readLines(getClass().getResourceAsStream("/blame-with-uncomitted-changes.xml"), "UTF-8");
        for (String line : lines) {
          outConsumer.consumeLine(line);
        }
        return 0;
      }
    });
View Full Code Here

    when(commandExecutor.execute(any(Command.class), any(StreamConsumer.class), any(StreamConsumer.class), anyLong())).thenAnswer(new Answer<Integer>() {

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer errConsumer = (StreamConsumer) invocation.getArguments()[2];
        errConsumer.consumeLine("My error");
        return 1;
      }
    });

    thrown.expect(IllegalStateException.class);
View Full Code Here

    when(commandExecutor.execute(any(Command.class), any(StreamConsumer.class), any(StreamConsumer.class), anyLong())).thenAnswer(new Answer<Integer>() {

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
        outConsumer.consumeLine("author Simon Brandhof");
        outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("author-time 1312534171");
        outConsumer.consumeLine("author-tz +0200");
        outConsumer.consumeLine("committer Simon Brandhof");
View Full Code Here

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
        outConsumer.consumeLine("author Simon Brandhof");
        outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("author-time 1312534171");
        outConsumer.consumeLine("author-tz +0200");
        outConsumer.consumeLine("committer Simon Brandhof");
        outConsumer.consumeLine("committer-mail <simon.brandhof@gmail.com>");
View Full Code Here

      @Override
      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
        outConsumer.consumeLine("author Simon Brandhof");
        outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("author-time 1312534171");
        outConsumer.consumeLine("author-tz +0200");
        outConsumer.consumeLine("committer Simon Brandhof");
        outConsumer.consumeLine("committer-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("committer-time 1312534171");
View Full Code Here

      public Integer answer(InvocationOnMock invocation) throws Throwable {
        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
        outConsumer.consumeLine("author Simon Brandhof");
        outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("author-time 1312534171");
        outConsumer.consumeLine("author-tz +0200");
        outConsumer.consumeLine("committer Simon Brandhof");
        outConsumer.consumeLine("committer-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("committer-time 1312534171");
        outConsumer.consumeLine("committer-tz +0200");
View Full Code Here

        StreamConsumer outConsumer = (StreamConsumer) invocation.getArguments()[1];
        outConsumer.consumeLine("2c68c473da7fc293e12ca50f19380c5118be7ead 68 54 1");
        outConsumer.consumeLine("author Simon Brandhof");
        outConsumer.consumeLine("author-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("author-time 1312534171");
        outConsumer.consumeLine("author-tz +0200");
        outConsumer.consumeLine("committer Simon Brandhof");
        outConsumer.consumeLine("committer-mail <simon.brandhof@gmail.com>");
        outConsumer.consumeLine("committer-time 1312534171");
        outConsumer.consumeLine("committer-tz +0200");
        outConsumer.consumeLine("summary Move to nexus.codehaus.org + configuration of maven release plugin is back");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.