testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/StringResourceLoaderTest.java
changeset 1 96906a986c3b
equal deleted inserted replaced
0:f1112f777ce9 1:96906a986c3b
       
     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 "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.testfw.codegen;
       
    19 
       
    20 import java.io.IOException;
       
    21 import java.io.InputStream;
       
    22 
       
    23 import junit.framework.TestCase;
       
    24 
       
    25 public class StringResourceLoaderTest extends TestCase {
       
    26 
       
    27 	StringResourceLoader loader;
       
    28 
       
    29 	protected void setUp() throws Exception {
       
    30 		loader = new StringResourceLoader();
       
    31 	}
       
    32 
       
    33 	public void testGetLastModifiedResource() {
       
    34 		assertEquals(loader.getLastModified(null), 0);
       
    35 	}
       
    36 
       
    37 	public void testGetResourceStreamAndGetString() {
       
    38 		try {
       
    39 			InputStream stream = loader.getResourceStream("ABC");
       
    40 			assertEquals(StringResourceLoader.getString(stream), "ABC");
       
    41 		} catch (IOException e) {
       
    42 			fail(e.getMessage());
       
    43 		}
       
    44 	}
       
    45 
       
    46 	public void testIsSourceModifiedResource() {
       
    47 		assertFalse(loader.isSourceModified(null));
       
    48 	}
       
    49 
       
    50 	public void testInitExtendedProperties() {
       
    51 		loader.init(null);
       
    52 	}
       
    53 
       
    54 }