Skip to content

Commit 0ba81c9

Browse files
committed
[RELEASE] iText 7 7.2.3
2 parents 57a0339 + f93cc75 commit 0ba81c9

File tree

225 files changed

+4536
-1016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+4536
-1016
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*.xht text eol=lf
2121
*.xhtml text eol=lf
2222
*.xml text eol=lf
23+
*.json text eol=lf
2324
port-hash text eol=lf
2425

2526
# Declare files that will always have CRLF line endings on checkout.

doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "iText 7 7.2.2 API"
35+
PROJECT_NAME = "iText 7 7.2.3 API"
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version

itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

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

17-
[assembly: AssemblyVersion("7.2.2.0")]
18-
[assembly: AssemblyFileVersion("7.2.2.0")]
19-
[assembly: AssemblyInformationalVersion("7.2.2")]
17+
[assembly: AssemblyVersion("7.2.3.0")]
18+
[assembly: AssemblyFileVersion("7.2.3.0")]
19+
[assembly: AssemblyInformationalVersion("7.2.3")]
2020

2121
#if !NETSTANDARD2_0
2222
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.commons.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

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

18-
[assembly: AssemblyVersion("7.2.2.0")]
19-
[assembly: AssemblyFileVersion("7.2.2.0")]
20-
[assembly: AssemblyInformationalVersion("7.2.2")]
18+
[assembly: AssemblyVersion("7.2.3.0")]
19+
[assembly: AssemblyFileVersion("7.2.3.0")]
20+
[assembly: AssemblyInformationalVersion("7.2.3")]
2121

2222
#if !NETSTANDARD2_0
2323
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.commons.tests/itext/commons/actions/EventManagerTest.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
2222
*/
2323
using System;
2424
using System.Collections.Generic;
25+
using iText.Commons.Actions.Processors;
2526
using iText.Commons.Actions.Sequence;
2627
using iText.Commons.Ecosystem;
2728
using iText.Commons.Exceptions;
@@ -30,6 +31,11 @@ You should have received a copy of the GNU Affero General Public License
3031

3132
namespace iText.Commons.Actions {
3233
public class EventManagerTest : ExtendedITextTest {
34+
[NUnit.Framework.TearDown]
35+
public virtual void AfterEach() {
36+
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
37+
}
38+
3339
[NUnit.Framework.Test]
3440
[LogMessage(TestConfigurationEvent.MESSAGE)]
3541
public virtual void ConfigurationEventTest() {
@@ -88,6 +94,17 @@ public virtual void ConfigureHandlersTest() {
8894
NUnit.Framework.Assert.IsFalse(eventManager.Unregister(handler));
8995
}
9096

97+
[NUnit.Framework.Test]
98+
public virtual void TurningOffAgplTest() {
99+
IProductProcessorFactory defaultProductProcessorFactory = ProductProcessorFactoryKeeper.GetProductProcessorFactory
100+
();
101+
NUnit.Framework.Assert.IsTrue(defaultProductProcessorFactory is DefaultProductProcessorFactory);
102+
EventManager.AcknowledgeAgplUsageDisableWarningMessage();
103+
IProductProcessorFactory underAgplProductProcessorFactory1 = ProductProcessorFactoryKeeper.GetProductProcessorFactory
104+
();
105+
NUnit.Framework.Assert.IsTrue(underAgplProductProcessorFactory1 is UnderAgplProductProcessorFactory);
106+
}
107+
91108
private class ThrowArithmeticExpHandler : IEventHandler {
92109
public virtual void OnEvent(IEvent @event) {
93110
throw new ArithmeticException("ThrowArithmeticExpHandler");
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2022 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using System.IO;
24+
using iText.Commons.Actions.Confirmations;
25+
using iText.Commons.Actions.Sequence;
26+
using iText.Commons.Ecosystem;
27+
using iText.Commons.Utils;
28+
using iText.Test;
29+
30+
namespace iText.Commons.Actions {
31+
public class ProductEventHandlerIntegrationTest : ExtendedITextTest {
32+
private TextWriter outBackup;
33+
34+
[NUnit.Framework.SetUp]
35+
public virtual void InitTest() {
36+
outBackup = System.Console.Out;
37+
ProductEventHandler.INSTANCE.ClearProcessors();
38+
}
39+
40+
[NUnit.Framework.TearDown]
41+
public virtual void AfterEach() {
42+
System.Console.SetOut(outBackup);
43+
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
44+
ProductEventHandler.INSTANCE.ClearProcessors();
45+
}
46+
47+
[NUnit.Framework.Test]
48+
public virtual void RemoveAGPLLoggingTest() {
49+
MemoryStream testOut = new MemoryStream();
50+
System.Console.SetOut(new FormattingStreamWriter(testOut));
51+
52+
EventManager.AcknowledgeAgplUsageDisableWarningMessage();
53+
for (int i = 0; i < 10001; i++) {
54+
55+
ProductEventHandler handler = ProductEventHandler.INSTANCE;
56+
57+
SequenceId sequenceId = new SequenceId();
58+
59+
NUnit.Framework.Assert.IsTrue(handler.GetEvents(sequenceId).IsEmpty());
60+
ITextTestEvent @event = new ITextTestEvent(sequenceId, null, "test-event",
61+
ProductNameConstant.ITEXT_CORE);
62+
EventManager.GetInstance().OnEvent(@event);
63+
64+
ConfirmEvent confirmEvent = new ConfirmEvent(sequenceId, @event);
65+
EventManager.GetInstance().OnEvent(confirmEvent);
66+
67+
NUnit.Framework.Assert.AreEqual(1, handler.GetEvents(sequenceId).Count);
68+
NUnit.Framework.Assert.IsTrue(handler.GetEvents(sequenceId)[0] is ConfirmedEventWrapper);
69+
NUnit.Framework.Assert.AreEqual(@event, ((ConfirmedEventWrapper)handler.GetEvents(sequenceId)[0]).GetEvent
70+
());
71+
}
72+
using (var reader = new StreamReader(testOut))
73+
{
74+
NUnit.Framework.Assert.AreEqual("", reader.ReadToEnd());
75+
}
76+
}
77+
}
78+
}

itext.tests/itext.commons.tests/itext/commons/actions/ProductEventHandlerTest.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public virtual void ClearProcessors() {
3636
ProductEventHandler.INSTANCE.ClearProcessors();
3737
}
3838

39+
[NUnit.Framework.TearDown]
40+
public virtual void AfterEach() {
41+
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
42+
}
43+
3944
[NUnit.Framework.Test]
4045
public virtual void UnknownProductTest() {
4146
ProductEventHandler handler = ProductEventHandler.INSTANCE;
@@ -92,6 +97,17 @@ public virtual void ConfirmEventTest() {
9297
());
9398
}
9499

100+
[NUnit.Framework.Test]
101+
public virtual void SettingCustomProcessFactoryTest() {
102+
ProductEventHandlerTest.CustomFactory productProcessorFactory = new ProductEventHandlerTest.CustomFactory(
103+
);
104+
productProcessorFactory.CreateProcessor(ProductNameConstant.ITEXT_CORE);
105+
ProductProcessorFactoryKeeper.SetProductProcessorFactory(productProcessorFactory);
106+
ProductEventHandler handler = ProductEventHandler.INSTANCE;
107+
ITextProductEventProcessor activeProcessor = handler.GetActiveProcessor(ProductNameConstant.ITEXT_CORE);
108+
NUnit.Framework.Assert.IsTrue(activeProcessor is ProductEventHandlerTest.TestProductEventProcessor);
109+
}
110+
95111
[NUnit.Framework.Test]
96112
public virtual void RepeatEventHandlingWithFiveExceptionOnProcessingTest() {
97113
ProductEventHandler handler = ProductEventHandler.INSTANCE;
@@ -121,6 +137,26 @@ public virtual void RepeatEventHandlingWithOneExceptionOnProcessingTest() {
121137
NUnit.Framework.Assert.DoesNotThrow(() => handler.OnAcceptedEvent(@event));
122138
}
123139

140+
private class CustomFactory : IProductProcessorFactory {
141+
public virtual ITextProductEventProcessor CreateProcessor(String productName) {
142+
return new ProductEventHandlerTest.TestProductEventProcessor(productName);
143+
}
144+
}
145+
146+
private class TestProductEventProcessor : AbstractITextProductEventProcessor {
147+
public TestProductEventProcessor(String productName)
148+
: base(productName) {
149+
}
150+
151+
public override void OnEvent(AbstractProductProcessITextEvent @event) {
152+
}
153+
154+
// do nothing
155+
public override String GetUsageType() {
156+
return "AGPL";
157+
}
158+
}
159+
124160
private class RepeatEventProcessor : ITextProductEventProcessor {
125161
private readonly int exceptionsCount;
126162

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2022 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using iText.Commons.Actions.Processors;
24+
using iText.Test;
25+
26+
namespace iText.Commons.Actions {
27+
public class ProductProcessorFactoryKeeperTest : ExtendedITextTest {
28+
[NUnit.Framework.TearDown]
29+
public virtual void AfterEach() {
30+
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
31+
}
32+
33+
[NUnit.Framework.Test]
34+
public virtual void GettingDefaultFactoryFromKeeper() {
35+
IProductProcessorFactory productProcessorFactory = ProductProcessorFactoryKeeper.GetProductProcessorFactory
36+
();
37+
NUnit.Framework.Assert.IsTrue(productProcessorFactory is DefaultProductProcessorFactory);
38+
}
39+
40+
[NUnit.Framework.Test]
41+
public virtual void RestoringDefaultFactory() {
42+
ProductProcessorFactoryKeeper.SetProductProcessorFactory(new UnderAgplProductProcessorFactory());
43+
NUnit.Framework.Assert.IsTrue(ProductProcessorFactoryKeeper.GetProductProcessorFactory() is UnderAgplProductProcessorFactory
44+
);
45+
ProductProcessorFactoryKeeper.RestoreDefaultProductProcessorFactory();
46+
NUnit.Framework.Assert.IsTrue(ProductProcessorFactoryKeeper.GetProductProcessorFactory() is DefaultProductProcessorFactory
47+
);
48+
}
49+
}
50+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2022 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using iText.Commons.Actions;
24+
using iText.Test;
25+
26+
namespace iText.Commons.Actions.Processors {
27+
public class DefaultProductProcessorFactoryTest : ExtendedITextTest {
28+
[NUnit.Framework.Test]
29+
public virtual void CreateDefaultProductProcessor() {
30+
DefaultProductProcessorFactory defaultProductProcessorFactory = new DefaultProductProcessorFactory();
31+
ITextProductEventProcessor processor = defaultProductProcessorFactory.CreateProcessor(ProductNameConstant.
32+
ITEXT_CORE);
33+
NUnit.Framework.Assert.IsNotNull(processor);
34+
NUnit.Framework.Assert.IsTrue(processor is DefaultITextProductEventProcessor);
35+
}
36+
}
37+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2022 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using iText.Commons.Actions;
24+
using iText.Commons.Actions.Confirmations;
25+
using iText.Commons.Actions.Data;
26+
using iText.Commons.Actions.Sequence;
27+
using iText.Commons.Ecosystem;
28+
using iText.Test;
29+
30+
namespace iText.Commons.Actions.Processors {
31+
public class UnderAgplITextProductEventProcessorTest : ExtendedITextTest {
32+
[NUnit.Framework.Test]
33+
public virtual void MessageIsNotLoggedTest() {
34+
UnderAgplITextProductEventProcessor testProcessor = new UnderAgplITextProductEventProcessor(ProductNameConstant
35+
.ITEXT_CORE);
36+
ITextTestEvent e = new ITextTestEvent(new SequenceId(), CommonsProductData.GetInstance(), null, "test event"
37+
);
38+
NUnit.Framework.Assert.DoesNotThrow(() => testProcessor.OnEvent(new ConfirmEvent(e)));
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)