(t *testing.T)
| 179 | } |
| 180 | |
| 181 | func TestQueueRecvChan(t *testing.T) { |
| 182 | s := RunDefaultServer() |
| 183 | defer s.Shutdown() |
| 184 | |
| 185 | ec := NewEConn(t) |
| 186 | defer ec.Close() |
| 187 | |
| 188 | numSent := int32(22) |
| 189 | ch := make(chan int32) |
| 190 | |
| 191 | if _, err := ec.BindRecvQueueChan("foo", "bar", ch); err != nil { |
| 192 | t.Fatalf("Failed to bind to a queue receive channel: %v\n", err) |
| 193 | } |
| 194 | |
| 195 | ec.Publish("foo", numSent) |
| 196 | |
| 197 | // Receive from 'foo' |
| 198 | select { |
| 199 | case num := <-ch: |
| 200 | if num != numSent { |
| 201 | t.Fatalf("Failed to receive correct value: %d vs %d\n", num, numSent) |
| 202 | } |
| 203 | case <-time.After(1 * time.Second): |
| 204 | t.Fatalf("Failed to receive a value, timed-out\n") |
| 205 | } |
| 206 | close(ch) |
| 207 | } |
| 208 | |
| 209 | func TestDecoderErrRecvChan(t *testing.T) { |
| 210 | s := RunDefaultServer() |
nothing calls this directly
no test coverage detected