Package com.indeed.proctor.common

Examples of com.indeed.proctor.common.Identifiers


    }

    @Test
    public void testMultipleTypes() {
        {
            final Identifiers identifiers = new Identifiers(ImmutableMap.<TestType, String>builder()
                    .put(TestType.ANONYMOUS_USER, SPECIFICATION_MATRIX)
                    .put(TestType.AUTHENTICATED_USER, SPECIFICATION_MATRIX)
                    .put(TestType.PAGE, SPECIFICATION_MATRIX)
                    .build());

            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* accountid */ 10);
            assertEquals("one:test32,three:inactive-1,two:test22", calcBuckets(result));
        }
        {
            final ImmutableMap<TestType, String> idMap = ImmutableMap.<TestType, String>builder()
                    .put(TestType.EMAIL_ADDRESS, SPECIFICATION_MATRIX)
                    .put(TestType.AUTHENTICATED_USER, SPECIFICATION_MATRIX)
                    .put(TestType.PAGE, SPECIFICATION_MATRIX)
                    .build();
            final Identifiers identifiers = new Identifiers(idMap, true);

            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* accountid */ 10);
            assertEquals(result.getBuckets().get("one").getValue(),2);
        }
    }
View Full Code Here


    }

    @Test
    public void testSomeBuckets() {
        {
            final Identifiers identifiers = new Identifiers(TestType.ANONYMOUS_USER, "16s2o7s01001d9vj");
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* accountid */ 10);
            assertEquals("three:inactive-1,two:test33", calcBuckets(result));
            // Check and make sure SpecificationCreationGroups respects these groups and works as expected.
            final SplitSpecificationTestGroups grps = new SplitSpecificationTestGroups(result);

View Full Code Here

        }
    }

    @Test
    public void testPayloads() {
        final Identifiers identifiers = new Identifiers(ImmutableMap.<TestType, String>builder()
                .put(TestType.ANONYMOUS_USER, SPECIFICATION_MATRIX)
                .build());
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "US", /* accountid */ 10);
        assertEquals("three:inactive-1,two:test22", calcBuckets(result));
        // Check and make sure SpecificationCreationGroups respects these groups and works as expected.
View Full Code Here

        assertEquals("two2", grps.toString());
    }

    @Test
    public void testTestDescriptions(){
        final Identifiers identifiers = new Identifiers(TestType.USER, "16s2o7s01001d9vj");
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* accountid */ 10);
        assertEquals("three:inactive-1,two:test33", calcBuckets(result));
        // Check and make sure SpecificationCreationGroups respects these groups and works as expected.
        final SplitSpecificationTestGroups grps = new SplitSpecificationTestGroups(result);
        //make sure getDescription method exists and returns the correct description
View Full Code Here

     * @deprecated use {@link AbstractGroupsManager#determineBucketsInternal(Map, Map)}
     */
    @VisibleForTesting
    protected ProctorResult determineBucketsInternal(final TestType testType, final String identifier, final Map<String, Object> context) {
        final Map<String, Integer> forcedGroups = Collections.emptyMap();
        final Identifiers identifiers = new Identifiers(testType, identifier);
        return determineBucketsInternal(identifiers, context, forcedGroups);
    }
View Full Code Here

        final Map<String, Object> context = Maps.newHashMap();
        context.put("num", Integer.valueOf(num));
        context.put("country", country);
        context.put("language", language);

        final Identifiers identifiers = new Identifiers(TestType.ANONYMOUS_USER, id);
        final ProctorResult proctorResult = proctor.determineTestGroups(identifiers, context, forceGroups);
        final StringBuilder buckets = new StringBuilder();
        for (final Iterator<Entry<String, TestBucket>> iterator = proctorResult.getBuckets().entrySet().iterator(); iterator.hasNext(); ) {
            final Entry<String, TestBucket> entry = iterator.next();
            final String testName = entry.getKey();
View Full Code Here

TOP

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

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.