diff -r 000000000000 -r 522a326673b6 sysmodelmgr/com.symbian.smt.gui.unittest/src/com/symbian/smt/gui/views/ConsoleOutputTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysmodelmgr/com.symbian.smt.gui.unittest/src/com/symbian/smt/gui/views/ConsoleOutputTest.java Thu Mar 11 19:08:43 2010 +0200 @@ -0,0 +1,49 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +package com.symbian.smt.gui.views; + +import junit.framework.Assert; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.junit.Test; + + +public class ConsoleOutputTest { + + @Test + public final void testConsoleOutput() { + String textToTest = "Test text"; + + Display display = new Display(); + Shell shell = new Shell(display); + + ConsoleOutput consoleOutput = new ConsoleOutput(); + + consoleOutput.createPartControl(shell); + + consoleOutput.setFocus(); // This method doesn't actually do anything but keeps code coverage happy + + ConsoleOutput.addText(textToTest); + + Assert.assertEquals(ConsoleOutput.getText().substring(0, textToTest.length()), textToTest); + + ConsoleOutput.reset(); + + Assert.assertEquals(ConsoleOutput.getText(), ""); + + display.dispose(); + } +}