com.deepshiftlabs.nerrvana
Class UserMessage

java.lang.Object
  extended by com.deepshiftlabs.nerrvana.UserMessage

public class UserMessage
extends Object

User messages returned by API have following structure: <messages> <trace> <message> <txt><![CDATA[Selenium started.]]></txt> <created_time>1334253721</created_time> </message> </trace> <debug> <message> <txt><![CDATA[OK - word Selenium typed to input, snapshotted to 02_typed_entire.png]]></txt> <created_time>1334253722</created_time> </message> </debug> <info> <message> <txt><![CDATA[OK - clicked, snapshotted to 03_searched_entire.png]]></txt> <created_time>1334253753</created_time> </message> </info> </messages>

Version:
1.00
Author:
Deep Shift Labs, Victor Orlov

Field Summary
 Date created_time
           
 UserMessageLevel level
           
 String txt
           
 
Constructor Summary
UserMessage(Node node, UserMessageLevel level)
           
UserMessage(String txt, Date created_time)
           
 
Method Summary
static SortedMap<UserMessageLevel,List<UserMessage>> getAllUserMessages(Document doc)
          Collects all messages in the document and converts them into map of the following form: [key - UserMessageLevel] => [value - list of the UserMessage objects of the given level]
 String getCreatedTime()
           
static SortedMap<UserMessageLevel,List<UserMessage>> getPlatformUserMessages(Node nodePlatform)
          Collects all messages for the given platform and converts them into map of the following form: [key - UserMessageLevel] => [value - list of the UserMessage objects of the given level]
 String getTxt()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

level

public UserMessageLevel level

txt

public String txt

created_time

public Date created_time
Constructor Detail

UserMessage

public UserMessage(Node node,
                   UserMessageLevel level)
            throws Exception
Throws:
Exception

UserMessage

public UserMessage(String txt,
                   Date created_time)
            throws Exception
Throws:
Exception
Method Detail

getTxt

public String getTxt()

getCreatedTime

public String getCreatedTime()

toString

public String toString()
Overrides:
toString in class Object

getAllUserMessages

public static SortedMap<UserMessageLevel,List<UserMessage>> getAllUserMessages(Document doc)
                                                                        throws Exception
Collects all messages in the document and converts them into map of the following form: [key - UserMessageLevel] => [value - list of the UserMessage objects of the given level]

Parameters:
doc - execution results document
Returns:
map of messages sorted by level
Throws:
Exception

getPlatformUserMessages

public static SortedMap<UserMessageLevel,List<UserMessage>> getPlatformUserMessages(Node nodePlatform)
                                                                             throws Exception
Collects all messages for the given platform and converts them into map of the following form: [key - UserMessageLevel] => [value - list of the UserMessage objects of the given level]

Parameters:
nodePlatform - parent node of the messages
Returns:
sorted map of messages for this platform
Throws:
Exception


Copyright © 2004-2013 Deep Shift Labs. All Rights Reserved.