// for now key-type
func TestNowKeyType() {
	csvmap := golhashmap.GetHashMapEngine("csv")
	golassert.AssertEqual(HttpGet(DelURL(*httphost, *httpport, "tsds", "yname")), "Success")
	golassert.AssertEqual(HttpGet(PutURL(*httphost, *httpport, "now", "yname:last:first", "zodiac")), "Success")
	golassert.AssertEqual(len(csvmap.ToHashMap(HttpGet(GetURL(*httphost, *httpport, "tsds", "yname:last:first")))), 1)
	golassert.AssertEqual(HttpGet(DelURL(*httphost, *httpport, "tsds", "yname")), "Success")

	golassert.AssertEqual(HttpGet(DelURL(*httphost, *httpport, "tsds", "myname")), "Success")
	golassert.AssertEqual(HttpGet(PutURL(*httphost, *httpport, "now", "myname:last:first", "ripper")), "Success")
	golassert.AssertEqual(len(csvmap.ToHashMap(HttpGet(GetURL(*httphost, *httpport, "tsds", "myname:last:first")))), 1)
	golassert.AssertEqual(HttpGet(DelURL(*httphost, *httpport, "tsds", "myname")), "Success")
}
/* transform response by ValType, if none default:csv */
func responseByValType(valType string, response_map golhashmap.HashMap) string {
	var response string

	switch valType {
	case "csv", "json":
		hashmapEngine := golhashmap.GetHashMapEngine(valType)
		response = hashmapEngine.FromHashMap(response_map)

	default:
		response = golhashmap.HashMapToCSV(response_map)
	}
	return response
}
/* formulate dbdata for non-default val-type FOR dbDataFromPacket */
func dbDataForEncodedVal(packet *goshare.Packet) (dbdata string) {
	switch packet.DBAction {
	case "push":
		hmap_engine := golhashmap.GetHashMapEngine(packet.ValType)
		dbdata = hmap_engine.FromHashMap(packet.HashMap)
	case "read", "delete":
		list_engine := gollist.GetListEngine(packet.ValType)
		dbdata = list_engine.FromList(packet.KeyList)
	default:
		//to-be-log
	}
	return dbdata
}
/*
Handles Packet formation: DBData based on ValType for PUSH
*/
func decodeKeyValData(valType string, message_array []string) golhashmap.HashMap {
	var hashmap golhashmap.HashMap
	hashmap = make(golhashmap.HashMap)

	switch valType {
	case "csv", "json":
		multi_value := strings.Join(message_array, "\n")
		hashmapEngine := golhashmap.GetHashMapEngine(valType)
		hashmap = hashmapEngine.ToHashMap(multi_value)

	default:
		key := message_array[0]
		value := strings.Join(message_array[1:], " ")
		hashmap[key] = value
	}
	return hashmap
}