Package net.sf.urlchecker.commands

Examples of net.sf.urlchecker.commands.CheckUrlsCommand


    @Before
    public void setUp() throws Exception {

        builder = new CommunicationBuilder();
        resolver = new URLMatchCommand(new CheckUrlsCommand(null,
                builder.getMultithreadedClient()));

        builder2 = new net.sf.urlchecker.v2.communication.CommunicationBuilder();

        resolver2 = new URLMatchCommand(
View Full Code Here


    private CommunicationBuilder builder;

    @Before
    public void setUp() throws Exception {
        builder = new CommunicationBuilder();
        resolver = new URLMatchCommand(new CheckUrlsCommand(null,
                builder.getMultithreadedClient()));

    }
View Full Code Here

        builder = null;
    }

    @Test
    public void testAddCommand() throws ConfigurationException {
        resolver = new URLMatchCommand(new AddedCommand(new CheckUrlsCommand(
                null, builder.getMultithreadedClient())));

        final InputStream inStream = this.getClass().getClassLoader()
                .getResourceAsStream("dummyData.xml");
        final Context context = new StandardContext();
View Full Code Here

    private net.sf.urlchecker.v2.communication.CommunicationBuilder builder2;

    @Before
    public void setUp() throws Exception {
        builder = new CommunicationBuilder();
        resolver1 = new URLMatchCommand(new CheckUrlsCommand(null,
                builder.getSinglethreadedClient()));
        builder2 = new net.sf.urlchecker.v2.communication.CommunicationBuilder();

        resolver2 = new URLMatchCommand(
                new net.sf.urlchecker.v2.commands.CheckUrlsCommand(null,
View Full Code Here

            LOGGER.error("Error occured in testProcess:", e1);
        } catch (final UnsupportedEncodingException e) {
            fail("Wrong Encoding thrown while waiting for HttpException");
            LOGGER.error("Error occured in testProcess:", e);
        }
        CheckUrlsCommand command;
        final HttpClient client = createNiceMock(HttpClient.class);
        try {
            expect(client.executeMethod(isA(HttpMethod.class))).andThrow(
                    new HttpException()).anyTimes();
            expect(client.getHttpConnectionManager()).andReturn(
                    new MultiThreadedHttpConnectionManager()).anyTimes();
            replay(client);

            command = new CheckUrlsCommand(null, client);
            command.process(context);
            assertEquals(14, context.getResults().size());
            assertNull(CollectionUtils.find(context.getResults(),
                    new Predicate() {

                        public boolean evaluate(final Object object) {
View Full Code Here

            LOGGER.error("Error occured in testProcess:", e1);
        } catch (final UnsupportedEncodingException e) {
            fail("Encoding exception thrown ");
            LOGGER.error("Error occured in testProcess:", e);
        }
        CheckUrlsCommand command;
        final HttpClient client = createNiceMock(HttpClient.class);
        try {
            expect(client.executeMethod(isA(HttpMethod.class))).andThrow(
                    new IOException()).anyTimes();
            expect(client.getHttpConnectionManager()).andReturn(
                    new MultiThreadedHttpConnectionManager()).anyTimes();
            replay(client);

            command = new CheckUrlsCommand(null, client);
            command.process(context);
            assertEquals(14, context.getResults().size());
            assertNull(CollectionUtils.find(context.getResults(),
                    new Predicate() {
                        public boolean evaluate(final Object object) {
                            final Result r = (Result) object;
View Full Code Here

TOP

Related Classes of net.sf.urlchecker.commands.CheckUrlsCommand

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.