com.claytablet.service.event.stubs.MockStubTest.java Source code

Java tutorial

Introduction

Here is the source code for com.claytablet.service.event.stubs.MockStubTest.java

Source

package com.claytablet.service.event.stubs;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.google.inject.Guice;

/**
 * Copyright 2007 Clay Tablet Technologies Inc.
 * 
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at <a
 * href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
 * 
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 * 
 * <p>
 * 
 * @author <a href="mailto:drapin@clay-tablet.com">Dave Rapin</a>
 * 
 * <p>
 * Mock stub tests.
 */
public class MockStubTest extends TestCase {

    private final Log log = LogFactory.getLog(getClass());

    private MockStub stub;

    /**
     * This is run before every unit test and is used to setup test variables.
     */
    @Before
    public void setUp() {

        log.debug("SETUP: ");

        log.debug("Inject the stub.");
        stub = Guice.createInjector().getProvider(MockStub.class).get();

    }

    /**
     * This is run after every unit test and is used to undo changes as
     * necessary.
     */
    @After
    public void tearDown() {

        log.debug("TEARDOWN: ");
    }

    // -------------------------------------------------------------------------
    // Tests
    // -------------------------------------------------------------------------

    /**
     * Tests logConfig.
     * 
     * @throws Exception
     */
    @Test
    public void testLogConfig() throws Exception {

        stub.logConfig();
        assertTrue(true);
    }

}