Skip to content

Commit 491988d

Browse files
Artyom Yanchevskyyulian-gaponenko
authored andcommitted
Unify naming of ProdcutData and ProductEvent classes
DEVSIX-5811 Autoported commit. Original commit hash: [26aea18a9]
1 parent 5572681 commit 491988d

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

itext.tests/itext.kernel.tests/itext/kernel/counter/event/ITextCoreEventTest.cs renamed to itext.tests/itext.kernel.tests/itext/kernel/counter/event/ITextCoreProductEventTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ source product.
4848
using iText.Test;
4949

5050
namespace iText.Kernel.Counter.Event {
51-
public class ITextCoreEventTest : ExtendedITextTest {
51+
public class ITextCoreProductEventTest : ExtendedITextTest {
5252
[NUnit.Framework.Test]
5353
public virtual void OpenDocumentEventTest() {
5454
SequenceId sequenceId = new SequenceId();
55-
ITextCoreEvent @event = ITextCoreEvent.CreateProcessPdfEvent(sequenceId, new TestMetaInfo("meta data"), EventConfirmationType
56-
.ON_CLOSE);
57-
NUnit.Framework.Assert.AreEqual(ITextCoreEvent.PROCESS_PDF, @event.GetEventType());
55+
ITextCoreProductEvent @event = ITextCoreProductEvent.CreateProcessPdfEvent(sequenceId, new TestMetaInfo("meta data"
56+
), EventConfirmationType.ON_CLOSE);
57+
NUnit.Framework.Assert.AreEqual(ITextCoreProductEvent.PROCESS_PDF, @event.GetEventType());
5858
NUnit.Framework.Assert.AreEqual(ProductNameConstant.ITEXT_CORE, @event.GetProductName());
5959
NUnit.Framework.Assert.AreEqual(EventConfirmationType.ON_CLOSE, @event.GetConfirmationType());
6060
NUnit.Framework.Assert.AreEqual(sequenceId, @event.GetSequenceId());

itext.tests/itext.layout.tests/itext/layout/CanvasTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public virtual void AddBlockElemMethodLinkingTest() {
231231
}
232232
// Second event was linked by adding block element method
233233
NUnit.Framework.Assert.AreEqual(2, events.Count);
234-
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreEvent);
234+
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreProductEvent);
235235
NUnit.Framework.Assert.IsTrue(events[1] is TestProductEvent);
236236
}
237237
}
@@ -252,7 +252,7 @@ public virtual void AddImageElemMethodLinkingTest() {
252252
}
253253
// Second event was linked by adding block element method
254254
NUnit.Framework.Assert.AreEqual(2, events.Count);
255-
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreEvent);
255+
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreProductEvent);
256256
NUnit.Framework.Assert.IsTrue(events[1] is TestProductEvent);
257257
}
258258
}

itext.tests/itext.layout.tests/itext/layout/DocumentTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public virtual void AddBlockElemMethodLinkingTest() {
6464
.GetDocumentIdWrapper());
6565
// Second event was linked by adding block element method
6666
NUnit.Framework.Assert.AreEqual(2, events.Count);
67-
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreEvent);
67+
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreProductEvent);
6868
NUnit.Framework.Assert.IsTrue(events[1] is TestProductEvent);
6969
}
7070
}
@@ -80,7 +80,7 @@ public virtual void AddAreaBreakElemMethodLinkingTest() {
8080
IList<AbstractProductProcessITextEvent> events = CONFIGURATION_ACCESS.GetPublicEvents(doc.GetPdfDocument()
8181
.GetDocumentIdWrapper());
8282
NUnit.Framework.Assert.AreEqual(1, events.Count);
83-
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreEvent);
83+
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreProductEvent);
8484
}
8585
}
8686

@@ -96,7 +96,7 @@ public virtual void AddImageElemMethodLinkingTest() {
9696
.GetDocumentIdWrapper());
9797
// Second event was linked by adding block element
9898
NUnit.Framework.Assert.AreEqual(2, events.Count);
99-
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreEvent);
99+
NUnit.Framework.Assert.IsTrue(events[0] is ITextCoreProductEvent);
100100
NUnit.Framework.Assert.IsTrue(events[1] is TestProductEvent);
101101
}
102102
}

itext/itext.kernel/itext/kernel/counter/event/ITextCoreEvent.cs renamed to itext/itext.kernel/itext/kernel/counter/event/ITextCoreProductEvent.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You should have received a copy of the GNU Affero General Public License
2929

3030
namespace iText.Kernel.Counter.Event {
3131
/// <summary>Class represents events registered in iText core module.</summary>
32-
public class ITextCoreEvent : AbstractProductProcessITextEvent {
32+
public class ITextCoreProductEvent : AbstractProductProcessITextEvent {
3333
/// <summary>Process pdf event type.</summary>
3434
public const String PROCESS_PDF = "process-pdf";
3535

@@ -43,8 +43,8 @@ public class ITextCoreEvent : AbstractProductProcessITextEvent {
4343
/// defines when the event should be confirmed to notify that the
4444
/// associated process has finished successfully
4545
/// </param>
46-
private ITextCoreEvent(SequenceId sequenceId, IMetaInfo metaInfo, String eventType, EventConfirmationType
47-
confirmationType)
46+
private ITextCoreProductEvent(SequenceId sequenceId, IMetaInfo metaInfo, String eventType, EventConfirmationType
47+
confirmationType)
4848
: base(sequenceId, ITextCoreProductData.GetInstance(), metaInfo, confirmationType) {
4949
this.eventType = eventType;
5050
}
@@ -58,9 +58,10 @@ private ITextCoreEvent(SequenceId sequenceId, IMetaInfo metaInfo, String eventTy
5858
/// associated process has finished successfully
5959
/// </param>
6060
/// <returns>the process pdf event</returns>
61-
public static iText.Kernel.Counter.Event.ITextCoreEvent CreateProcessPdfEvent(SequenceId sequenceId, IMetaInfo
62-
metaInfo, EventConfirmationType confirmationType) {
63-
return new iText.Kernel.Counter.Event.ITextCoreEvent(sequenceId, metaInfo, PROCESS_PDF, confirmationType);
61+
public static iText.Kernel.Counter.Event.ITextCoreProductEvent CreateProcessPdfEvent(SequenceId sequenceId
62+
, IMetaInfo metaInfo, EventConfirmationType confirmationType) {
63+
return new iText.Kernel.Counter.Event.ITextCoreProductEvent(sequenceId, metaInfo, PROCESS_PDF, confirmationType
64+
);
6465
}
6566

6667
public override String GetEventType() {

itext/itext.kernel/itext/kernel/pdf/PdfDocument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,8 +1984,8 @@ protected internal virtual void Open(PdfVersion newPdfVersion) {
19841984
this.fingerPrint = new FingerPrint();
19851985
this.encryptedEmbeddedStreamsHandler = new EncryptedEmbeddedStreamsHandler(this);
19861986
try {
1987-
ITextCoreEvent @event = ITextCoreEvent.CreateProcessPdfEvent(this.GetDocumentIdWrapper(), properties.metaInfo
1988-
, writer == null ? EventConfirmationType.ON_DEMAND : EventConfirmationType.ON_CLOSE);
1987+
ITextCoreProductEvent @event = ITextCoreProductEvent.CreateProcessPdfEvent(this.GetDocumentIdWrapper(), properties
1988+
.metaInfo, writer == null ? EventConfirmationType.ON_DEMAND : EventConfirmationType.ON_CLOSE);
19891989
EventManager.GetInstance().OnEvent(@event);
19901990
EventCounterHandler.GetInstance().OnEvent(CoreEvent.PROCESS, properties.metaInfo, GetType());
19911991
bool embeddedStreamsSavedOnReading = false;

0 commit comments

Comments
 (0)