final IUserLayoutChannelDescription channelDescription = EasyMock.createMock(IUserLayoutChannelDescription.class);
EasyMock.expect(channelDescription.getName()).andReturn("chanPub1").anyTimes();
EasyMock.expect(channelDescription.getChannelPublishId()).andReturn("chanPub1").anyTimes();
EasyMock.expect(channelDescription.getChannelSubscribeId()).andReturn("chanSub1").anyTimes();
final IUserLayoutNodeDescription parentNodeDescription = EasyMock.createMock(IUserLayoutNodeDescription.class);
EasyMock.expect(parentNodeDescription.getName()).andReturn("parentNode1").anyTimes();
EasyMock.expect(parentNodeDescription.getId()).andReturn("parentNode1").anyTimes();
EasyMock.replay(channelDescription, parentNodeDescription);
portalEvent = new ChannelAddedToLayoutPortalEvent(this, person, userProfile, channelDescription, parentNodeDescription);
this.jpaPortalEventStore.storePortalEvents(portalEvent);
this.checkPoint();
assertEquals(1, this.countRowsInTable("STATS_SESSION"));
assertEquals(0, this.countRowsInTable("STATS_SESSION_GROUPS"));
assertEquals(8, this.countRowsInTable("STATS_EVENT"));
assertEquals(8, this.countRowsInTable("STATS_EVENT_TYPE"));
assertEquals(4, this.countRowsInTable("STATS_CHANNEL"));
assertEquals(1, this.countRowsInTable("STATS_FOLDER"));
assertEquals(0, this.countRowsInTable("STATS_RENDER_TIME"));
portalEvent = new ChannelUpdatedInLayoutPortalEvent(this, person, userProfile, channelDescription, parentNodeDescription);
this.jpaPortalEventStore.storePortalEvents(portalEvent);
this.checkPoint();
assertEquals(1, this.countRowsInTable("STATS_SESSION"));
assertEquals(0, this.countRowsInTable("STATS_SESSION_GROUPS"));
assertEquals(9, this.countRowsInTable("STATS_EVENT"));
assertEquals(9, this.countRowsInTable("STATS_EVENT_TYPE"));
assertEquals(5, this.countRowsInTable("STATS_CHANNEL"));
assertEquals(2, this.countRowsInTable("STATS_FOLDER"));
assertEquals(0, this.countRowsInTable("STATS_RENDER_TIME"));
final IUserLayoutNodeDescription oldParentNodeDescription = EasyMock.createMock(IUserLayoutNodeDescription.class);
EasyMock.expect(oldParentNodeDescription.getId()).andReturn("oldParentNode1").anyTimes();
EasyMock.expect(oldParentNodeDescription.getName()).andReturn("oldParentNode1").anyTimes();
EasyMock.replay(oldParentNodeDescription);
portalEvent = new ChannelMovedInLayoutPortalEvent(this, person, userProfile, channelDescription, oldParentNodeDescription, parentNodeDescription);