public void testPut() {

		Client client = new ClientImpl(TEST_HOST, TEST_PORT);
		long jobId = client.put(65536, 0, 120, "testPut".getBytes());
		assertTrue(jobId > 0);
		client.delete(jobId);

		// invalid priority
		try {
			jobId = client.put(-1, 0, 120, "testPutNegativePriority".getBytes());
			client.delete(jobId);
			fail("no BAD_FORMAT thrown");
		} catch (BeanstalkException be) {
			assertEquals("BAD_FORMAT", be.getMessage());
		} catch (Exception e) {
			fail(e.getMessage());
		}

		// invalid priority
		try {
			jobId = client.put(Long.MAX_VALUE, 0, 120, "testPutHugePriority".getBytes());
			client.delete(jobId);
			fail("no UNKNOWN_COMMAND thrown");
		} catch (BeanstalkException be) {
			assertEquals("invalid priority", be.getMessage());
		} catch (Exception e) {
			fail(e.getMessage());
		}

		// null data
		try {
			jobId = client.put(65536, 0, 120, null);
			client.delete(jobId);
			fail("no exception");
		} catch (BeanstalkException be) {
			assertEquals("null data", be.getMessage());
		} catch (Exception e) {
			fail(e.getMessage());
		}
	}