@Test
    void testTypedOfPrimitivesAssignmentNonStrict() {
        QueryProfile profile = new QueryProfile("test");
        profile.setType(testtype);
        registry.register(profile);

        profile.set("myString", "anyValue", registry);
        profile.set("nontypedString", "anyValueToo", registry); // legal because this is not 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("myBoolean", true, registry);

        String tensorString1 = "{{a:a1, b:b1}:1.0, {a:a2, b:b1}:2.0}";
        profile.set("ranking.features.query(myTensor1)", tensorString1, registry);
        String tensorString2 = "{{x:0, y:0}:1.0, {x:0, y:1}:2.0}";
        profile.set("ranking.features.query(myTensor2)", tensorString2, registry);
        String tensorString3 = "{{x:x1}:1.0, {x:x2}:2.0}";
        profile.set("ranking.features.query(myTensor3)", tensorString3, registry);

        profile.set("myQuery", "...", registry); // TODO
        profile.set("myQueryProfile.anyString", "value1", registry);
        profile.set("myQueryProfile.anyDouble", 8.76, registry);
        profile.set("myUserQueryProfile.myUserString", "value2", registry);
        profile.set("myUserQueryProfile.anyString", "value3", registry); // Legal because user is not strict
        assertWrongType(profile, "integer", "myUserQueryProfile.myUserInteger", "notInteger");
        profile.set("myUserQueryProfile.uint", 1337, registry); // Set using alias
        profile.set("myUserQueryProfile.anyDouble", 9.13, registry); // Legal because user is not strict

        CompiledQueryProfileRegistry cRegistry = registry.compile();
        QueryProfileProperties properties = new QueryProfileProperties(cRegistry.findQueryProfile("test"));

        assertEquals("anyValue", properties.get("myString"));
        assertEquals("anyValueToo", properties.get("nontypedString"));
        assertEquals(3, properties.get("myInteger"));
        assertEquals(3, properties.get("Int"));
        assertEquals(4000000000000L, properties.get("myLong"));
        assertEquals(3.14f, properties.get("myFloat"));
        assertEquals(2.18, properties.get("myDouble"));
        assertEquals(true, properties.get("myBoolean"));
        assertEquals(Tensor.from(tensorString1), properties.get("ranking.features.query(myTensor1)"));
        assertEquals(Tensor.from("tensor(x[2],y[2])", tensorString2), properties.get("ranking.features.query(myTensor2)"));
        assertEquals(Tensor.from("tensor<float>(x{})", tensorString3), properties.get("ranking.features.query(myTensor3)"));
        // TODO: assertEquals(..., cprofile.get("myQuery"));
        assertEquals("value1", properties.get("myQueryProfile.anyString"));
        assertEquals("value1", properties.get("QP.anyString"));
        assertEquals(8.76, properties.get("myQueryProfile.anyDouble"));
        assertEquals(8.76, properties.get("qp.anyDouble"));
        assertEquals("value2", properties.get("myUserQueryProfile.myUserString"));
        assertEquals("value3", properties.get("myUserQueryProfile.anyString"));
        assertEquals(1337, properties.get("myUserQueryProfile.myUserInteger"));
        assertEquals(1337, properties.get("myUserQueryProfile.uint"));
        assertEquals(9.13, properties.get("myUserQueryProfile.anyDouble"));
        assertNull(properties.get("nonExisting"));

        properties.set("INt", 51);
        assertEquals(51, properties.get("InT"));
        assertEquals(51, properties.get("myInteger"));
    }
Tests query profiles with/and types

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