Search in sources :

Example 31 with IParticipantIdentifier

use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.

the class BDXRClientReadOnlyTest method testGetBDXRHostURI_BDXR.

@Test
@Ignore("Because it may take long to execute")
@IgnoredNaptrTest
public void testGetBDXRHostURI_BDXR() throws SMPDNSResolutionException {
    final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:test");
    // BDXR URL provider
    final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(BDXLURLProvider.INSTANCE, aPI, ESML.DIGIT_TEST);
    assertEquals("http://test-infra.peppol.at/", aBDXRClient.getSMPHostURI());
}
Also used : IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Ignore(org.junit.Ignore) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) Test(org.junit.Test)

Example 32 with IParticipantIdentifier

use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.

the class BDXRClientReadOnlyTest method testGetBDXRHostURI_Peppol_WithBDXR.

@Test
public void testGetBDXRHostURI_Peppol_WithBDXR() throws SMPClientException, SMPDNSResolutionException {
    // This instance has a BOM inside
    final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9917:5504033150");
    final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(PeppolURLProvider.INSTANCE, aPI, ESML.DIGIT_PRODUCTION);
    assertEquals("http://B-2f67a0710cbc13c11ac8c0d64186ac5e.iso6523-actorid-upis.edelivery.tech.ec.europa.eu/", aBDXRClient.getSMPHostURI());
    // not OASIS!
    try {
        aBDXRClient.getServiceGroupOrNull(aPI);
        fail();
    } catch (final SMPClientBadResponseException ex) {
    // Expected "Malformed XML document returned from SMP server"
    }
}
Also used : SMPClientBadResponseException(com.helger.smpclient.exception.SMPClientBadResponseException) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) IgnoredNaptrTest(com.helger.smpclient.IgnoredNaptrTest) Test(org.junit.Test)

Example 33 with IParticipantIdentifier

use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.

the class PeppolURLProviderTest method testGetSMPURIOfParticipant.

@Test
public void testGetSMPURIOfParticipant() throws URISyntaxException, MalformedURLException, SMPDNSResolutionException {
    final IParticipantIdentifier aPI = IF.createParticipantIdentifierWithDefaultScheme("0088:123ABC");
    final URI aURI = INSTANCE.getSMPURIOfParticipant(aPI, ESML.DIGIT_PRODUCTION);
    assertEquals(new URI("http://B-f5e78500450d37de5aabe6648ac3bb70.iso6523-actorid-upis.edelivery.tech.ec.europa.eu"), aURI);
    final URL aURL = INSTANCE.getSMPURLOfParticipant(aPI, ESML.DIGIT_PRODUCTION);
    assertEquals(new URL("http://B-f5e78500450d37de5aabe6648ac3bb70.iso6523-actorid-upis.edelivery.tech.ec.europa.eu"), aURL);
}
Also used : URI(java.net.URI) URL(java.net.URL) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Example 34 with IParticipantIdentifier

use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.

the class BDXR2IdentifierFactoryTest method testParticipantIDCaseInsensitive.

@Test
public void testParticipantIDCaseInsensitive() {
    final BDXR2IdentifierFactory aIF = BDXR2IdentifierFactory.INSTANCE;
    final String sScheme = PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME;
    final IParticipantIdentifier aID1 = aIF.createParticipantIdentifier(sScheme, "abc");
    assertEquals(sScheme, aID1.getScheme());
    assertEquals("abc", aID1.getValue());
    // Value is lower cased internally
    final IParticipantIdentifier aID2 = aIF.createParticipantIdentifier(sScheme, "ABC");
    assertEquals(sScheme, aID2.getScheme());
    assertEquals("abc", aID2.getValue());
    assertTrue(aID1.hasSameContent(aID2));
}
Also used : IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Example 35 with IParticipantIdentifier

use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.

the class BDXR2IdentifierFactoryTest method testParticipantIDCaseSensitive.

@Test
public void testParticipantIDCaseSensitive() {
    final BDXR2IdentifierFactory aIF = BDXR2IdentifierFactory.INSTANCE;
    final String sScheme = "cs-actorid-upis";
    final IParticipantIdentifier aID1 = aIF.createParticipantIdentifier(sScheme, "abc");
    assertEquals(sScheme, aID1.getScheme());
    assertEquals("abc", aID1.getValue());
    // Value is NOT lower cased internally
    final IParticipantIdentifier aID2 = aIF.createParticipantIdentifier(sScheme, "ABC");
    assertEquals(sScheme, aID2.getScheme());
    assertEquals("ABC", aID2.getValue());
    assertFalse(aID1.hasSameContent(aID2));
}
Also used : IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Test(org.junit.Test)

Aggregations

IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)218 Test (org.junit.Test)70 IDocumentTypeIdentifier (com.helger.peppolid.IDocumentTypeIdentifier)58 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)57 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)51 ISMPServiceGroup (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroup)47 File (java.io.File)46 Nonnull (javax.annotation.Nonnull)43 ESimpleUserMessageSendResult (com.helger.phase4.sender.AbstractAS4UserMessageBuilder.ESimpleUserMessageSendResult)42 Element (org.w3c.dom.Element)41 SMPClientReadOnly (com.helger.smpclient.peppol.SMPClientReadOnly)40 AS4RawResponseConsumerWriteToFile (com.helger.phase4.dump.AS4RawResponseConsumerWriteToFile)38 AS4IncomingDumperFileBased (com.helger.phase4.dump.AS4IncomingDumperFileBased)35 AS4OutgoingDumperFileBased (com.helger.phase4.dump.AS4OutgoingDumperFileBased)35 SimpleParticipantIdentifier (com.helger.peppolid.simple.participant.SimpleParticipantIdentifier)30 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)24 ISMPServiceInformationManager (com.helger.phoss.smp.domain.serviceinfo.ISMPServiceInformationManager)24 SMPServerException (com.helger.phoss.smp.exception.SMPServerException)24 ISMPServiceInformation (com.helger.phoss.smp.domain.serviceinfo.ISMPServiceInformation)19 ICommonsList (com.helger.commons.collection.impl.ICommonsList)18