Search in sources :

Example 1 with IVA_ALPHANUM

use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.

the class QFactory2Test method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    String[] args = new String[0];
    try {
        new QFactory(new ObjectName(""), new Q2(args)).setConfiguration(new IVA_ALPHANUM(true, 100, 1000, "testQFactoryDescription"), null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ObjectName(javax.management.ObjectName) Test(org.junit.Test)

Example 2 with IVA_ALPHANUM

use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.

the class GenericValidatingPackagerTest method testValidate6.

@Test
public void testValidate6() throws Throwable {
    ISOBaseValidator mSGTEST = new MSGTEST(false);
    GenericValidatingPackager genericValidatingPackager = new GenericValidatingPackager();
    ISOBaseValidator mSGTEST2 = new MSGTEST(false);
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[3];
    msgVlds[0] = mSGTEST2;
    msgVlds[1] = mSGTEST;
    msgVlds[2] = mSGTEST2;
    genericValidatingPackager.setMsgValidator(msgVlds);
    ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
    fvlds[0] = new IVA_ALPHANUM("testGenericValidatingPackagerDescription");
    genericValidatingPackager.setFieldValidator(fvlds);
    ISOVMsg result = (ISOVMsg) genericValidatingPackager.validate(new ISOMsg(100));
    assertNotNull("result", result);
}
Also used : MSGTEST(org.jpos.iso.validator.MSGTEST) ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) Test(org.junit.Test)

Example 3 with IVA_ALPHANUM

use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.

the class ISOBaseValidatingPackagerTest method testValidateThrowsNullPointerException4.

@Test
public void testValidateThrowsNullPointerException4() throws Throwable {
    ISOVError FirstError = new ISOVError("testISOBaseValidatingPackagerDescription", "testISOBaseValidatingPackagerRejectCode");
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[1];
    msgVlds[0] = new MSGTEST02();
    ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
    fvlds[0] = new IVA_ALPHANUM("testISOBaseValidatingPackagerDescription");
    ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
    iSOBaseValidatingPackager.setFieldValidator(fvlds);
    iSOBaseValidatingPackager.setMsgValidator(msgVlds);
    ISOComponent m = new ISOVMsg(new ISOMsg(), FirstError);
    try {
        iSOBaseValidatingPackager.validate(m);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOComponent(org.jpos.iso.ISOComponent) ISOVError(org.jpos.iso.ISOVError) ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Example 4 with IVA_ALPHANUM

use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.

the class ISOBaseValidatingPackagerTest method testValidateThrowsISOException1.

@Test
public void testValidateThrowsISOException1() throws Throwable {
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[2];
    msgVlds[0] = new TEST0100(true);
    ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
    iSOBaseValidatingPackager.setMsgValidator(msgVlds);
    ISOFieldValidator[] fvlds = new ISOFieldValidator[3];
    fvlds[0] = new IVA_ALPHANUM();
    iSOBaseValidatingPackager.setFieldValidator(fvlds);
    try {
        iSOBaseValidatingPackager.validate(new ISOMsg(100));
        fail("Expected ISOException to be thrown");
    } catch (ISOException ex) {
        assertEquals("ex.getMessage()", "can't getMTI on inner message", ex.getMessage());
        assertNull("ex.getNested()", ex.getNested());
    }
}
Also used : ISOException(org.jpos.iso.ISOException) ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) TEST0100(org.jpos.iso.validator.TEST0100) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) Test(org.junit.Test)

Example 5 with IVA_ALPHANUM

use of org.jpos.iso.IVA_ALPHANUM in project jPOS by jpos.

the class ISOBaseValidatingPackagerTest method testValidate12.

@Test
public void testValidate12() throws Throwable {
    ISOBaseValidator[] msgVlds = new ISOBaseValidator[1];
    msgVlds[0] = new MSGTEST02();
    ISOFieldValidator[] fvlds = new ISOFieldValidator[1];
    fvlds[0] = new IVA_ALPHANUM("testISOBaseValidatingPackagerDescription");
    ISOBaseValidatingPackager iSOBaseValidatingPackager = new ISOBaseValidatingPackager();
    iSOBaseValidatingPackager.setFieldValidator(fvlds);
    iSOBaseValidatingPackager.setMsgValidator(msgVlds);
    ISOVMsg result = (ISOVMsg) iSOBaseValidatingPackager.validate(new ISOMsg("testISOBaseValidatingPackagerMti"));
    assertNotNull("result", result);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) IVA_ALPHANUM(org.jpos.iso.IVA_ALPHANUM) ISOBaseValidator(org.jpos.iso.ISOBaseValidator) ISOVMsg(org.jpos.iso.ISOVMsg) ISOFieldValidator(org.jpos.iso.ISOFieldValidator) MSGTEST02(org.jpos.iso.validator.MSGTEST02) Test(org.junit.Test)

Aggregations

IVA_ALPHANUM (org.jpos.iso.IVA_ALPHANUM)6 Test (org.junit.Test)6 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)5 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)5 ISOMsg (org.jpos.iso.ISOMsg)5 ISOVMsg (org.jpos.iso.ISOVMsg)3 MSGTEST (org.jpos.iso.validator.MSGTEST)2 MSGTEST02 (org.jpos.iso.validator.MSGTEST02)2 ObjectName (javax.management.ObjectName)1 ISOComponent (org.jpos.iso.ISOComponent)1 ISOException (org.jpos.iso.ISOException)1 ISOVError (org.jpos.iso.ISOVError)1 ISOVException (org.jpos.iso.validator.ISOVException)1 TEST0100 (org.jpos.iso.validator.TEST0100)1