@Test
    void testTypedOfPrimitivesAssignmentStrict() {
        QueryProfile profile = new QueryProfile("test");
        profile.setType(testtypeStrict);

        profile.set("myString", "anyValue", registry);
        assertNotPermitted(profile, "nontypedString", "anyValueToo"); // Illegal because this is strict
        assertWrongType(profile, "integer", "myInteger", "notInteger");
        assertWrongType(profile, "integer", "myInteger", "1.5");
        profile.set("myInteger", 3, registry);
        assertWrongType(profile, "long", "myLong", "notLong");
        assertWrongType(profile, "long", "myLong", "1.5");
        profile.set("myLong", 4000000000000L, registry);
        assertWrongType(profile, "float", "myFloat", "notFloat");
        profile.set("myFloat", 3.14f, registry);
        assertWrongType(profile, "double", "myDouble", "notDouble");
        profile.set("myDouble", 2.18, registry);
        profile.set("myQueryProfile.anyString", "value1", registry);
        profile.set("myQueryProfile.anyDouble", 8.76, registry);
        profile.set("myUserQueryProfile.myUserString", "value2", registry);
        assertNotPermitted(profile, "myUserQueryProfile.anyString", "value3"); // Illegal because this is strict
        assertWrongType(profile, "integer", "myUserQueryProfile.myUserInteger", "notInteger");
        profile.set("myUserQueryProfile.myUserInteger", 1337, registry);
        assertNotPermitted(profile, "myUserQueryProfile.anyDouble", 9.13); // Illegal because this is strict

        CompiledQueryProfile cprofile = profile.compile(null);

        assertEquals("anyValue", cprofile.get("myString"));
        assertNull(cprofile.get("nontypedString"));
        assertEquals(3, cprofile.get("myInteger"));
        assertEquals(4000000000000L, cprofile.get("myLong"));
        assertEquals(3.14f, cprofile.get("myFloat"));
        assertEquals(2.18, cprofile.get("myDouble"));
        assertEquals("value1", cprofile.get("myQueryProfile.anyString"));
        assertEquals(8.76, cprofile.get("myQueryProfile.anyDouble"));
        assertEquals("value2", cprofile.get("myUserQueryProfile.myUserString"));
        assertNull(cprofile.get("myUserQueryProfile.anyString"));
        assertEquals(1337, cprofile.get("myUserQueryProfile.myUserInteger"));
        assertNull(cprofile.get("myUserQueryProfile.anyDouble"));
    }
Tests query profiles with/and types

@author bratseth
container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java