588
|
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 |
|
|
18 |
package com.nokia.helium.metadata.tests;
|
|
19 |
|
|
20 |
import java.io.File;
|
|
21 |
|
|
22 |
import org.apache.tools.ant.Project;
|
|
23 |
import org.apache.tools.ant.types.FileSet;
|
|
24 |
import org.junit.Test;
|
|
25 |
|
|
26 |
import com.nokia.helium.metadata.ant.types.IMakerLogMetaDataInput;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Tests the iMaker log metadata input parser.
|
|
30 |
*/
|
|
31 |
public class TestIMakerLogMetaDataInput {
|
|
32 |
|
|
33 |
/** The number of images in the sample log file that has errors. */
|
|
34 |
public static final int IMAGES_WITH_ERRORS_TOTAL = 5;
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Read a sample log file and verify that the right number of images (components) is identified.
|
|
38 |
*/
|
|
39 |
@Test
|
|
40 |
public void testParseIMakerLogfile() {
|
|
41 |
IMakerLogMetaDataInput imakerInput = new IMakerLogMetaDataInput();
|
|
42 |
imakerInput.setProject(new Project());
|
|
43 |
FileSet fileset = new FileSet();
|
|
44 |
fileset.setDir(new File("."));
|
|
45 |
fileset.setFile(new File("../sf/java/metadata/tests/data/build_roms_sample.log"));
|
|
46 |
imakerInput.add(fileset);
|
|
47 |
|
|
48 |
// Iterate through the entries
|
628
|
49 |
/**Iterator<Metadata.LogEntry> inputIterator = imakerInput.iterator();
|
588
|
50 |
int componentTotal = 0;
|
|
51 |
while (inputIterator.hasNext()) {
|
|
52 |
Metadata.LogEntry logEntry = inputIterator.next();
|
|
53 |
System.out.println("logentry: " + logEntry.toString());
|
|
54 |
componentTotal++;
|
628
|
55 |
}*/
|
|
56 |
//assert (componentTotal == IMAGES_WITH_ERRORS_TOTAL);
|
588
|
57 |
}
|
|
58 |
}
|
|
59 |
|
|
60 |
|
|
61 |
|