Add gerrit-acceptance-tests
This change introduces an infrastructure for testing Gerrit daemon via REST and/or SSH protocols. Gerrit daemon is run in the headless mode and in the same JVM where the tests run. Besides using REST/SSH, tests can also access Gerrit server internals to prepare test environment and to perform assertions. A new review site is created for each test and Gerrit daemon is started on that site. When test finished the Gerrit daemon is shutdown. A purpose of this change is to initiate writing of acceptance tests in order to minimize the probability of introducing regressions in Gerrit. The acceptance tests may be expensive to run each time when Gerrit is built. Therefore, they run only during the verify phase. Change-Id: I8c8a0f00f82d3dffc777d5f9ba6d79b8b82a7d81 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2013 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
|
||||
public abstract class AbstractDaemonTest {
|
||||
|
||||
private GerritServer server;
|
||||
|
||||
@Before
|
||||
public final void beforeTest() throws Exception {
|
||||
server = GerritServer.start();
|
||||
server.getTestInjector().injectMembers(this);
|
||||
}
|
||||
|
||||
@After
|
||||
public final void afterTest() throws Exception {
|
||||
server.stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user