Package org.jpos.iso

Examples of org.jpos.iso.ISOBitMap


        fieldContentToBeUpdated.set(11);
        fieldContentToBeUpdated.set(22);
        fieldContentToBeUpdated.set(33);
        BitSet originalFieldContent = (BitSet) fieldContentToBeUpdated.clone();
       
        ISOBitMap fieldWhichWillBeModified = new ISOBitMap(42, fieldContentToBeUpdated);
        ISOBitMap fieldWhoseValueShouldNotChange = (ISOBitMap) copier.doDeepCopy(fieldWhichWillBeModified);
       
        fieldContentToBeUpdated.set(44);
        fieldWhichWillBeModified.setFieldNumber(41);
       
        assertNotNull(fieldWhichWillBeModified);
        assertNotNull(fieldWhoseValueShouldNotChange);
        assertNotSame(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
        assertEquals(originalFieldContent, fieldWhoseValueShouldNotChange.getValue());
        assertEquals(fieldContentToBeUpdated, fieldWhichWillBeModified.getValue());
        ISOComponentEqualityTester.assertNotEquals(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
    }
View Full Code Here


        originalFieldContent.set(33);
        BitSet newFieldContent = new BitSet(33);
        newFieldContent.set(1);
        newFieldContent.set(23);
       
        ISOBitMap fieldWhichWillBeModified = new ISOBitMap(42, originalFieldContent);
        ISOBitMap fieldWhoseValueShouldNotChange = (ISOBitMap) copier.doDeepCopy(fieldWhichWillBeModified);
       
        fieldWhichWillBeModified.setValue(newFieldContent);
        fieldWhichWillBeModified.setFieldNumber(41);
       
        assertNotNull(fieldWhichWillBeModified);
        assertNotNull(fieldWhoseValueShouldNotChange);
        assertNotSame(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
        assertEquals(originalFieldContent, fieldWhoseValueShouldNotChange.getValue());
        assertEquals(newFieldContent, fieldWhichWillBeModified.getValue());
        ISOComponentEqualityTester.assertNotEquals(fieldWhichWillBeModified, fieldWhoseValueShouldNotChange);
    }
View Full Code Here

* $Author: nsmith $
*/
class ISOBitMapDeepCopier {

    public ISOBitMap doDeepCopy(ISOBitMap map) {
        return new ISOBitMap(((Integer) map.getKey()).intValue(), (BitSet) ((BitSet) map.getValue()).clone());
    }
View Full Code Here

    @Test
    public void testPack() throws Throwable {
        BitSet v = new BitSet(100);
        Base1_BITMAP126 base1_BITMAP126 = new Base1_BITMAP126(100, "testBase1_BITMAP126Description");
        byte[] result = base1_BITMAP126.pack(new ISOBitMap(100, v));
        assertEquals("result.length", 0, result.length);
    }
View Full Code Here

    }

    @Test
    public void testConstructorFieldsTwoBitmapThrowsNullPointerException() throws Throwable {
        ISOMsg m = new ISOMsg("testCardHolderMti");
        m.set(new ISOBitMap(2));
        try {
            new CardHolder(m);
            fail("Expected InvalidCardException to be thrown");
        } catch (NullPointerException ex) {
            assertEquals("m.getDirection()", 0, m.getDirection());
View Full Code Here

        int[] sequence = new int[3];
        VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode",
                "testVISA1PackagerOkPattern");
        byte[] b = new byte[3];
        try {
            vISA1Packager.unpack(new ISOBitMap(100), b);
            fail("Expected ISOException to be thrown");
        } catch (ISOException ex) {
            assertEquals("ex.getMessage()", "Can't add to Leaf", ex.getMessage());
            assertNull("ex.getNested()", ex.getNested());
            assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
View Full Code Here

    public void testUnpackThrowsNullPointerException3() throws Throwable {
        int[] sequence = new int[0];
        VISA1Packager vISA1Packager = new VISA1Packager(sequence, 100, "testVISA1PackagerBadResultCode",
                "testVISA1PackagerOkPattern");
        try {
            vISA1Packager.unpack(new ISOBitMap(100), (byte[]) null);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertSame("vISA1Packager.filter", vISA1Packager, vISA1Packager.filter);
        }
View Full Code Here

TOP

Related Classes of org.jpos.iso.ISOBitMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.