use of org.asqatasun.service.command.AuditCommand in project Asqatasun by Asqatasun.
the class AuditServiceThreadQueueImplTest method testAddSiteAudit.
/**
* Test of addSiteAudit method, of class AuditServiceThreadQueueImpl.
*/
public void testAddSiteAudit() {
System.out.println("addSiteAudit");
AuditServiceThreadQueueImpl instance = new AuditServiceThreadQueueImpl();
AuditCommand auditCommand = EasyMock.createMock(AuditCommand.class);
// Create the mock instance
AuditServiceThread auditServiceThread = createMockAuditServiceThread(instance);
// Create the mock instance
AuditServiceThreadFactory auditServiceThreadFactory = createMockAuditServiceThreadFactory(auditCommand, auditServiceThread);
instance.setAuditServiceThreadFactory(auditServiceThreadFactory);
instance.addSiteAudit(auditCommand);
// an unexpected error
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(AuditServiceThreadQueueImplTest.class.getName()).log(Level.SEVERE, null, ex);
}
// Verify behavior.
EasyMock.verify(auditServiceThread);
EasyMock.verify(auditServiceThreadFactory);
}
use of org.asqatasun.service.command.AuditCommand in project Asqatasun by Asqatasun.
the class AuditServiceThreadQueueImplTest method testAddPageUploadAudit.
/**
* Test of addPageUploadAudit method, of class AuditServiceThreadQueueImpl.
*/
public void testAddPageUploadAudit() {
System.out.println("addPageUploadAudit");
// the tested instance
AuditServiceThreadQueueImpl instance = new AuditServiceThreadQueueImpl();
AuditCommand auditCommand = EasyMock.createMock(AuditCommand.class);
// Create the mock instance
AuditServiceThread auditServiceThread = createMockAuditServiceThread(instance);
// Create the mock instance
AuditServiceThreadFactory auditServiceThreadFactory = createMockAuditServiceThreadFactory(auditCommand, auditServiceThread);
instance.setAuditServiceThreadFactory(auditServiceThreadFactory);
instance.addPageUploadAudit(auditCommand);
// an unexpected error
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(AuditServiceThreadQueueImplTest.class.getName()).log(Level.SEVERE, null, ex);
}
// Verify behavior.
EasyMock.verify(auditServiceThreadFactory);
EasyMock.verify(auditServiceThread);
}
use of org.asqatasun.service.command.AuditCommand in project Asqatasun by Asqatasun.
the class AuditServiceThreadQueueImplTest method testAddScenarioAudit.
/**
* Test of addScenarioAudit method, of class AuditServiceThreadQueueImpl.
*/
public void testAddScenarioAudit() {
System.out.println("addScenarioAudit");
// the tested instance
AuditServiceThreadQueueImpl instance = new AuditServiceThreadQueueImpl();
AuditCommand auditCommand = EasyMock.createMock(AuditCommand.class);
// Create the mock instance
AuditServiceThread auditServiceThread = createMockAuditServiceThread(instance);
// Create the mock instance
AuditServiceThreadFactory auditServiceThreadFactory = createMockAuditServiceThreadFactory(auditCommand, auditServiceThread);
instance.setAuditServiceThreadFactory(auditServiceThreadFactory);
instance.addScenarioAudit(auditCommand);
// an unexpected error
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(AuditServiceThreadQueueImplTest.class.getName()).log(Level.SEVERE, null, ex);
}
// Verify behavior.
EasyMock.verify(auditServiceThread);
EasyMock.verify(auditServiceThreadFactory);
}
use of org.asqatasun.service.command.AuditCommand in project Asqatasun by Asqatasun.
the class AuditServiceThreadImplTest method testConsolidate.
/**
* Test of consolidate method, of class AuditServiceThreadImpl.
*/
public void testConsolidate() {
System.out.println("consolidate");
AuditCommand mockAuditCommand = createMock(AuditCommand.class);
mockAuditCommand.consolidate();
expectLastCall().once();
replay(mockAuditCommand);
AuditServiceThreadImpl instance = initialiseAuditServiceThread(mockAuditCommand);
instance.consolidate();
verify(mockAuditCommand);
}
use of org.asqatasun.service.command.AuditCommand in project Asqatasun by Asqatasun.
the class AuditServiceThreadImplTest method testLoadContent.
/**
* Test of loadContent method, of class AuditServiceThreadImpl.
*/
public void testLoadContent() {
System.out.println("loadContent");
AuditCommand mockAuditCommand = createMock(AuditCommand.class);
mockAuditCommand.loadContent();
expectLastCall().once();
replay(mockAuditCommand);
AuditServiceThreadImpl instance = initialiseAuditServiceThread(mockAuditCommand);
instance.loadContent();
verify(mockAuditCommand);
}
Aggregations