Package com.volantis.mcs.migrate.impl.framework.identification

Examples of com.volantis.mcs.migrate.impl.framework.identification.DefaultResourceIdentifier


        DefaultVersion version1 = new DefaultVersion("version 1");
        DefaultVersion version2 = new DefaultVersion("version 2");
        StreamBufferFactory streamBufferFactory =
                new DefaultStreamBufferFactory();
        DefaultResourceIdentifier resourceRecogniser =
                new DefaultResourceIdentifier();
        DefaultIdentificationFactory typeFactory =
                new DefaultIdentificationFactory();
        DefaultTypeIdentifier type = new DefaultTypeIdentifier(typeFactory,
                "type");
        type.setPathRecogniser(new RegexpPathRecogniser(filename));
        type.addContentIdentifier(
                new DefaultContentIdentifier(version1,
                        new RegexpContentRecogniser(inputData)));
        DefaultGraph graph = new DefaultGraph(version2);
        Step step = new DefaultStep(version1, version2,
                new TestStreamMigrator(inputData, outputData));
        graph.addStep(step);
        type.setGraph(graph);
        resourceRecogniser.addType(type);
        DefaultResourceMigrator resourceMigrator =
                new DefaultResourceMigrator(streamBufferFactory,
                        resourceRecogniser, notificationReporter);

        ByteArrayInputStream bais = new ByteArrayInputStream(
View Full Code Here


        // ==================================================================
        // Do the test.
        // ==================================================================

        DefaultResourceIdentifier recogniser = new DefaultResourceIdentifier();
        recogniser.addType(mockTypeIdentifier);
        Match recognised = recogniser.identifyResource(mockInputMetadata, input);

        assertNotNull("", recognised);
        assertSame("", recognised, mockMatch);
    }
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        DefaultResourceIdentifier recogniser = new DefaultResourceIdentifier();
        recogniser.addType(mockTypeIdentifier);
        Match recognised = recogniser.identifyResource(mockInputMetadata, input);

        assertNull("", recognised);
    }
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        DefaultResourceIdentifier recogniser = new DefaultResourceIdentifier();
        recogniser.addType(mockTypeIdentifier);
        recogniser.addType(mockTypeIdentifier2);
        Match recognised = recogniser.identifyResource(mockInputMetadata, input);

        assertNotNull("", recognised);
        assertSame("", recognised, mockMatch);
    }
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        DefaultResourceIdentifier recogniser = new DefaultResourceIdentifier();
        recogniser.addType(mockTypeIdentifier);
        recogniser.addType(mockTypeIdentifier2);
        try {
            Match recognised = recogniser.identifyResource(mockInputMetadata, input);
            fail("two matches are not valid");
        } catch (Exception e) {
            // success
        }
    }
View Full Code Here

        // ==================================================================
        // Do the test.
        // ==================================================================

        // Do the test.
        DefaultResourceIdentifier identifier = new DefaultResourceIdentifier();
        try {
            /*Match recognised = */identifier.identifyResource(mockInputMetadata, input);
            fail("can't identify without at least one type");
        } catch (IllegalStateException e) {
            // success
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.migrate.impl.framework.identification.DefaultResourceIdentifier

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.