Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/test/net/sf/asterisk/fastagi
Modified Files:
ResourceBundleMappingStrategyTest.java
Log Message:
- Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch)
- Removed ReplyBuilde and RequestBuilder
- Refactored Reply into interface and implementation
Index: ResourceBundleMappingStrategyTest.java
===================================================================
RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/ResourceBundleMappingStrategyTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -p -r1.4 -r1.5
--- ResourceBundleMappingStrategyTest.java 13 Mar 2005 11:26:51 -0000 1.4
+++ ResourceBundleMappingStrategyTest.java 15 Apr 2005 04:47:02 -0000 1.5
@@ -16,8 +16,9 @@
*/
package net.sf.asterisk.fastagi;
+import java.util.Map;
+
import junit.framework.TestCase;
-import net.sf.asterisk.fastagi.impl.AGIRequestImpl;
public class ResourceBundleMappingStrategyTest extends TestCase
{
@@ -34,10 +35,9 @@ public class ResourceBundleMappingStrate
{
AGIScript scriptFirstPass;
AGIScript scriptSecondPass;
- AGIRequestImpl request;
+ AGIRequest request;
- request = new AGIRequestImpl();
- request.setScript("hello.agi");
+ request = new SimpleAGIRequest();
scriptFirstPass = mappingStrategy.determineScript(request);
scriptSecondPass = mappingStrategy.determineScript(request);
@@ -51,13 +51,111 @@ public class ResourceBundleMappingStrate
public void testDetermineScriptWithResourceBundleUnavailable()
{
- AGIRequestImpl request;
+ AGIRequest request;
- request = new AGIRequestImpl();
- request.setScript("hello.agi");
+ request = new SimpleAGIRequest();
mappingStrategy
.setResourceBundleName("net.sf.asterisk.fastagi.unavailable");
assertNull(mappingStrategy.determineScript(request));
}
+
+ public class SimpleAGIRequest implements AGIRequest
+ {
+
+ public Map getRequest()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getScript()
+ {
+ return "hello.agi";
+ }
+
+ public String getRequestURL()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getChannel()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getUniqueId()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getType()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getLanguage()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getCallerId()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getCallerIdName()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDnid()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getRdnis()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getContext()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getExtension()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Integer getPriority()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Boolean getEnhanced()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getAccountCode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getParameter(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String[] getParameterValues(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Map getParameterMap()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
}
|