Package com.indeed.proctor.common

Examples of com.indeed.proctor.common.PayloadType


        assertEquals(7, names.size());

        for (String s : new String[]{"doubleValue", "doubleArray",
                                     "longValue", "longArray",
                                     "stringValue", "stringArray","map"}) {
            PayloadType p = PayloadType.payloadTypeForName(s);
            assertEquals(s, p.payloadTypeName);
        }
        // Verify that trying to get the PayloadType for a nonsense
        // name throws an exception.
        try {
            PayloadType p = PayloadType.payloadTypeForName("gruntleBuggy");
            assertFalse("should have thrown IllegalArgumentException on \"gruntleBuggy\"", true);
        } catch (IllegalArgumentException e) {
            // expected.
        }
    }
View Full Code Here


            final List<Map<String, String>> nestedPayloadsList = new ArrayList<Map<String,String>>();
            // Only define testDef.payloadJavaClass if the API user has
            // claimed she expects a payload.
            if (testSpecification.getPayload() != null) {
                final String specifiedPayloadTypeName = testSpecification.getPayload().getType();
                final PayloadType specifiedPayloadType = PayloadType.payloadTypeForName(specifiedPayloadTypeName);
                if(specifiedPayloadType == PayloadType.MAP) {
                    testDef.put("isMap","true");
                    for(Map.Entry<String,String> entry : testSpecification.getPayload().getSchema().entrySet()) {
                        final Map<String,String> nestedPayloadsMap = Maps.newHashMap();
                        nestedPayloadsMap.put("key",entry.getKey());
                        final PayloadType payloadTypeForValue = PayloadType.payloadTypeForName(entry.getValue());
                        if(payloadTypeForValue != PayloadType.MAP) {
                            nestedPayloadsMap.put("value", payloadTypeForValue.javaClassName);
                            nestedPayloadsMap.put("valueWithoutArray",
                                    payloadTypeForValue.javaClassName.substring(0, payloadTypeForValue.javaClassName.length() - 2));
                            if (PayloadType.STRING_ARRAY == payloadTypeForValue) {
View Full Code Here

TOP

Related Classes of com.indeed.proctor.common.PayloadType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.