buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/AssertNode.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:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
/*
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     2
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     3
 * All rights reserved.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     4
 * This component and the accompanying materials are made available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     6
 * which accompanies this distribution, and is available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     8
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     9
 * Initial Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    10
 * Nokia Corporation - initial contribution.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    11
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    12
 * Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    13
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    14
 * Description: 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    15
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    16
 */
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    17
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
package com.nokia.helium.internaldata.ant.listener;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
//import com.nokia.ant.taskdefs.HlmAssertMessage;
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
    21
import com.nokia.helium.internaldata.ant.taskdefs.HlmAssertMessageTask;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    22
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
/**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
 * Object to set end time for a task.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    25
 * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
public class AssertNode extends DataNode {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
    private String name;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    30
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
    // location
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
    private String filename;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
    private String message;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
    private int line = -1;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
    private String assertName;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    36
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    37
    public AssertNode(DataNode parent, HlmAssertMessageTask task) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
        super(parent, task);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
        name = task.getTaskName();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
        this.setFilename(task.getLocation().getFileName());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
        this.setLine(task.getLocation().getLineNumber());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
        message = task.getMessage();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
        assertName = task.getAssertName();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    45
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
     * Return the assert message
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    48
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
     * @return
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
     */
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    51
    public String getMessage() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
        return message;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    54
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
     * Return the assert task name.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    57
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
     * @return
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    public String getName() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
        return name;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    62
    }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    63
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
     * Return the assert name.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    66
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
     * @return
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
     */
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    69
    public String getAssertName() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
        return assertName;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    72
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
     * Return the path to file name.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    75
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
     * @return
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
    public String getFilename() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
        return filename;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    81
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
     * Sets the path to file name.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    84
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
     * @param filename
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
    public void setFilename(String filename) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
        this.filename = filename;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    90
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
     * Return the line number.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    93
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
     * @return
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
    public int getLine() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
        return line;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    99
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
     * Sets the line number.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   102
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
     * @param line
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
    public void setLine(int line) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
        this.line = line;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
}