コード例 #1
0
ファイル: ketchup_suite_test.go プロジェクト: vito/auction
		clusterInfo.Members = append(clusterInfo.Members, &yagnats.ConnectionInfo{
			Addr: addr,
		})
	}

	err := natsClient.Connect(clusterInfo)
	Ω(err).ShouldNot(HaveOccurred())

	client = repnatsclient.New(natsClient, timeout)

	if auctioneerMode == "inprocess" {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.Auction(client, auctionRequest)
		}
	} else if auctioneerMode == "remote" {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.RemoteAuction(natsClient, auctionRequest)
		}
	} else {
		panic("wat?")
	}
})

var _ = BeforeEach(func() {
	for _, guid := range guids {
		client.Reset(guid)
	}

	util.ResetGuids()
})
コード例 #2
0
ファイル: auction_suite_test.go プロジェクト: vito/auction
	rules = auctioneer.DefaultRules

	sessionsToTerminate = []*gexec.Session{}

	natsRunner.Start()
	client, guids = buildClient(numReps, repResources)

	if auctioneerMode == InProcess {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.Auction(client, auctionRequest)
		}
	} else if auctioneerMode == RemoteAuction {
		startAuctioneers(numAuctioneers)
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.RemoteAuction(natsRunner.MessageBus, auctionRequest)
		}
	} else {
		panic("wat?")
	}
})

var _ = BeforeEach(func() {
	for _, guid := range guids {
		client.Reset(guid)
	}

	util.ResetGuids()
})

var _ = AfterSuite(func() {