/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ using System.Collections.Generic;//.IList; namespace Apache.Qpid.Integration.Tests.framework { /// /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an /// instigating 'publisher' end and a more passive 'receivers' end. /// ///

Once created, the life-cycle of a circuit may be controlled by ing it, or ing it. /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used. /// ///

The state of the circuit may be taken with the method, and asserted against by the /// method. /// ///

There is a default test procedure which may be performed against the circuit. The outline of this procedure is: /// ///

    /// Start the circuit.
    /// Send test messages.
    /// Request a status report.
    /// Assert conditions on the publishing end of the circuit.
    /// Assert conditions on the receiving end of the circuit.
    /// Close the circuit.
    /// Pass with no failed assertions or fail with a list of failed assertions.
    /// 
/// ///

///
CRC Card
Responsibilities ///
Supply the publishing and receiving ends of a test messaging circuit. ///
Start the circuit running. ///
Close the circuit down. ///
Take a reading of the circuits state. ///
Apply assertions against the circuits state. ///
Send test messages over the circuit. ///
Perform the default test procedue on the circuit. ///
///

public interface Circuit { /// Gets the interface on the publishing end of the circuit. /// /// The publishing end of the circuit. Publisher GetPublisher(); /// Gets the interface on the receiving end of the circuit. /// /// The receiving end of the circuit. Receiver GetReceiver(); /// Connects and starts the circuit. After this method is called the circuit is ready to send messages. void Start(); /// /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit, /// into a report, against which assertions may be checked. /// void Check(); /// Closes the circuit. All associated resources are closed. void Close(); /// /// Applied a list of assertions against the test circuit. The method should be called before doing /// this, to ensure that the circuit has gathered its state into a report to assert against. /// /// /// The list of assertions to apply to the circuit. /// /// Any assertions that failed. IList ApplyAssertions(IList assertions); /// /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. /// /// /// The number of messages to send using the default test procedure. /// The list of assertions to apply. /// /// Any assertions that failed. IList Test(int numMessages, IList assertions); } }