Skip to content

Commit

Permalink
[RELEASE] iText 7 7.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jun 20, 2022
2 parents 57a0339 + f93cc75 commit 0ba81c9
Show file tree
Hide file tree
Showing 225 changed files with 4,536 additions and 1,016 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*.xht text eol=lf
*.xhtml text eol=lf
*.xml text eol=lf
*.json text eol=lf
port-hash text eol=lf

# Declare files that will always have CRLF line endings on checkout.
Expand Down
2 changes: 1 addition & 1 deletion doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "iText 7 7.2.2 API"
PROJECT_NAME = "iText 7 7.2.3 API"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

[assembly: Guid("d015a3aa-613c-45d9-b908-7d47c4b613af")]

[assembly: AssemblyVersion("7.2.2.0")]
[assembly: AssemblyFileVersion("7.2.2.0")]
[assembly: AssemblyInformationalVersion("7.2.2")]
[assembly: AssemblyVersion("7.2.3.0")]
[assembly: AssemblyFileVersion("7.2.3.0")]
[assembly: AssemblyInformationalVersion("7.2.3")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.commons.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("502eda37-c014-4822-8e5c-4e5d21b085e9")]

[assembly: AssemblyVersion("7.2.2.0")]
[assembly: AssemblyFileVersion("7.2.2.0")]
[assembly: AssemblyInformationalVersion("7.2.2")]
[assembly: AssemblyVersion("7.2.3.0")]
[assembly: AssemblyFileVersion("7.2.3.0")]
[assembly: AssemblyInformationalVersion("7.2.3")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
using System;
using System.Collections.Generic;
using iText.Commons.Actions.Processors;
using iText.Commons.Actions.Sequence;
using iText.Commons.Ecosystem;
using iText.Commons.Exceptions;
Expand All @@ -30,6 +31,11 @@

namespace iText.Commons.Actions {
public class EventManagerTest : ExtendedITextTest {
[NUnit.Framework.TearDown]
public virtual void AfterEach() {
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
}

[NUnit.Framework.Test]
[LogMessage(TestConfigurationEvent.MESSAGE)]
public virtual void ConfigurationEventTest() {
Expand Down Expand Up @@ -88,6 +94,17 @@ public class EventManagerTest : ExtendedITextTest {
NUnit.Framework.Assert.IsFalse(eventManager.Unregister(handler));
}

[NUnit.Framework.Test]
public virtual void TurningOffAgplTest() {
IProductProcessorFactory defaultProductProcessorFactory = ProductProcessorFactoryKeeper.GetProductProcessorFactory
();
NUnit.Framework.Assert.IsTrue(defaultProductProcessorFactory is DefaultProductProcessorFactory);
EventManager.AcknowledgeAgplUsageDisableWarningMessage();
IProductProcessorFactory underAgplProductProcessorFactory1 = ProductProcessorFactoryKeeper.GetProductProcessorFactory
();
NUnit.Framework.Assert.IsTrue(underAgplProductProcessorFactory1 is UnderAgplProductProcessorFactory);
}

private class ThrowArithmeticExpHandler : IEventHandler {
public virtual void OnEvent(IEvent @event) {
throw new ArithmeticException("ThrowArithmeticExpHandler");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Authors: iText 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.IO;
using iText.Commons.Actions.Confirmations;
using iText.Commons.Actions.Sequence;
using iText.Commons.Ecosystem;
using iText.Commons.Utils;
using iText.Test;

namespace iText.Commons.Actions {
public class ProductEventHandlerIntegrationTest : ExtendedITextTest {
private TextWriter outBackup;

[NUnit.Framework.SetUp]
public virtual void InitTest() {
outBackup = System.Console.Out;
ProductEventHandler.INSTANCE.ClearProcessors();
}

[NUnit.Framework.TearDown]
public virtual void AfterEach() {
System.Console.SetOut(outBackup);
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
ProductEventHandler.INSTANCE.ClearProcessors();
}

[NUnit.Framework.Test]
public virtual void RemoveAGPLLoggingTest() {
MemoryStream testOut = new MemoryStream();
System.Console.SetOut(new FormattingStreamWriter(testOut));

EventManager.AcknowledgeAgplUsageDisableWarningMessage();
for (int i = 0; i < 10001; i++) {

ProductEventHandler handler = ProductEventHandler.INSTANCE;

SequenceId sequenceId = new SequenceId();

NUnit.Framework.Assert.IsTrue(handler.GetEvents(sequenceId).IsEmpty());
ITextTestEvent @event = new ITextTestEvent(sequenceId, null, "test-event",
ProductNameConstant.ITEXT_CORE);
EventManager.GetInstance().OnEvent(@event);

ConfirmEvent confirmEvent = new ConfirmEvent(sequenceId, @event);
EventManager.GetInstance().OnEvent(confirmEvent);

NUnit.Framework.Assert.AreEqual(1, handler.GetEvents(sequenceId).Count);
NUnit.Framework.Assert.IsTrue(handler.GetEvents(sequenceId)[0] is ConfirmedEventWrapper);
NUnit.Framework.Assert.AreEqual(@event, ((ConfirmedEventWrapper)handler.GetEvents(sequenceId)[0]).GetEvent
());
}
using (var reader = new StreamReader(testOut))
{
NUnit.Framework.Assert.AreEqual("", reader.ReadToEnd());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class ProductEventHandlerTest : ExtendedITextTest {
ProductEventHandler.INSTANCE.ClearProcessors();
}

[NUnit.Framework.TearDown]
public virtual void AfterEach() {
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
}

[NUnit.Framework.Test]
public virtual void UnknownProductTest() {
ProductEventHandler handler = ProductEventHandler.INSTANCE;
Expand Down Expand Up @@ -92,6 +97,17 @@ public class ProductEventHandlerTest : ExtendedITextTest {
());
}

[NUnit.Framework.Test]
public virtual void SettingCustomProcessFactoryTest() {
ProductEventHandlerTest.CustomFactory productProcessorFactory = new ProductEventHandlerTest.CustomFactory(
);
productProcessorFactory.CreateProcessor(ProductNameConstant.ITEXT_CORE);
ProductProcessorFactoryKeeper.SetProductProcessorFactory(productProcessorFactory);
ProductEventHandler handler = ProductEventHandler.INSTANCE;
ITextProductEventProcessor activeProcessor = handler.GetActiveProcessor(ProductNameConstant.ITEXT_CORE);
NUnit.Framework.Assert.IsTrue(activeProcessor is ProductEventHandlerTest.TestProductEventProcessor);
}

[NUnit.Framework.Test]
public virtual void RepeatEventHandlingWithFiveExceptionOnProcessingTest() {
ProductEventHandler handler = ProductEventHandler.INSTANCE;
Expand Down Expand Up @@ -121,6 +137,26 @@ public class ProductEventHandlerTest : ExtendedITextTest {
NUnit.Framework.Assert.DoesNotThrow(() => handler.OnAcceptedEvent(@event));
}

private class CustomFactory : IProductProcessorFactory {
public virtual ITextProductEventProcessor CreateProcessor(String productName) {
return new ProductEventHandlerTest.TestProductEventProcessor(productName);
}
}

private class TestProductEventProcessor : AbstractITextProductEventProcessor {
public TestProductEventProcessor(String productName)
: base(productName) {
}

public override void OnEvent(AbstractProductProcessITextEvent @event) {
}

// do nothing
public override String GetUsageType() {
return "AGPL";
}
}

private class RepeatEventProcessor : ITextProductEventProcessor {
private readonly int exceptionsCount;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Authors: iText 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 iText.Commons.Actions.Processors;
using iText.Test;

namespace iText.Commons.Actions {
public class ProductProcessorFactoryKeeperTest : ExtendedITextTest {
[NUnit.Framework.TearDown]
public virtual void AfterEach() {
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
}

[NUnit.Framework.Test]
public virtual void GettingDefaultFactoryFromKeeper() {
IProductProcessorFactory productProcessorFactory = ProductProcessorFactoryKeeper.GetProductProcessorFactory
();
NUnit.Framework.Assert.IsTrue(productProcessorFactory is DefaultProductProcessorFactory);
}

[NUnit.Framework.Test]
public virtual void RestoringDefaultFactory() {
ProductProcessorFactoryKeeper.SetProductProcessorFactory(new UnderAgplProductProcessorFactory());
NUnit.Framework.Assert.IsTrue(ProductProcessorFactoryKeeper.GetProductProcessorFactory() is UnderAgplProductProcessorFactory
);
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
NUnit.Framework.Assert.IsTrue(ProductProcessorFactoryKeeper.GetProductProcessorFactory() is DefaultProductProcessorFactory
);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Authors: iText 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 iText.Commons.Actions;
using iText.Test;

namespace iText.Commons.Actions.Processors {
public class DefaultProductProcessorFactoryTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void CreateDefaultProductProcessor() {
DefaultProductProcessorFactory defaultProductProcessorFactory = new DefaultProductProcessorFactory();
ITextProductEventProcessor processor = defaultProductProcessorFactory.CreateProcessor(ProductNameConstant.
ITEXT_CORE);
NUnit.Framework.Assert.IsNotNull(processor);
NUnit.Framework.Assert.IsTrue(processor is DefaultITextProductEventProcessor);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Authors: iText 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 iText.Commons.Actions;
using iText.Commons.Actions.Confirmations;
using iText.Commons.Actions.Data;
using iText.Commons.Actions.Sequence;
using iText.Commons.Ecosystem;
using iText.Test;

namespace iText.Commons.Actions.Processors {
public class UnderAgplITextProductEventProcessorTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void MessageIsNotLoggedTest() {
UnderAgplITextProductEventProcessor testProcessor = new UnderAgplITextProductEventProcessor(ProductNameConstant
.ITEXT_CORE);
ITextTestEvent e = new ITextTestEvent(new SequenceId(), CommonsProductData.GetInstance(), null, "test event"
);
NUnit.Framework.Assert.DoesNotThrow(() => testProcessor.OnEvent(new ConfirmEvent(e)));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Authors: iText 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 iText.Commons.Actions;
using iText.Test;

namespace iText.Commons.Actions.Processors {
public class UnderAgplProductProcessorFactoryTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void CreateUnderAgplProductProcessor() {
UnderAgplProductProcessorFactory underAgplProductProcessorFactory = new UnderAgplProductProcessorFactory();
ITextProductEventProcessor processor = underAgplProductProcessorFactory.CreateProcessor(ProductNameConstant
.ITEXT_CORE);
NUnit.Framework.Assert.IsNotNull(processor);
NUnit.Framework.Assert.IsTrue(processor is UnderAgplITextProductEventProcessor);
}
}
}

0 comments on commit 0ba81c9

Please sign in to comment.