Search in sources :

Example 6 with CommandLineException

use of com.google.copybara.exception.CommandLineException in project copybara by google.

the class CommandEnvTest method testConfigParsingNoSourceRefButPassed.

@Test
public void testConfigParsingNoSourceRefButPassed() {
    CommandEnv env = new CommandEnv(workdir, options, ImmutableList.of("foo/copy.bara.sky", "wf", "foo"));
    CommandLineException e = assertThrows(CommandLineException.class, () -> env.parseConfigFileArgs(mock(CopybaraCmd.class), /*usesSourceRef=*/
    false));
    assertThat(e).hasMessageThat().contains("Too many arguments for subcommand");
}
Also used : CommandLineException(com.google.copybara.exception.CommandLineException) Test(org.junit.Test)

Aggregations

CommandLineException (com.google.copybara.exception.CommandLineException)6 Path (java.nio.file.Path)4 ImmutableMap (com.google.common.collect.ImmutableMap)2 RepoException (com.google.copybara.exception.RepoException)2 ValidationException (com.google.copybara.exception.ValidationException)2 IOException (java.io.IOException)2 JCommander (com.beust.jcommander.JCommander)1 ParameterException (com.beust.jcommander.ParameterException)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 MoreObjects (com.google.common.base.MoreObjects)1 Preconditions (com.google.common.base.Preconditions)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSetMultimap (com.google.common.collect.ImmutableSetMultimap)1 DestinationStatus (com.google.copybara.Destination.DestinationStatus)1 Writer (com.google.copybara.Destination.Writer)1 MigrationReference (com.google.copybara.Info.MigrationReference)1 LazyResourceLoader.memoized (com.google.copybara.LazyResourceLoader.memoized)1 CommandWithArgs (com.google.copybara.MainArguments.CommandWithArgs)1 Reader (com.google.copybara.Origin.Reader)1 ChangesResponse (com.google.copybara.Origin.Reader.ChangesResponse)1