Package com.indeed.proctor.common

Examples of com.indeed.proctor.common.ProctorResult


                    .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);

            assertNotNull(grps.getOne());
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.
        final SplitSpecificationTestGroups grps = new SplitSpecificationTestGroups(result);
        System.out.println("grps == "+grps);
        assertNotNull(grps.getThree());
View Full Code Here

    }

    @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
        assertEquals(grps.getThreeDescription(),"2nd test");
View Full Code Here

            Preconditions.checkState(!buckets.containsKey(testName), "Attempted to provide two values for dummy test bucket %s", testName);
            buckets.put(testName, testBucket);
        }

        return (new ProctorResult(Audit.EMPTY_VERSION, buckets, testVersions));
    }
View Full Code Here

            Preconditions.checkState(!buckets.containsKey(testName), "Attempted to provide two values for dummy test bucket %s", testName);
            buckets.put(testName, testBucket);
        }

        return (new ProctorResult(Audit.EMPTY_VERSION, buckets, testVersions));
    }
View Full Code Here

    public GroupsHtmlOutput(final AbstractGroups groups, final String extraGroups) {
        final String[] pieces = (groups + "," + extraGroups).split(" *,+ *");
        Arrays.sort(pieces);

        final StringBuilder sb = new StringBuilder("<ul class=\"bucketList\">");
        final ProctorResult proctorResult = groups.getProctorResult();
        final Map<String, ConsumableTestDefinition> testDefinitions = proctorResult.getTestDefinitions();
        final Map<String, TestBucket> buckets = proctorResult.getBuckets();
        for (int i = 0; i < pieces.length; i++) {
            final String group = pieces[i];

            int bucketValueStart = group.length() - 1;
            for (; bucketValueStart >= 0; bucketValueStart--) {
View Full Code Here

            final Map<String, TestBucket> buckets = getDefaultBucketValues();
            final Map<String, Integer> versions = Maps.newHashMap();
            for (final String testName : buckets.keySet()) {
                versions.put(testName, Integer.valueOf(-1));
            }
            return new ProctorResult(Audit.EMPTY_VERSION, buckets, Collections.<String, ConsumableTestDefinition>emptyMap());
        }
        final ProctorResult result = proctor.determineTestGroups(identifiers, context, forcedGroups);
        return result;
    }
View Full Code Here

        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();
            final TestBucket testBucket = entry.getValue();

            if (testBucket.getValue() >= 0) {
View Full Code Here

TOP

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

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.