Search in sources :

Example 26 with AuditCommand

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);
}
Also used : AuditCommand(org.asqatasun.service.command.AuditCommand)

Example 27 with AuditCommand

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);
}
Also used : AuditCommand(org.asqatasun.service.command.AuditCommand)

Example 28 with AuditCommand

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);
}
Also used : AuditCommand(org.asqatasun.service.command.AuditCommand)

Example 29 with AuditCommand

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);
}
Also used : AuditCommand(org.asqatasun.service.command.AuditCommand)

Example 30 with AuditCommand

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);
}
Also used : AuditCommand(org.asqatasun.service.command.AuditCommand)

Aggregations

AuditCommand (org.asqatasun.service.command.AuditCommand)31 Audit (org.asqatasun.entity.audit.Audit)7 AuditCommandFactory (org.asqatasun.service.command.factory.AuditCommandFactory)5 Parameter (org.asqatasun.entity.parameterization.Parameter)4 ArrayList (java.util.ArrayList)1