#156 ✓closed
Ben Hood

Implement ListQueryConstraints

Reported by Ben Hood | January 18th, 2011 @ 05:57 PM | in 0.9.3

Currently the ListQueryConstraint class is just a place holder - there is no implementation for it and there certainly are no tests for it. Hence to complete this ticket we require:

  • A mechanism to declare a value domain constraint for a given pairing (or endpoint if #152 lands first)
  • Some test scenarios for different value domains
  • A multi-category test that includes both a range query and list query

Comments and changes to this ticket

  • Ben Hood

    Ben Hood January 21st, 2011 @ 04:11 PM

    • Milestone cleared.
    • Milestone order changed from “35” to “0”
  • Ben Hood

    Ben Hood January 27th, 2011 @ 05:37 PM

    • State changed from “new” to “open”
    • Assigned user set to “Ben Hood”
  • Ben Hood

    Ben Hood February 1st, 2011 @ 10:26 PM

    • State changed from “open” to “resolved”
    • Assigned user changed from “Ben Hood” to “Paul Jones”

    This looks like it might be resolvable now:

    • Set constraints are simple string based sets
    • In the data driven tests there is a plain jane set constraint datapoint as well as a datapoint for narrow a date based range constraint with a set constraint
    • Since #152 has landed, the default constraints are on the endpoint. The endpoint now has a map of category name to a CategoryDescriptor. To maintain polymorphism across Hibernate and Jackson, this hierarchy was implemented in Java instead of Scala.
    • Jackson based annotations are now a compile time dependency in the kernel - though ordinarily undesirable, I couldn't find better compromise of keeping the API nice contra writing extra serialization code. Also, they are only annotations, so they are get processed as opposed to having a functional library dependency.
    • I upgraded Jackson to 1.7.1 and Hibernate to 3.6.0.Final (because of a mapping issue I ran into with 3.3.1)
    • Jackson 1.7.1 breaks the docgen, so in order for this ticket to land, I've disabled it and have created a follow up ticket ( #166 ) to get this sorted out.
  • Paul Jones

    Paul Jones February 2nd, 2011 @ 09:02 AM

    • State changed from “resolved” to “open”
    • Assigned user changed from “Paul Jones” to “Ben Hood”

    QA notes:

    • In CategoryDescriptor.java, why is the dataType field public?
    • Same for fields in RangeCategoryDescriptor too;
    • Ditto for SetCategoryDescriptor;

    This is part of #167

    • Is the category descriptor in the Endpoint.categories property really many-to-many?

    This is the exported schema:

    create table category_descriptor (category_id integer generated by default as identity, constraint_type varchar(255) not null, primary key (category_id))
    create table endpoint (name varchar(255) not null, url varchar(255) not null unique, inbound_url varchar(255), content_type varchar(255) not null, inbound_content_type varchar(255), online smallint, primary key (name))
    create table endpoint_categories (id varchar(255) not null, category_descriptor_id integer not null, name varchar(255) not null, primary key (id, name))
    create table pair (pair_key varchar(255) not null, upstream varchar(255) not null, downstream varchar(255) not null, version_policy_name varchar(255), matching_timeout integer, name varchar(255) not null, primary key (pair_key))
    create table pair_group (group_key varchar(255) not null, primary key (group_key))
    create table range_category_descriptor (id integer not null, dataType varchar(255), upper_bound varchar(255), lower_bound varchar(255), primary key (id))
    create table set_category_descriptor (id integer not null, primary key (id))
    create table set_constraint_values (value_id integer not null, value_name varchar(255) not null, primary key (value_id, value_name))
    create table users (name varchar(255) not null, email varchar(255), primary key (name))
    alter table endpoint_categories add constraint FKEE1F9F06BC780104 foreign key (id) references endpoint
    alter table endpoint_categories add constraint FKEE1F9F06B6D4F2CB foreign key (category_descriptor_id) references category_descriptor
    alter table pair add constraint FK3462DA25F0B1C4 foreign key (upstream) references endpoint
    alter table pair add constraint FK3462DAF4F4CA7C foreign key (name) references pair_group
    alter table pair add constraint FK3462DA4242E68B foreign key (downstream) references endpoint
    alter table range_category_descriptor add constraint FKDC53C74E7A220B71 foreign key (id) references category_descriptor
    alter table set_category_descriptor add constraint FKA51D45F39810CA56 foreign key (id) references category_descriptor
    alter table set_constraint_values add constraint FK96C7B32744035BE4 foreign key (value_id) references category_descriptor
    
    • Ideally, the CategoryDescriptor would know how to turn itself into a default constraint. But I guess the problem with that is the fact the Descriptors are in Java;

    This is also part of #167

    • Can we raise a ticket to re-investigate why the CategoryDescriptor needs to be in Java?

    See #167

    • The Correlation result in AbstractPolicyTest:272 (shouldStoreDownstreamChangesToCorrelationStoreAndNotifySessionManager) looks to be wrong. I think this was pre-standing issue, but it forced the creation of "untypedMap" for CategoryDescriptor - which I don't believe should exist.
    • Consequently, I don't think that dataType should be on a base CategoryDescriptor - it only appears to be relevant on the range type.
    • schemaToTypedMap in AttributesUtil doesn't really need to exist anymore - we shouldn't be seeing a schema String,String form anymore
    • Should LuceneVersionCorrelationStore be containing: case l:SetQueryConstraint => throw new RuntimeException("SetQueryConstraint not yet implemented")
    • Presumably the fact that exception hasn't been caught indicates that the test coverage in both LuceneVersionCorrelationStoreTest and an integration test need to be updated.

    The data points for the theory based tests have been updated to reflect this. However, due to time constraints, it is difficult to add set constraints to the integration test suite without refactoring that significantly. Hence I have created a follow up ticket for this: #168

  • Ben Hood

    Ben Hood February 3rd, 2011 @ 02:47 PM

    • State changed from “open” to “resolved”
    • Assigned user changed from “Ben Hood” to “Paul Jones”
  • Ben Hood
  • Paul Jones

    Paul Jones February 3rd, 2011 @ 03:00 PM

    • State changed from “resolved” to “closed”
    • Assigned user changed from “Paul Jones” to “Ben Hood”

    QA+

  • Ben Hood

    Ben Hood February 4th, 2011 @ 02:48 PM

    • Milestone set to 0.9.3
    • Milestone order changed from “10” to “0”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A Real Time Differencing Tool.

Shared Ticket Bins

People watching this ticket

Tags

Referenced by

Pages