Package com.salas.bb.domain

Examples of com.salas.bb.domain.FeedMetaDataHolder$SoftMDCLWrapper


     */
    public void testProcessServiceResultsProcessingNew()
    {
        Map results = createServiceResults(MDDiscoveryLogic.STATUS_PROCESSING);

        FeedMetaDataHolder newHolder = new FeedMetaDataHolder();
        MDDiscoveryRequest request = new MDDiscoveryRequest(null, newHolder);

        MDDiscoveryLogic.processServiceResults(results, request);

        assertFalse("Discovery is incomplete. Service is processing request.",
            newHolder.isComplete());
    }
View Full Code Here


     */
    public void testProcessServiceResultsProcessingUpdate()
    {
        Map results = createServiceResults(MDDiscoveryLogic.STATUS_PROCESSING);

        FeedMetaDataHolder holder = new FeedMetaDataHolder();
        holder.setComplete(false);
        MDDiscoveryRequest request = new MDDiscoveryRequest(null, holder);

        MDDiscoveryLogic.processServiceResults(results, request);

        assertFalse("Discovery is incomplete. Service is processing request.",
            holder.isComplete());
    }
View Full Code Here

        results.put(MDDiscoveryLogic.KEY_TITLE, "title");
        results.put(MDDiscoveryLogic.KEY_AUTHOR, "author");
        results.put(MDDiscoveryLogic.KEY_DESCRIPTION, "description");
        results.put(MDDiscoveryLogic.KEY_INBOUND_LINKS, new Integer(1));

        FeedMetaDataHolder holder = new FeedMetaDataHolder();
        MDDiscoveryRequest request = new MDDiscoveryRequest(null, holder);

        MDDiscoveryLogic.processServiceResults(results, request);

        assertTrue("Discovery has finished with VALID status.",
            request.isServiceDiscoveryComplete());
        assertFalse("Information is valid.", holder.isInvalid().booleanValue());
        assertEquals("http://data", holder.getXmlURL().toString());
        assertEquals("http://html", holder.getHtmlURL().toString());
        assertEquals("title", holder.getTitle());
        assertEquals("description", holder.getDescription());
        assertEquals("author", holder.getAuthor());
        assertEquals(new Integer(1), holder.getInboundLinks());
    }
View Full Code Here

     */
    public void testProcessServiceResultsInvalid()
    {
        Map results = createServiceResults(MDDiscoveryLogic.STATUS_INVALID);

        FeedMetaDataHolder holder = new FeedMetaDataHolder();
        MDDiscoveryRequest request = new MDDiscoveryRequest(null, holder);

        MDDiscoveryLogic.processServiceResults(results, request);

        assertTrue("Discovery has finished with INVALID status.",
            request.isServiceDiscoveryComplete());
        assertTrue("Information is valid.", holder.isInvalid().booleanValue());
    }
View Full Code Here

     * @return request object.
     */
    private static MDDiscoveryRequest prepareRequest(boolean serviceComplete,
        boolean directComplete, Boolean isInvalid)
    {
        FeedMetaDataHolder holder = new FeedMetaDataHolder();
        MDDiscoveryRequest request = new MDDiscoveryRequest(null, holder);

        request.setServiceDiscoveryComplete(serviceComplete);
        request.setDirectDiscoveryComplete(directComplete);
        if (isInvalid != null) holder.setInvalid(isInvalid.booleanValue());

        return request;
    }
View Full Code Here

     * Tests recording holder for some URL and looking it up after that.
     */
    public void testRecord()
        throws MalformedURLException
    {
        FeedMetaDataHolder holder = createHolder(true, false);

        URL url = new URL("file://some");

        repository.record(holder, url);

View Full Code Here

     * Tests returning only valid holders.
     */
    public void testLookupValid()
        throws MalformedURLException
    {
        FeedMetaDataHolder valid = createHolder(true, false);
        FeedMetaDataHolder invalid = createHolder(true, true);

        repository.record(valid, new URL("file://valid"));
        repository.record(invalid, new URL("file://invalid"));

        FeedMetaDataHolder[] validHolders = repository.lookupValid();
View Full Code Here

    }

    public void testForget()
        throws MalformedURLException
    {
        FeedMetaDataHolder holder1 = createHolder(true, false);
        holder1.setXmlURL(new URL("file://1"));

        FeedMetaDataHolder holder2 = createHolder(true, false);
        holder2.setXmlURL(new URL("file://2"));

        FeedMetaDataHolder holder3 = createHolder(true, false);
        holder3.setXmlURL(new URL("file://3"));

        repository.record(holder1, holder1.getXmlURL());
        repository.record(holder2, holder2.getXmlURL());
        repository.record(holder3, holder3.getXmlURL());

        repository.forget(new FeedMetaDataHolder[] { holder1, holder3 });

        FeedMetaDataHolder[] validHolders = repository.lookupValid();
        assertEquals("Only one holder (2) is left.",
View Full Code Here

     *
     * @return holder.
     */
    private static FeedMetaDataHolder createHolder(boolean aComplete, boolean aInvalid)
    {
        FeedMetaDataHolder holder = new FeedMetaDataHolder();

        holder.setComplete(aComplete);
        holder.setInvalid(aInvalid);

        return holder;
    }
View Full Code Here

    {
        CountingNoActionExecutor noActionExecutor = new CountingNoActionExecutor();
        MDDiscoverer discoverer = new MDDiscoverer(noActionExecutor, new ConnectionState());

        // Schedule first discovery.
        discoverer.scheduleDiscovery(getTestLocalURL(), new FeedMetaDataHolder());
        assertEquals(1, noActionExecutor.executions);

        // Schedule the same discovery, while the first hasn't finished (not executed).
        // The execution shouldn't happen.
        discoverer.scheduleDiscovery(getTestLocalURL(), new FeedMetaDataHolder());
        assertEquals(1, noActionExecutor.executions);
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.domain.FeedMetaDataHolder$SoftMDCLWrapper

Copyright © 2018 www.massapicom. 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.