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:
25: /**
26: * The interface that must be implemented by message selector commands
27: * <p>
28: * From a testspec: <message-selector name="MyMessageSelector" command="java:<i>class
29: * that implements the MessageSelectorCommand interface</i>"/>
30: * </p>
31: *
32: * @author Lars Ivar Almli
33: */
34: public interface MessageSelectorCommand {
35: /**
36: * This method is ivoked by the test runner before selector is passed to the message broker during subscribe
37: *
38: * @param params
39: * the list of parameteres specifed for the given node in the
40: * test-spec xml (after the ##{...} substitution has been
41: * performed)
42: * @throws MactorException
43: * if some problem occured (this will cause the test to fail)
44: */
45: void setParams(List<String> params) throws MactorException;
46:
47: /**
48: * The method invoked by the testrunner to build the messgte.
49: *
50: * @param context
51: * contains information about the context of the test that might
52: * be useful (such as all messages sent/received so far in the
53: * test)
54: * @return the built message
55: * @throws MactorException
56: * if some problem occured (this exception is logged and
57: * ignored)
58: */
59: boolean isAcceptableMessage(Message message) throws MactorException;
60: }
|