Examples of Identifiers


Examples of com.indeed.proctor.common.Identifiers

    @Test
    public void testPageBuckets() {
        final String uidString = "16s2o7s01001d9vj";
        {
            // LoggedIn + MX maps to [0, 0.5, 0.5] ranges
            final Identifiers identifiers = new Identifiers(TestType.PAGE, uidString);
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
            assertEquals("pimple:test1", calcBuckets(result));
            // Check and make sure UnitTestGroups respects these groups and works as expected.
            final UnitTestGroups grps = new UnitTestGroups(result);
            assertEquals(UnitTestGroups.Pimple.TEST, grps.getPimple());
            assertEquals(1, grps.getPimpleValue(-99));
            assertNotNull(grps.getKluj());
            assertEquals(-99, grps.getKlujValue(-99));
            assertNotNull(grps.getOop_poop());
            assertEquals(-99, grps.getOop_poopValue(-99));

            // Check the boolean conditions for one of the tests
            assertFalse(grps.isPimpleInactive());
            assertFalse(grps.isPimpleControl());
            assertTrue(grps.isPimpleTest());
            assertEquals("pimple1", grps.toString());
        }
        {
            // LoggedIn + US maps to [1, 0, 0] range
            final Identifiers identifiers = new Identifiers(TestType.PAGE, uidString);
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "US", /* account */  new Account(10));
            assertEquals("pimple:inactive-1", calcBuckets(result));
            // Check and make sure UnitTestGroups respects these groups and works as expected.
            final UnitTestGroups grps = new UnitTestGroups(result);
            assertEquals(UnitTestGroups.Pimple.INACTIVE, grps.getPimple());
            assertEquals(-1, grps.getPimpleValue(-99));
            assertNotNull(grps.getKluj());
            assertEquals(-99, grps.getKlujValue(-99));
            assertNotNull(grps.getOop_poop());
            assertEquals(-99, grps.getOop_poopValue(-99));

            // Check the boolean conditions for one of the tests
            assertTrue(grps.isPimpleInactive());
            assertFalse(grps.isPimpleControl());
            assertFalse(grps.isPimpleTest());
            assertEquals("", grps.toString());
        }
        {
            // LoggedIn=false + MX maps to [1, 0, 0] range
            final Identifiers identifiers = new Identifiers(TestType.PAGE, uidString);
            final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ false , /* country */ "FR", /* account */  new Account(10));
            assertEquals("", calcBuckets(result));
            // Check and make sure UnitTestGroups respects these groups and works as expected.
            final UnitTestGroups grps = new UnitTestGroups(result);
            assertNotNull(grps.getPimple());
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

        }
    }

    @Test
    public void testCompanyBuckets() {
        final Identifiers identifiers = new Identifiers(TestType.COMPANY, "16s2o7s01001d9vj");
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "US", /* account */  new Account(10));
        assertEquals("", calcBuckets(result));
        // Check and make sure UnitTestGroups respects these groups and works as expected.
        final UnitTestGroups grps = new UnitTestGroups(result);
        assertNotNull(grps.getPimple());
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

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

    @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", /* account */  new Account(10));
        assertEquals("kluj:kloo2,map_payload:inactive-1,oop_poop:test1,payloaded:inactive-1,payloaded_verified:inactive-1", calcBuckets(result));
        // Check and make sure UnitTestGroups respects these groups and works as expected.
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

                new String[]{"preexisting"}, grps.getPayloaded_excludedPayload());
    }

    @Test
    public void testTestDescriptions(){
        final Identifiers identifiers = new Identifiers(TestType.USER, "16s2o7s01001d9vj");
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
        assertEquals("kluj:test1,map_payload:inactive-1,oop_poop:control0,payloaded:inactive-1,payloaded_verified:inactive-1", calcBuckets(result));
        // Check and make sure UnitTestGroups respects these groups and works as expected.
        final UnitTestGroups grps = new UnitTestGroups(result);
        //make sure getDescription method exists and returns the correct description
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

        assertEquals(grps.getKlujDescription(),"2nd test");
    }

    @Test
    public void testTestDescriptions_checkEscaping(){
        final Identifiers identifiers = new Identifiers(TestType.USER, "16s2o7s01001d9vj");
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));
        assertEquals("kluj:test1,map_payload:inactive-1,oop_poop:control0,payloaded:inactive-1,payloaded_verified:inactive-1", calcBuckets(result));
        // Check and make sure UnitTestGroups respects these groups and works as expected.
        final UnitTestGroups grps = new UnitTestGroups(result);
        //make sure getDescription method exists and returns the correct description with escaping
View Full Code Here

Examples of com.indeed.proctor.common.Identifiers

        assertEquals(grps.getBubbleDescription(),"3rd \n\t\"test");
    }

    @Test
    public void testMapPayloadReturns(){
        final Identifiers identifiers = new Identifiers(TestType.USER, "16s2o7s01001d9vj");
        final ProctorResult result = manager.determineBuckets(identifiers, /* loggedin */ true , /* country */ "FR", /* account */  new Account(10));

        final UnitTestGroups grps = new UnitTestGroups(result);
        assertEquals(grps.getMap_payloadPayload().getAstring(),"lol");
        assertEquals(grps.getMap_payloadPayload().getAdouble(), (Double) 2.1);
View Full Code Here

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

Examples of com.indeed.proctor.common.Identifiers

    }

    @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

Examples of com.indeed.proctor.common.Identifiers

        }
    }

    @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

Examples of com.indeed.proctor.common.Identifiers

        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
TOP
Copyright © 2018 www.massapi.com. 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.