{
	"connect": {
	"failure": [
		{
			"description": "Invalid version string - not a string",
			"input": { "version" : 3 }
		},{
			"description": "Invalid version number - not a number",
			"input": { "versionNum" : "MQIsdp" }
		},{
			"description": "Invalid client ID - not a string",
			"input": { "client": [] }
		},{
			"description": "Invalid keepalive - not a number",
			"input": { "keepalive": " " }
		},{
			"description": "Invalid keepalive - < 0",
			"input": { "keepalive": -1 }
		},{
			"description": "Invalid keepalive - > 65535",
			"input": { "keepalive": 70000 }
		}
	]
	},
	"connack": {
		"success": [
		"failure": [
		{
			"description": "Invalid return code - < 0",
			"input": { "returnCode": -1 }
		},{
			"description": "Invalid return code - > 5",
			"input": { "returnCode": 6 }
		}
		]
	},
	"publish": {
		"failure":[
		{
			"description": "Invalid topic - not a string",
			"input": { "topic": [], "payload": "test" }
		},{
			"description": "Invalid topic - empty string",
			"input": { "topic": "", "payload": "test" }
		},{
			"description": "Invalid topic - not present",
			"input": { "payload": "test" }
		},{
			"description": "Invalid payload - not a string",
			"input": { "topic": "test", "payload": [] }
		},{
			"description": "Invalid message ID - < 0",
			"input": { "topic": "test", "payload": "test", "messageId": -1}
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "topic": "test", "payload": "test", "messageId": 70000}
		},{
			"description": "Invalid QoS level - < 0",
			"input": { "topic": "test", "payload": "test", "qos": -1 }
		},{
			"description": "Invalid QoS level - > 2",
			"input": { "topic": "test", "payload": "test", "qos": 3 }
		}
		]
	},
	"puback": {
		"success": [
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid message ID - not defined",
			"input": { }

		}
		]
	},
	"pubrec": {
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid message ID - not defined",
			"input": { }

		}
		]
	},
	"pubrel": {
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid message ID - not defined",
			"input": { }

		}
		]
	},
	"pubcomp": {
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid message ID - not defined",
			"input": { }

		}
		]
	},
	"subscribe": {
		"success": [
		{
			"description": "Subscribe to a single topic without QoS",
			"fixture": [130, 9, 0, 30, 0, 4, 116, 101, 115, 116, 0],
			"input": { "topic": "test", "messageId": 30 }
		},{
			"description": "Subscribe to a single topic with QoS",
			"fixture": [130, 9, 0, 30, 0, 4, 116, 101, 115, 116, 1],
			"input": { "topic": "test", "qos": 1, "messageId": 30 }
		},{
			"description": "Subscribe to a list of topics without QoS",
			"fixture": [130, 16, 0, 30, 0, 4, 116, 101, 115, 116, 0, 0, 4, 116, 115, 101, 116, 0],
			"input": { "subscriptions": [{"topic": "test"}, {"topic": "tset"}], "messageId": 30 }
		},{
			"description": "Subscribe to a list of topics with QoS",
			"fixture": [130, 16, 0, 30, 0, 4, 116, 101, 115, 116, 2, 0, 4, 116, 115, 101, 116, 1],
			"input": { "subscriptions": [{"topic": "test", "qos": 2}, {"topic": "tset", "qos": 1}], "messageId": 30 }
		},{
			"description": "Single topic takes priority over subscription list",
			"fixture": [130, 9, 0, 30, 0, 4, 116, 101, 115, 116, 0],
			"input": { "topic": "test", "messageId": 30, "subscriptions":[{"topic":"a"}] }
		},{
			"description": "Duplicate packet flag set",
			"fixture": [138, 9, 0, 30, 0, 4, 116, 101, 115, 116, 0],
			"input": { "topic": "test", "dup": true, "messageId": 30 }
		},{
			"description": "Subscribe to an array of topics",
			"fixture": [130, 16, 0, 30, 0, 4, 116, 101, 115, 116, 0, 0, 4, 116, 115, 101, 116, 0],
			"input": { "subscriptions": ["test", "tset"], "messageId": 30 }
		}
		],
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid topic - not a string",
			"input": { "topic": [] }
		},{
			"description": "Invalid topic - zero length",
			"input": { "topic": "" }
		},{
			"description": "Invalid QoS - not a number",
			"input": { "topic": "test", "qos": [] }
		},{
			"description": "Invalid QoS - < 0",
			"input": { "topic": "test", "qos": -1 }
		},{
			"description": "Invalid QoS - > 2",
			"input": { "topic": "test", "qos": 3 }
		},{
			"description": "Invalid subscription array - not an array",
			"input": { "subscriptions": "test" }
		},{
			"description": "Invalid subscription array - contains QoS that is not a number",
			"input": { "subscriptions": [ { "topic":"test", "qos": [] }] }
		},{
			"description": "Invalid subscription array - contains topic that is not a string",
			"input": { "subscriptions": [ { "topic":[] } ] }
		}

		]
	},
	"suback": {
		"success": [
		{
			"description": "Suback with supplied granted qos vector",
			"fixture": [144, 5, 0, 30, 0, 1, 2],
			"input": {
				"granted": [0, 1, 2],
				"messageId": 30
			}
		},{
			"description": "Suback with default qos vector ([0])",
			"fixture": [144, 3, 0, 30, 0],
			"input": {
				"messageId": 30
			}
		}
		],
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid QoS vector - not an array",
			"input": { "granted": "test" }
		},{
			"description": "Invalid QoS vector - contains non numbers",
			"input": { "granted": ["a", "b", "c"] }
		},{
			"description": "Invalid QoS vector - contains numbers outside 0 <= x <= 2",
			"input": { "granted": [-1, 0, 1, 2, 3] }
		}
		]
	},
	"unsubscribe": {
		"success": [
		{
			"description": "Unsubscribe with list of unsubscriptions",
			"fixture": [162, 14, 0, 30, 0, 4, 116, 101, 115, 116, 0, 4, 116, 115, 101, 116],
			"input": { "unsubscriptions": ["test", "tset"], "messageId":30}
		},{
			"description": "Unsubscribe with dup flag set",
			"fixture": [170, 8, 0, 30, 0, 4, 116, 101, 115, 116],
			"input": { "unsubscriptions": ["test"], "messageId": 30, "dup": true }
		},{
			"description": "Unsubscribe with a single topic",
			"fixture": [162, 8, 0, 30, 0, 4, 116, 101, 115, 116],
			"input": { "topic": "test", "messageId": 30 }
		},{
			"description": "Single topic takes priority over list",
			"fixture": [162, 8, 0, 30, 0, 4, 116, 101, 115, 116],
			"input": { "topic": "test", "messageId": 30, "unsubscriptions": ["a", "b"] }
		}

		],
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid unsubscription topic - not a string",
			"input": { "topic": [] }
		},{
			"description": "Invalid unsubscription topic - 0 length",
			"input": { "topic": "" }
		},{
			"description": "Invalid unsubscription list - not an array",
			"input": { "unsubscriptions": "test" }
		},{
			"description": "Invalid unsubscription list - contains non strings",
			"input": { "unsubscriptions": [1, 2, 3] }
		},{
			"description": "Invalid unsubscription list - 0 length",
			"input": { "unsubscriptions": [] }
		},{
			"description": "Nothing supplied",
			"input": {}
		}
		]
	},
	"unsuback": {
		"success": [
		{
			"description": "Unsuback with message id",
			"fixture": [176, 2, 0, 30],
			"input": { "messageId": 30 }
		}
		],
		"failure": [
		{
			"description": "Invalid message ID - < 0",
			"input": { "messageId": -1 }
		},{
			"description": "Invalid message ID - > 65535",
			"input": { "messageId": 70000 }
		},{
			"description": "Invalid message ID - not defined",
			"input": {}

		}
		]
	},
}
