Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15391/src/test/net/sf/asterisk/fastagi
Modified Files:
HelloAGIScript.java
Added Files:
AGIChannelImplTest.java
Removed Files:
AGIResponseImplTest.java
Log Message:
Renamed AGIResponse to AGIChannel
--- NEW FILE: AGIChannelImplTest.java ---
/*
* Copyright 2004-2005 Stefan Reuter
*
* Licensed 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.
*
*/
package net.sf.asterisk.fastagi;
import net.sf.asterisk.fastagi.command.NoopCommand;
import net.sf.asterisk.fastagi.reply.AGIReply;
import org.easymock.MockControl;
import junit.framework.TestCase;
public class AGIChannelImplTest extends TestCase
{
private MockControl agiWriterMC;
private AGIWriter agiWriter;
private MockControl agiReaderMC;
private AGIReader agiReader;
private AGIChannel agiChannel;
protected void setUp() throws Exception
{
super.setUp();
this.agiWriterMC = MockControl.createControl(AGIWriter.class);
this.agiWriter = (AGIWriter) agiWriterMC.getMock();
this.agiReaderMC = MockControl.createControl(AGIReader.class);
this.agiReader = (AGIReader) agiReaderMC.getMock();
this.agiChannel = new AGIChannelImpl(agiWriter, agiReader);
}
public void testSendCommand() throws Exception
{
AGIReply reply;
NoopCommand command;
reply = new AGIReply();
reply.setStatus(AGIReply.SC_SUCCESS);
reply.setResult(0);
command = new NoopCommand();
agiWriter.sendCommand(command);
agiReader.readReply();
agiReaderMC.setReturnValue(reply);
agiWriterMC.replay();
agiReaderMC.replay();
assertEquals(reply, agiChannel.sendCommand(command));
agiWriterMC.verify();
agiReaderMC.verify();
}
}
Index: HelloAGIScript.java
===================================================================
RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/HelloAGIScript.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -p -r1.1 -r1.2
--- HelloAGIScript.java 10 Mar 2005 21:31:31 -0000 1.1
+++ HelloAGIScript.java 10 Mar 2005 23:57:07 -0000 1.2
@@ -29,7 +29,7 @@ public class HelloAGIScript implements A
}
- public void service(AGIRequest request, AGIResponse response)
+ public void service(AGIRequest request, AGIChannel channel)
{
return;
}
--- AGIResponseImplTest.java DELETED ---
|