"code.cloudfoundry.org/rep/repfakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("ActualLRP Lifecycle Handlers", func() {
	var (
		logger               *lagertest.TestLogger
		fakeActualLRPDB      *dbfakes.FakeActualLRPDB
		fakeDesiredLRPDB     *dbfakes.FakeDesiredLRPDB
		fakeAuctioneerClient *auctioneerfakes.FakeClient
		actualHub            *eventfakes.FakeHub
		responseRecorder     *httptest.ResponseRecorder
		handler              *handlers.ActualLRPLifecycleHandler
		exitCh               chan struct{}

		actualLRP      models.ActualLRP
		afterActualLRP models.ActualLRP

		fakeServiceClient    *fake_bbs.FakeServiceClient
		fakeRepClientFactory *repfakes.FakeClientFactory
		fakeRepClient        *repfakes.FakeClient
	)

	BeforeEach(func() {
		fakeActualLRPDB = new(dbfakes.FakeActualLRPDB)
		fakeAuctioneerClient = new(auctioneerfakes.FakeClient)
		fakeDesiredLRPDB = new(dbfakes.FakeDesiredLRPDB)
		logger = lagertest.NewTestLogger("test")
		responseRecorder = httptest.NewRecorder()
예제 #2
0
	"code.cloudfoundry.org/bbs/fake_bbs"
	"code.cloudfoundry.org/bbs/handlers"
	"code.cloudfoundry.org/bbs/models"
	"code.cloudfoundry.org/lager/lagertest"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("Cell Handlers", func() {
	var (
		logger            *lagertest.TestLogger
		responseRecorder  *httptest.ResponseRecorder
		handler           *handlers.CellHandler
		fakeServiceClient *fake_bbs.FakeServiceClient
		exitCh            chan struct{}
		cells             []*models.CellPresence
		cellSet           models.CellSet
	)

	BeforeEach(func() {
		fakeServiceClient = new(fake_bbs.FakeServiceClient)
		logger = lagertest.NewTestLogger("test")
		responseRecorder = httptest.NewRecorder()
		exitCh = make(chan struct{}, 1)
		handler = handlers.NewCellHandler(fakeServiceClient, exitCh)
		cells = []*models.CellPresence{
			{
				CellId:     "cell-1",
				RepAddress: "1.1.1.1",
예제 #3
0
	"code.cloudfoundry.org/bbs/converger"
	"code.cloudfoundry.org/bbs/converger/fake_controllers"
)

const aBit = 100 * time.Millisecond

var _ = Describe("ConvergerProcess", func() {
	var (
		fakeLrpConvergenceController *fake_controllers.FakeLrpConvergenceController
		fakeTaskController           *fake_controllers.FakeTaskController
		fakeBBSServiceClient         *fake_bbs.FakeServiceClient
		logger                       *lagertest.TestLogger
		fakeClock                    *fakeclock.FakeClock
		convergeRepeatInterval       time.Duration
		kickTaskDuration             time.Duration
		expirePendingTaskDuration    time.Duration
		expireCompletedTaskDuration  time.Duration

		process ifrit.Process

		waitEvents chan<- models.CellEvent
		waitErrs   chan<- error
	)

	BeforeEach(func() {
		fakeLrpConvergenceController = new(fake_controllers.FakeLrpConvergenceController)
		fakeTaskController = new(fake_controllers.FakeTaskController)
		fakeBBSServiceClient = new(fake_bbs.FakeServiceClient)
		logger = lagertest.NewTestLogger("test")
		fakeClock = fakeclock.NewFakeClock(time.Now())