Skip to content

Commit

Permalink
Updated inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Sep 16, 2024
1 parent 5484456 commit 2eed802
Show file tree
Hide file tree
Showing 8 changed files with 409 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class PeppolItalyValidation2_2_9
public static final String VERSION_STR = "2.2.9";

// Standard
private static final String GROUP_ID = "it.peppol";
public static final String GROUP_ID = "it.peppol";
public static final DVRCoordinate VID_DESPATCH_ADVICE = PhiveRulesHelper.createCoordinate (GROUP_ID,
"despatch-advice",
VERSION_STR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class PeppolItalyValidation2_3_0
public static final String VERSION_STR = "2.3.0";

// Standard
private static final String GROUP_ID = "it.peppol";
public static final String GROUP_ID = "it.peppol";

public static final DVRCoordinate VID_DESPATCH_ADVICE = PhiveRulesHelper.createCoordinate (GROUP_ID,
"despatch-advice",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class PeppolItalyValidation3_0_2
public static final String VERSION_STR = "3.0.2";

// Standard
private static final String GROUP_ID = "it.peppol";
public static final String GROUP_ID = "it.peppol";

public static final DVRCoordinate VID_CREDIT_NOTE = PhiveRulesHelper.createCoordinate (GROUP_ID,
"creditnote",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class PeppolItalyValidation3_1_0
public static final String VERSION_STR = "3.1.0";

// Standard
private static final String GROUP_ID = "it.peppol";
public static final String GROUP_ID = "it.peppol";

public static final DVRCoordinate VID_CREDIT_NOTE = PhiveRulesHelper.createCoordinate (GROUP_ID,
"creditnote",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.helger.phive.api.executorset.IValidationExecutorSet;
import com.helger.phive.api.mock.TestFile;
import com.helger.phive.api.result.ValidationResultList;
import com.helger.phive.api.validity.IValidityDeterminator;
import com.helger.phive.xml.source.IValidationSourceXML;
import com.helger.phive.xml.source.ValidationSourceXML;
import com.helger.phive.xrechnung.mock.CTestFiles;
Expand Down Expand Up @@ -64,7 +65,10 @@ public void testApplyCompleteValidation ()

// Read as desired type
final IValidationSourceXML aSource = ValidationSourceXML.create (aTestFile.getResource ().getPath (), aNode);
final ValidationResultList aErrors = ValidationExecutionManager.executeValidation (aExecutors, aSource, Locale.US);
final ValidationResultList aErrors = ValidationExecutionManager.executeValidation (IValidityDeterminator.getDefault (),
aExecutors,
aSource,
Locale.US);
if (aTestFile.isGoodCase ())
assertTrue (aErrors.getAllErrors ().toString (), aErrors.containsNoError ());
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@
import org.junit.Test;

import com.helger.commons.io.resource.IReadableResource;
import com.helger.phive.api.EValidationType;
import com.helger.phive.api.artefact.IValidationArtefact;
import com.helger.phive.api.execute.IValidationExecutor;
import com.helger.phive.api.executorset.IValidationExecutorSet;
import com.helger.phive.rules.api.PhiveRulesTestHelper;
import com.helger.phive.xml.source.IValidationSourceXML;
import com.helger.phive.xrechnung.mock.CTestFiles;
import com.helger.schematron.pure.SchematronResourcePure;
import com.helger.schematron.sch.SchematronResourceSCH;
import com.helger.schematron.xslt.SchematronResourceXSLT;

/**
* Test class for class {@link XRechnungValidation}.
Expand All @@ -54,19 +50,6 @@ public void testSchematronsValid ()
{
for (final IValidationExecutorSet <IValidationSourceXML> aVES : CTestFiles.VES_REGISTRY.getAll ())
for (final IValidationExecutor <IValidationSourceXML> aVE : aVES)
{
final IValidationArtefact aVA = aVE.getValidationArtefact ();
final IReadableResource aRes = aVA.getRuleResource ();

// Check that the passed Schematron is valid
if (aVA.getValidationArtefactType () == EValidationType.SCHEMATRON_PURE)
assertTrue (aRes.toString (), new SchematronResourcePure (aRes).isValidSchematron ());
else
if (aVA.getValidationArtefactType () == EValidationType.SCHEMATRON_SCH)
assertTrue (aRes.toString (), new SchematronResourceSCH (aRes).isValidSchematron ());
else
if (aVA.getValidationArtefactType () == EValidationType.SCHEMATRON_XSLT)
assertTrue (aRes.toString (), new SchematronResourceXSLT (aRes).isValidSchematron ());
}
assertTrue (PhiveRulesTestHelper.isContentCorrect (aVE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.helger.commons.collection.impl.ICommonsList;
import com.helger.commons.io.resource.ClassPathResource;
import com.helger.commons.io.resource.IReadableResource;
import com.helger.diver.api.version.VESID;
import com.helger.diver.api.coord.DVRCoordinate;
import com.helger.phive.api.executorset.ValidationExecutorSetRegistry;
import com.helger.phive.api.mock.TestFile;
import com.helger.phive.en16931.EN16931Validation;
Expand All @@ -53,49 +53,49 @@ private CTestFiles ()
public static ICommonsList <TestFile> getAllTestFiles ()
{
final ICommonsList <TestFile> ret = new CommonsArrayList <> ();
for (final VESID aESID : new VESID [] { XRechnungValidation.VID_XRECHNUNG_CII_302,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_302,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_302,
for (final DVRCoordinate aESID : new DVRCoordinate [] { XRechnungValidation.VID_XRECHNUNG_CII_302,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_302,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_302,

XRechnungValidation.VID_XRECHNUNG_CII_301,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_301,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_301,
XRechnungValidation.VID_XRECHNUNG_CII_301,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_301,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_301,

XRechnungValidation.VID_XRECHNUNG_CII_300,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_300,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_300,
XRechnungValidation.VID_XRECHNUNG_CII_300,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_300,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_300,

XRechnungValidation.VID_XRECHNUNG_CII_231,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_231,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_231,
XRechnungValidation.VID_XRECHNUNG_CII_231,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_231,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_231,

XRechnungValidation.VID_XRECHNUNG_CII_220,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_220,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_220,
XRechnungValidation.VID_XRECHNUNG_CII_220,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_220,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_220,

XRechnungValidation.VID_XRECHNUNG_CII_120,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_120,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_120,
XRechnungValidation.VID_XRECHNUNG_CII_120,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_120,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_120,

XRechnungValidation.VID_XRECHNUNG_CII_121,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_121,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_121,
XRechnungValidation.VID_XRECHNUNG_CII_121,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_121,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_121,

XRechnungValidation.VID_XRECHNUNG_CII_122,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_122,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_122,
XRechnungValidation.VID_XRECHNUNG_CII_122,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_122,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_122,

XRechnungValidation.VID_XRECHNUNG_CII_200,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_200,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_200,
XRechnungValidation.VID_XRECHNUNG_CII_200,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_200,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_200,

XRechnungValidation.VID_XRECHNUNG_CII_201,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_201,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_201,
XRechnungValidation.VID_XRECHNUNG_CII_201,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_201,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_201,

XRechnungValidation.VID_XRECHNUNG_CII_211,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_211,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_211, })
XRechnungValidation.VID_XRECHNUNG_CII_211,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_211,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_211, })
for (final IReadableResource aRes : getAllMatchingTestFiles (aESID))
{
assertTrue ("Not existing test file: " + aRes.getPath (), aRes.exists ());
Expand All @@ -106,7 +106,7 @@ public static ICommonsList <TestFile> getAllTestFiles ()

@Nonnull
@ReturnsMutableCopy
public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles (@Nonnull final VESID aVESID)
public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles (@Nonnull final DVRCoordinate aVESID)
{
ValueEnforcer.notNull (aVESID, "VESID");

Expand Down

0 comments on commit 2eed802

Please sign in to comment.