Package com.pugh.sockso.gui.action

Source Code of com.pugh.sockso.gui.action.RequestLogClearTest

package com.pugh.sockso.gui.action;

import com.pugh.sockso.tests.SocksoTestCase;
import com.pugh.sockso.tests.TestDatabase;

public class RequestLogClearTest extends SocksoTestCase {

    protected static boolean eventFired;
   
    private RequestLogClear action;
   
    private TestDatabase db;

    @Override
    protected void setUp() throws Exception {
        db = new TestDatabase();
        db.fixture( "requestLogs" );
        action = new RequestLogClear( null, db, null );
    }
   
    public void testRequestLogIsCleared() throws Exception {
        assertTableSize( db, "request_log", 3 );
        action.clearRequestLog();
        assertTableSize( db, "request_log", 0 );
    }
   
    public void testChangeEventFiredAfterRequestLogCleared() throws Exception {
        eventFired = false;
        action.addListener(new RequestLogChangeListener() {
            public void requestLogChanged() {
                eventFired = true;
            }
        });
        action.clearRequestLog();
        assertTrue( eventFired );
    }
   
}
TOP

Related Classes of com.pugh.sockso.gui.action.RequestLogClearTest

TOP
Copyright © 2018 www.massapi.com. 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.