buildframework/helium/sf/java/metadata/tests/src/com/nokia/helium/metadata/tests/TestIMakerLogMetaDataInput.java
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     1
/*
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     2
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     3
 * All rights reserved.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     8
 *
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
     9
 * Initial Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    11
 *
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    12
 * Contributors:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    13
 *
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    14
 * Description: 
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    15
 *
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    16
 */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    17
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    18
package com.nokia.helium.metadata.tests;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    19
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    20
import java.io.File;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    21
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    22
import org.apache.tools.ant.Project;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    23
import org.apache.tools.ant.types.FileSet;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    24
import org.junit.Test;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    25
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    26
import com.nokia.helium.metadata.ant.types.IMakerLogMetaDataInput;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    27
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    28
/**
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    29
 * Tests the iMaker log metadata input parser.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    30
 */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    31
public class TestIMakerLogMetaDataInput {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    32
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    33
    /** The number of images in the sample log file that has errors. */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    34
    public static final int IMAGES_WITH_ERRORS_TOTAL = 5;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    35
    
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    36
    /**
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    37
     * Read a sample log file and verify that the right number of images (components) is identified.
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    38
     */
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    39
    @Test
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    40
    public void testParseIMakerLogfile() {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    41
        IMakerLogMetaDataInput imakerInput = new IMakerLogMetaDataInput();
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    42
        imakerInput.setProject(new Project());
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    43
        FileSet fileset = new FileSet();
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    44
        fileset.setDir(new File("."));
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    45
        fileset.setFile(new File("../sf/java/metadata/tests/data/build_roms_sample.log"));
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    46
        imakerInput.add(fileset);
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    47
        
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    48
        // Iterate through the entries
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    49
        /**Iterator<Metadata.LogEntry> inputIterator = imakerInput.iterator();
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    50
        int componentTotal = 0;
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    51
        while (inputIterator.hasNext()) {
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    52
            Metadata.LogEntry logEntry = inputIterator.next();
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    53
            System.out.println("logentry: " + logEntry.toString());
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    54
            componentTotal++;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    55
        }*/
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    56
        //assert (componentTotal == IMAGES_WITH_ERRORS_TOTAL);
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    57
    }
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    58
}
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    59
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    60
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents:
diff changeset
    61