Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Dec 3, 2024
2 parents ab09966 + 81c0195 commit 007001c
Show file tree
Hide file tree
Showing 184 changed files with 1,966 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ You should have received a copy of the GNU Affero General Public License
using System;
using iText.Svg.Renderers;
using iText.Test;
using iText.Test.Attributes;

namespace iText.Svg.Css {
public class AttributesRelativeUnitTest : SvgIntegrationTest {
Expand All @@ -39,50 +38,32 @@ public static void BeforeClass() {
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void RectangleAttributesEmUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesEmUnits");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void RectangleAttributesExUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesExUnits");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void RectangleAttributesPercentUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesPercentUnits");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void ImageAttributesEmUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesEmUnits");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void ImageAttributesExUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesExUnits");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
, Count = 4)]
public virtual void ImageAttributesPercentUnitsTest() {
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesPercentUnits");
}
}
Expand Down
58 changes: 58 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/css/BaselineTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Renderers;
using iText.Test;

namespace iText.Svg.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class BaselineTest : SvgIntegrationTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/css/BaselineTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/css/BaselineTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void AlignmentBaselineTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "alignment-base");
}

[NUnit.Framework.Test]
public virtual void BaselineShiftTest() {
//TODO DEVSIX-2507: change cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "baseline-shift");
}

[NUnit.Framework.Test]
public virtual void DominantBaselineTest() {
//TODO DEVSIX-5890: update cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "dominant-baseline");
}
}
}
77 changes: 77 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/css/ColorTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Processors.Impl;
using iText.Svg.Renderers;
using iText.Test;

namespace iText.Svg.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class ColorTest : SvgIntegrationTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/css/ColorTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/css/ColorTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void BackgroundColorTest() {
//TODO DEVSIX-7156: update cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "background-color");
}

[NUnit.Framework.Test]
public virtual void CurrentColorTest() {
//TODO DEVSIX-8758: update cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "current-color");
}

[NUnit.Framework.Test]
public virtual void InterpolationColorTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "color-interpolation");
}

[NUnit.Framework.Test]
public virtual void InterpolationFilterColorTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "color-interpolation-filter");
}

[NUnit.Framework.Test]
public virtual void ColorProfileTest() {
//TODO DEVSIX-2259: update cmp after supporting
SvgConverterProperties properties = new SvgConverterProperties().SetBaseUri(SOURCE_FOLDER);
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "color-profile", properties);
}

[NUnit.Framework.Test]
public virtual void ColorTypesTest() {
//TODO DEVSIX-8748: update cmp files after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "color-types");
}
}
}
47 changes: 47 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/css/DirectionTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Renderers;
using iText.Test;

namespace iText.Svg.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class DirectionTest : SvgIntegrationTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/css/DirectionTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/css/DirectionTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void DirectionAttributeTest() {
//TODO DEVSIX-8779: update cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "direction");
}
}
}
49 changes: 49 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/css/DisplayTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Logs;
using iText.Svg.Renderers;
using iText.Test;
using iText.Test.Attributes;

namespace iText.Svg.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class DisplayTest : SvgIntegrationTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/css/DisplayTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/css/DisplayTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
[LogMessage(SvgLogMessageConstant.UNMAPPED_TAG)]
public virtual void DisplayAttributeTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "display");
}
}
}
72 changes: 72 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/css/FilterTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Renderers;
using iText.Test;

namespace iText.Svg.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class FilterTest : SvgIntegrationTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/css/FilterTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/css/FilterTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void BasicFilterTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "filter");
}

[NUnit.Framework.Test]
public virtual void FeGaussianBlurTest() {
//TODO DEVSIX-8752: update cmp file after supporting
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "feGaussianBlur");
}

[NUnit.Framework.Test]
public virtual void PrimitiveUnitsTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "primitive-units");
}

[NUnit.Framework.Test]
public virtual void RadiusTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "radius");
}

[NUnit.Framework.Test]
public virtual void FloodAttributeTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "flood");
}

[NUnit.Framework.Test]
public virtual void LightingColorTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "lighting-color");
}
}
}
Loading

0 comments on commit 007001c

Please sign in to comment.