587
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 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 |
package com.nokia.helium.imaker.tests;
|
|
18 |
|
628
|
19 |
import static org.junit.Assert.assertEquals;
|
|
20 |
|
|
21 |
import org.junit.Test;
|
587
|
22 |
|
|
23 |
import com.nokia.helium.imaker.PrintVarSteamConsumer;
|
|
24 |
|
|
25 |
public class TestPrintVarStreamConsumer {
|
|
26 |
|
|
27 |
@Test
|
|
28 |
public void readSimpleVar() {
|
|
29 |
PrintVarSteamConsumer consumer = new PrintVarSteamConsumer("WORKDIR");
|
|
30 |
consumer.consumeLine("iMaker 09.24.01, 10-Jun-2009.");
|
|
31 |
consumer.consumeLine("WORKDIR = `/.'");
|
|
32 |
consumer.consumeLine("");
|
|
33 |
assertEquals(consumer.getValue(), "/.");
|
|
34 |
}
|
|
35 |
|
|
36 |
@Test
|
|
37 |
public void readMultilineVar() {
|
|
38 |
PrintVarSteamConsumer consumer = new PrintVarSteamConsumer("LONGVAR");
|
|
39 |
consumer.consumeLine("iMaker 09.24.01, 10-Jun-2009.");
|
|
40 |
consumer.consumeLine("LONGVAR = `some text");
|
|
41 |
consumer.consumeLine("second line");
|
|
42 |
consumer.consumeLine("end of text'");
|
|
43 |
consumer.consumeLine("");
|
|
44 |
assertEquals(consumer.getValue(), "some text\nsecond line\nend of text");
|
|
45 |
}
|
|
46 |
}
|