jade.jademx.util
Class AclMsgCmpTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by jade.jademx.util.AclMsgCmpTest
All Implemented Interfaces:
junit.framework.Test

public class AclMsgCmpTest
extends junit.framework.TestCase

test jade.jademx.util.AclMsgCmp
TODO: ADD TEST CASES FOR PERMISSIVE HAP COMPARISON IN AID

Author:
David Bernstein, Caboodle Networks, Inc.

Nested Class Summary
private  class AclMsgCmpTest.AclMsgCmpForTest
          a private class so can test protected AclMsgCmp methods.
private  class AclMsgCmpTest.NullStrToVarListAclMsgCmp
          test class for testNullStrToVarStrList
 
Field Summary
(package private)  java.lang.String proxyMsg
           
 
Constructor Summary
AclMsgCmpTest()
           
 
Method Summary
static junit.framework.Test suite()
          return the implicit suite of tests
 void testAidHapCrossSlot()
          Test comparison of messages with AID HAP crossing slots.
 void testByteSequenceContent()
          test comparison of byte sequence content
 void testCaseInsStrNulls()
          test nulls in a case-insensitive string slot
 void testCompareAidSetCardinality()
          test compareAidSet cardinality functionality
 void testCompareEnvelope()
          test envelope comparison WHICH IS NOT YET IMPLEMENTED.
 void testContent()
          test conversion of a golden content string to list of strings and vars.
 void testContentAIDGlobalization()
          test globalization of AID strings in content
 void testContentEmbeddedAddresses()
          test comparison of embedded addresses within content
 void testContentNewlineNormalization()
          test content newline normalization
 void testContentNulls()
          test nulls in content slot
 void testContentRandom()
          test comparison of content with variable of type random
 void testContentStrToVarStrList()
          test conversion of a golden content string to list of strings and vars.
 void testConversationIdCase()
          Test comparison of messages with case-varying conversation-ids.
 void testConversationIdConsistent()
          Test comparison of messages with consistent conversation-ids.
 void testConversationIdInconsistent()
          Test comparison of messages with inconsistent conversation-ids.
 void testEncoding()
          Test comparison of messages with different encodings.
 void testEncodingCase()
          Test case-insensitivity of encoding comparison.
 void testEqualMessages()
          Test that equal messages are returned as equal.
 void testFilterEmbeddedAddresses()
          test AclMsgCmp.filterEmbeddedAddresses()
 void testFlags()
          test initialization and setting/getting flags
 void testHasAtPos()
          test AclMsgCmp.hasAtPos()
 void testInReplyToCase()
          Test comparison of messages with case-varying in-reply-tos.
 void testInReplyToConsistent()
          Test comparison of messages with consistent in-reply-tos.
 void testInReplyToInconsistent()
          Test comparison of messages with inconsistent in-reply-tos.
 void testLanguage()
          Test comparison of messages with different languages.
 void testLanguageCase()
          Test case-insensitivity of language comparison.
 void testNullStrToVarStrList()
          test passing null to strToVarStrList
 void testOntology()
          Test comparison of messages with different ontologies.
 void testOntologyCase()
          Test case-insensitivity of ontology comparison.
 void testPerformative()
          Test comparison of messages with different performatives.
 void testProtocol()
          Test comparison of messages with different protocols.
 void testProtocolCase()
          Test case-insensitivity of protocol comparison.
 void testReceiverSingleton()
          Test comparison of messages with different singleton receivers.
 void testReceiverSingletonCase()
          Test comparison of messages with different-cased singleton receivers.
 void testReplyBy()
          Test comparison of messages with different reply-by timestamps.
 void testReplyIdCrossSlot()
          Test comparison of messages with reply-id crossing slots.
 void testReplyToSingleton()
          Test comparison of messages with different singleton reply-tos.
 void testReplyToSingletonCase()
          Test comparison of messages with different-cased singleton reply-tos.
 void testReplyWithCase()
          Test comparison of messages with case-varying reply-withs.
 void testReplyWithConsistent()
          Test comparison of messages with consistent reply-withs.
 void testReplyWithInconsistent()
          Test comparison of messages with inconsistent reply-withs.
 void testSenderCase()
          Test case-insensitivity of sender comparison.
 void testSenderHAP()
          Test sender HAP comparison.
 void testSenderLocalName()
          Test sender local name comparison.
 void testSenderNulls()
          test nulls in sender slot
 void testUserPropsAdded()
          Test comparison of messages with a user property added.
 void testUserPropsChanged()
          Test comparison of messages with a user property changed.
 void testUserPropsEqual()
          Test comparison of messages with same user properties.
 void testUserPropsRemoved()
          Test comparison of messages with a user property removed.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

proxyMsg

java.lang.String proxyMsg
Constructor Detail

AclMsgCmpTest

public AclMsgCmpTest()
Method Detail

testFlags

public void testFlags()
test initialization and setting/getting flags


testNullStrToVarStrList

public void testNullStrToVarStrList()
test passing null to strToVarStrList


testEqualMessages

public void testEqualMessages()
                       throws jade.lang.acl.ACLCodec.CodecException
Test that equal messages are returned as equal.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testCompareAidSetCardinality

public void testCompareAidSetCardinality()
                                  throws jade.lang.acl.ACLCodec.CodecException
test compareAidSet cardinality functionality

Throws:
ACLCodec.CodecException - converting string to message

testSenderCase

public void testSenderCase()
                    throws jade.lang.acl.ACLCodec.CodecException
Test case-insensitivity of sender comparison. Differing case should not matter.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testSenderLocalName

public void testSenderLocalName()
                         throws jade.lang.acl.ACLCodec.CodecException
Test sender local name comparison. Different local name should matter.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testSenderHAP

public void testSenderHAP()
                   throws jade.lang.acl.ACLCodec.CodecException
Test sender HAP comparison. If compare "a@x"/"a@y", then it should match,
followed by "b@x"/"b@y" should match,
followed by "c@x"/"c@z" should not match.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testSenderNulls

public void testSenderNulls()
                     throws jade.lang.acl.ACLCodec.CodecException
test nulls in sender slot

Throws:
ACLCodec.CodecException

testContentNulls

public void testContentNulls()
                      throws jade.lang.acl.ACLCodec.CodecException
test nulls in content slot

Throws:
ACLCodec.CodecException

testCaseInsStrNulls

public void testCaseInsStrNulls()
                         throws jade.lang.acl.ACLCodec.CodecException
test nulls in a case-insensitive string slot

Throws:
ACLCodec.CodecException

testReceiverSingletonCase

public void testReceiverSingletonCase()
                               throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different-cased singleton receivers.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReceiverSingleton

public void testReceiverSingleton()
                           throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different singleton receivers.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyToSingletonCase

public void testReplyToSingletonCase()
                              throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different-cased singleton reply-tos.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyToSingleton

public void testReplyToSingleton()
                          throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different singleton reply-tos.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testPerformative

public void testPerformative()
                      throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different performatives.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testLanguage

public void testLanguage()
                  throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different languages.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testLanguageCase

public void testLanguageCase()
                      throws jade.lang.acl.ACLCodec.CodecException
Test case-insensitivity of language comparison.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testEncoding

public void testEncoding()
                  throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different encodings.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testEncodingCase

public void testEncodingCase()
                      throws jade.lang.acl.ACLCodec.CodecException
Test case-insensitivity of encoding comparison.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testOntology

public void testOntology()
                  throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different ontologies.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testOntologyCase

public void testOntologyCase()
                      throws jade.lang.acl.ACLCodec.CodecException
Test case-insensitivity of ontology comparison.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testProtocol

public void testProtocol()
                  throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different protocols.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testProtocolCase

public void testProtocolCase()
                      throws jade.lang.acl.ACLCodec.CodecException
Test case-insensitivity of protocol comparison.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testConversationIdConsistent

public void testConversationIdConsistent()
                                  throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with consistent conversation-ids.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testConversationIdCase

public void testConversationIdCase()
                            throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with case-varying conversation-ids.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testConversationIdInconsistent

public void testConversationIdInconsistent()
                                    throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with inconsistent conversation-ids.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testInReplyToConsistent

public void testInReplyToConsistent()
                             throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with consistent in-reply-tos.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testInReplyToCase

public void testInReplyToCase()
                       throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with case-varying in-reply-tos.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testInReplyToInconsistent

public void testInReplyToInconsistent()
                               throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with inconsistent in-reply-tos.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyWithConsistent

public void testReplyWithConsistent()
                             throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with consistent reply-withs.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyWithCase

public void testReplyWithCase()
                       throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with case-varying reply-withs.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyWithInconsistent

public void testReplyWithInconsistent()
                               throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with inconsistent reply-withs.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyBy

public void testReplyBy()
                 throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with different reply-by timestamps.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testUserPropsEqual

public void testUserPropsEqual()
                        throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with same user properties.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testUserPropsChanged

public void testUserPropsChanged()
                          throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with a user property changed.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testUserPropsAdded

public void testUserPropsAdded()
                        throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with a user property added.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testUserPropsRemoved

public void testUserPropsRemoved()
                          throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with a user property removed.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testAidHapCrossSlot

public void testAidHapCrossSlot()
                         throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with AID HAP crossing slots. Slots using AID mapping for comparison are :sender, :receiver, and :reply-to.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testReplyIdCrossSlot

public void testReplyIdCrossSlot()
                          throws jade.lang.acl.ACLCodec.CodecException
Test comparison of messages with reply-id crossing slots. Slots using reply-id mapping for comparison are :reply-with, and :in-reply-to.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContentStrToVarStrList

public void testContentStrToVarStrList()
test conversion of a golden content string to list of strings and vars.


testHasAtPos

public void testHasAtPos()
test AclMsgCmp.hasAtPos()


testFilterEmbeddedAddresses

public void testFilterEmbeddedAddresses()
test AclMsgCmp.filterEmbeddedAddresses()


testByteSequenceContent

public void testByteSequenceContent()
                             throws jade.lang.acl.ACLCodec.CodecException
test comparison of byte sequence content

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContentNewlineNormalization

public void testContentNewlineNormalization()
                                     throws jade.lang.acl.ACLCodec.CodecException
test content newline normalization

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContentAIDGlobalization

public void testContentAIDGlobalization()
                                 throws jade.lang.acl.ACLCodec.CodecException
test globalization of AID strings in content

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContent

public void testContent()
                 throws jade.lang.acl.ACLCodec.CodecException
test conversion of a golden content string to list of strings and vars.

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContentRandom

public void testContentRandom()
                       throws jade.lang.acl.ACLCodec.CodecException
test comparison of content with variable of type random

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testContentEmbeddedAddresses

public void testContentEmbeddedAddresses()
                                  throws jade.lang.acl.ACLCodec.CodecException
test comparison of embedded addresses within content

Throws:
jade.lang.ACLCodec.CodecException - converting string to message
jade.lang.acl.ACLCodec.CodecException

testCompareEnvelope

public void testCompareEnvelope()
                         throws jade.lang.acl.ACLCodec.CodecException
test envelope comparison WHICH IS NOT YET IMPLEMENTED. so it checks for an expected runtime exception.

Throws:
jade.lang.acl.ACLCodec.CodecException

suite

public static junit.framework.Test suite()
return the implicit suite of tests

Returns:
the implicit suite of tests


Copyright © 2005-2006 Caboodle Networks, Inc.
LGPL license