sysmodelmgr/com.symbian.smt.gui.unittest/src/com/symbian/smt/gui/smtwidgets/ModelControlWidgetTest.java
changeset 0 522a326673b6
equal deleted inserted replaced
-1:000000000000 0:522a326673b6
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 package com.symbian.smt.gui.smtwidgets;
       
    17 
       
    18 import static org.junit.Assert.*;
       
    19 import org.eclipse.swt.SWT;
       
    20 import org.eclipse.swt.widgets.Display;
       
    21 import org.eclipse.swt.widgets.Shell;
       
    22 import org.junit.After;
       
    23 import org.junit.Before;
       
    24 import org.junit.Test;
       
    25 
       
    26 import com.symbian.smt.gui.smtwidgets.ModelControlWidget;
       
    27 
       
    28 public class ModelControlWidgetTest {
       
    29 	Display display;
       
    30 	Shell shell;
       
    31 	ModelControlWidget modelControlWidget;
       
    32 	
       
    33 	/**
       
    34 	 * @throws java.lang.Exception
       
    35 	 */
       
    36 	@Before
       
    37 	public void setUp() throws Exception {
       
    38 		display = new Display();
       
    39 		shell = new Shell(display);
       
    40 		
       
    41 		modelControlWidget = new ModelControlWidget(shell, SWT.NONE);
       
    42 	}
       
    43 
       
    44 	/**
       
    45 	 * @throws java.lang.Exception
       
    46 	 */
       
    47 	@After
       
    48 	public void tearDown() throws Exception {
       
    49 		display.dispose();
       
    50 	}
       
    51 
       
    52 	/**
       
    53 	 * Test method for {@link com.symbian.smt.gui.smtwidgets.ModelControlWidgetTest#getHighlightCoreOS()}.
       
    54 	 */
       
    55 	@Test
       
    56 	public final void testSetAndGetHighlightCoreOS() {
       
    57 		modelControlWidget.setHighlightCoreOS(true);
       
    58 		assertTrue("Highlight Core OS set\\get failed", modelControlWidget.getHighlightCoreOS());
       
    59 
       
    60 	}
       
    61 
       
    62 	/**
       
    63 	 * Test method for {@link com.symbian.smt.gui.smtwidgets.ModelControlWidgetTest#getLevelOfDetail()}.
       
    64 	 */
       
    65 	@Test
       
    66 	public final void testSetAndGetLevelOfDetail() {
       
    67 		modelControlWidget.setLevelOfDetail("component");
       
    68 		String result = modelControlWidget.getLevelOfDetail();
       
    69 		
       
    70 		if (!result.equals("component")) {
       
    71 			fail("Level of Detail set\\get failed");
       
    72 		}
       
    73 	}
       
    74 }