Files
gerrit/gerrit-acceptance-tests
David Ostrovsky feb5e7e98a Acceptance tests framework: Allow tests to change Gerrit configuration
Tests may want to contribute to the Gerrit configuration. Each method in
the test class should be able to add or override one or more parameters
of the Gerrit server configuration.

  public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {

    @Inject
    @GerritServerConfig
    Config serverConfig;

    @Test
    @GerritConfig(name="x.y", value="z")
    public void testOne() {
      assertEquals("z", serverConfig.getString("x", null, "y"));
    }

    @Test
    @GerritConfigs({
        @GerritConfig(name="x.y", value="z"),
        @GerritConfig(name="a.b", value="c"),
    })
    public void testMultiple() {
      assertEquals("z", serverConfig.getString("x", null, "y"));
      assertEquals("c", serverConfig.getString("a", null, "b"));
    }
  }

Change-Id: I506d9f86280f1b067d2083cb33726009ed72c218
2013-09-18 10:50:20 +02:00
..
2013-07-30 17:18:33 +00:00