(t *testing.T)
| 195 | } |
| 196 | |
| 197 | func TestHashPartitionerMinInt32(t *testing.T) { |
| 198 | partitioner := NewHashPartitioner("mytopic") |
| 199 | |
| 200 | msg := ProducerMessage{} |
| 201 | // "1468509572224" generates 2147483648 (uint32) result from Sum32 function |
| 202 | // which is -2147483648 or int32's min value |
| 203 | msg.Key = StringEncoder("1468509572224") |
| 204 | |
| 205 | choice, err := partitioner.Partition(&msg, 50) |
| 206 | if err != nil { |
| 207 | t.Error(partitioner, err) |
| 208 | } |
| 209 | if choice < 0 || choice >= 50 { |
| 210 | t.Error("Returned partition", choice, "outside of range for nil key.") |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func TestConsistentCRCHashPartitioner(t *testing.T) { |
| 215 | numPartitions := int32(100) |
nothing calls this directly
no test coverage detected