connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/TCPIPConnectionTypeTests.java
changeset 164 88b7eb94b003
equal deleted inserted replaced
163:b25acbfc406a 164:88b7eb94b003
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 package com.nokia.carbide.remoteconnections.tests;
       
    19 
       
    20 import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
       
    21 import com.nokia.carbide.remoteconnections.interfaces.*;
       
    22 import com.nokia.carbide.remoteconnections.tests.extensions.DefaultProvidingTCPIPService;
       
    23 import com.nokia.carbide.remoteconnections.tests.extensions.TestFilter;
       
    24 import com.nokia.carbide.trk.support.connection.TCPIPConnectionType;
       
    25 
       
    26 import java.util.Map;
       
    27 
       
    28 import junit.framework.TestCase;
       
    29 
       
    30 @SuppressWarnings("restriction")
       
    31 public class TCPIPConnectionTypeTests extends TestCase {
       
    32 
       
    33 	private static IConnectionType connectionType;
       
    34 
       
    35 	protected void setUp() throws Exception {
       
    36 		TestFilter.isTest = true;
       
    37 		IConnectionTypeProvider connectionTypeProvider = RemoteConnectionsActivator.getConnectionTypeProvider();
       
    38 		if (connectionType == null)
       
    39 			connectionType = connectionTypeProvider.getConnectionType(TCPIPConnectionType.ID);
       
    40 	}
       
    41 
       
    42 	protected void tearDown() throws Exception {
       
    43 	}
       
    44 
       
    45 	public void testTCPIPDefaultMappings() throws Exception {
       
    46 		Map<String, String> settings = connectionType.getConnectionFactory().getSettingsFromUI();
       
    47 		IConnection connection = connectionType.getConnectionFactory().createConnection(settings);
       
    48 		RemoteConnectionsActivator.getConnectionsManager().addConnection(connection);
       
    49 		settings = connection.getSettings();
       
    50 		String defaultPort = settings.get(DefaultProvidingTCPIPService.ID);
       
    51 		assertEquals(DefaultProvidingTCPIPService.DEFAULT_PORT, defaultPort);
       
    52 	}
       
    53 }