01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.framework.extensioninterface;
20:
21: import java.util.List;
22: import org.mactor.brokers.Message;
23: import org.mactor.framework.MactorException;
24: import org.mactor.framework.TestContext;
25:
26: /**
27: * The interface that must be must be implemented by message builder commands
28: * <p>
29: * From a testspec: <message-builder name="MyMessageBuilder" command="java:<i>class
30: * that implements the MessageBuilderCommand interface</i>"/>
31: * </p>
32: *
33: * @author Lars Ivar Almli
34: */
35: public interface MessageBuilderCommand {
36: /**
37: * The method invoked by the testrunner to build the message
38: *
39: * @param context
40: * contains information about the context of the test that might
41: * be useful (such as all messages sent/received so far in the
42: * test)
43: * @param params
44: * the list of parameteres specifed for the given node in the
45: * test-spec xml (after the ##{...} substitution has been
46: * performed)
47: * @return the built message
48: * @throws MactorException
49: * to indicate some problem (this will cause the test to fail)
50: */
51: Message buildMessage(TestContext context, String templatePath,
52: List<String> params) throws MactorException;
53: }
|