Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource avu queries failing #104

Closed
michael-conway opened this issue May 6, 2015 · 1 comment
Closed

resource avu queries failing #104

michael-conway opened this issue May 6, 2015 · 1 comment
Assignees

Comments

@michael-conway
Copy link
Collaborator

see ResourceAOTest. testFindMetadataValuesByMetadataQuery

Adds an avu and then queries it...getting error
imeta

imeta>ls -R test1-resc
AVUs defined for resource test1-resc:
attribute: testrattrib1
value: testrvalue1
units: testr1units
----
attribute: testattrib1
value: testvalue1
units: test1units

Jargon log


received header: len = 134
<MsgHeader_PI><type>RODS_API_REQ</type><msgLen>552</msgLen><errorLen>0</errorLen><bsLen>0</bsLen><intInfo>702</intInfo></MsgHeader_PI>
received msg: 
<GenQueryInp_PI><maxRows>500</maxRows>
<continueInx>0</continueInx>
<partialStartIndex>0</partialStartIndex>
<options>0</options>
<KeyValPair_PI><ssLen>0</ssLen>
</KeyValPair_PI>
<InxIvalPair_PI><iiLen>6</iiLen>
<inx>301</inx>
<inx>302</inx>
<inx>302</inx>
<inx>631</inx>
<inx>632</inx>
<inx>643</inx>
<ivalue>1</ivalue>
<ivalue>1</ivalue>
<ivalue>1</ivalue>
<ivalue>1</ivalue>
<ivalue>1</ivalue>
<ivalue>1</ivalue>
</InxIvalPair_PI>
<InxValPair_PI><isLen>1</isLen>
<inx>630</inx>
<svalue> = 'testrattrib1' </svalue>
</InxValPair_PI>
</GenQueryInp_PI>

packed XML: 
<MsgHeader_PI>
<type>RODS_API_REPLY</type>
<msgLen>0</msgLen>
<errorLen>0</errorLen>
<bsLen>0</bsLen>
<intInfo>-808000</intInfo>
</MsgHeader_PI>

sending header: len = 145
<MsgHeader_PI>
<type>RODS_API_REPLY</type>
<msgLen>0</msgLen>
<errorLen>0</errorLen>
<bsLen>0</bsLen>
<intInfo>-808000</intInfo>
</MsgHeader_PI>



iRODS log using imeta

....nothing...huh?

@michael-conway
Copy link
Collaborator Author

Unit test

@Test
    public final void testFindMetadataValuesByMetadataQuery() throws Exception {
        String testResource = testingProperties
                .getProperty(TestingPropertiesHelper.IRODS_RESOURCE_KEY);

        IRODSAccount irodsAccount = testingPropertiesHelper
                .buildIRODSAccountFromTestProperties(testingProperties);

        IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem
                .getIRODSAccessObjectFactory();

        ResourceAO resourceAO = accessObjectFactory.getResourceAO(irodsAccount);

        // initialize the AVU data
        String expectedAttribName = "testrattrib1";
        String expectedAttribValue = "testrvalue1";
        String expectedAttribUnits = "testr1units";

        AvuData avuData = AvuData.instance(expectedAttribName,
                expectedAttribValue, expectedAttribUnits);

        resourceAO.deleteAVUMetadata(testResource, avuData);

        resourceAO.addAVUMetadata(testResource, avuData);

        List<AVUQueryElement> queryElements = new ArrayList<AVUQueryElement>();

        queryElements.add(AVUQueryElement.instanceForValueQuery(
                AVUQueryElement.AVUQueryPart.ATTRIBUTE,
                AVUQueryOperatorEnum.EQUAL, expectedAttribName));

        List<MetaDataAndDomainData> result = resourceAO
                .findMetadataValuesByMetadataQuery(queryElements);
        Assert.assertFalse("no query result returned", result.isEmpty());

    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant