aboutsummaryrefslogtreecommitdiffstats
path: root/core/core_test.go
diff options
context:
space:
mode:
authorRastislav Szabo <raszabo@cisco.com>2017-05-25 13:47:43 +0200
committerRastislav Szabo <raszabo@cisco.com>2017-05-25 13:54:13 +0200
commit2d07847237e754d9050f06f565baa430c70ed937 (patch)
tree80588aeec912e95fa21b51520bbd527eb87f455b /core/core_test.go
parentc38cb25d746736f062ee16e87f553c8a4ec5fced (diff)
added async connect API, new structure of examples
Change-Id: Iab9bce174596c30998981e02b7030c248c423384 Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Diffstat (limited to 'core/core_test.go')
-rw-r--r--core/core_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/core_test.go b/core/core_test.go
index d3c2e2c..3184ef5 100644
--- a/core/core_test.go
+++ b/core/core_test.go
@@ -145,6 +145,7 @@ func TestNotifications(t *testing.T) {
}
func TestNilConnection(t *testing.T) {
+ RegisterTestingT(t)
var conn *Connection
ch, err := conn.NewAPIChannel()
@@ -168,6 +169,21 @@ func TestDoubleConnection(t *testing.T) {
Expect(conn).Should(BeNil())
}
+func TestAsyncConnection(t *testing.T) {
+ ctx := setupTest(t)
+ defer ctx.teardownTest()
+
+ ctx.conn.Disconnect()
+ conn, ch, err := AsyncConnect(ctx.mockVpp)
+ ctx.conn = conn
+
+ Expect(err).ShouldNot(HaveOccurred())
+ Expect(conn).ShouldNot(BeNil())
+
+ ev := <-ch
+ Expect(ev.State).Should(BeEquivalentTo(Connected))
+}
+
func TestFullBuffer(t *testing.T) {
ctx := setupTest(t)
defer ctx.teardownTest()