Search in sources :

Example 11 with Locker

use of nl.nn.adapterframework.util.Locker in project iaf by ibissource.

the class IbisJobDetailTest method compareOtherLocker.

@Test
public void compareOtherLocker() throws Exception {
    Locker locker = new Locker() {

        @Override
        public void configure() {
        // override configure, to avoid having to fully configure the Locker. We just use it's existence here.
        }
    };
    jobDef2.setLocker(locker);
    jobDef1.configure();
    jobDef2.configure();
    IbisJobDetail jobDetail1 = (IbisJobDetail) IbisJobBuilder.fromJobDef(jobDef1).build();
    assertFalse(jobDetail1.compareWith(jobDef2));
}
Also used : Locker(nl.nn.adapterframework.util.Locker) Test(org.junit.Test)

Example 12 with Locker

use of nl.nn.adapterframework.util.Locker in project iaf by ibissource.

the class IbisJobDetailTest method compareOneLocker.

@Test
public void compareOneLocker() throws Exception {
    Locker locker = new Locker() {

        @Override
        public void configure() {
        // override configure, to avoid having to fully configure the Locker. We just use it's existence here.
        }
    };
    jobDef1.setLocker(locker);
    jobDef1.configure();
    jobDef2.configure();
    IbisJobDetail jobDetail1 = (IbisJobDetail) IbisJobBuilder.fromJobDef(jobDef1).build();
    assertFalse(jobDetail1.compareWith(jobDef2));
}
Also used : Locker(nl.nn.adapterframework.util.Locker) Test(org.junit.Test)

Example 13 with Locker

use of nl.nn.adapterframework.util.Locker in project iaf by ibissource.

the class IbisJobDetailTest method compareEqualLocker.

@Test
public void compareEqualLocker() throws Exception {
    Locker locker1 = new Locker() {

        @Override
        public void configure() {
        // override configure, to avoid having to fully configure the Locker. We just use it's objectId here.
        }

        @Override
        public String getObjectId() {
            return "fakeObjectId";
        }
    };
    jobDef1.setLocker(locker1);
    Locker locker2 = new Locker() {

        @Override
        public void configure() {
        // override configure, to avoid having to fully configure the Locker. We just use it's objectId here.
        }

        @Override
        public String getObjectId() {
            return "fakeObjectId";
        }
    };
    jobDef2.setLocker(locker2);
    jobDef1.configure();
    jobDef2.configure();
    IbisJobDetail jobDetail1 = (IbisJobDetail) IbisJobBuilder.fromJobDef(jobDef1).build();
    assertTrue(jobDetail1.compareWith(jobDef2));
}
Also used : Locker(nl.nn.adapterframework.util.Locker) Test(org.junit.Test)

Aggregations

Locker (nl.nn.adapterframework.util.Locker)13 Test (org.junit.Test)5 PipeRunException (nl.nn.adapterframework.core.PipeRunException)4 Connection (java.sql.Connection)2 PreparedStatement (java.sql.PreparedStatement)2 SQLException (java.sql.SQLException)2 HashMap (java.util.HashMap)2 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)2 IExtendedPipe (nl.nn.adapterframework.core.IExtendedPipe)2 PipeLineResult (nl.nn.adapterframework.core.PipeLineResult)2 PipeRunResult (nl.nn.adapterframework.core.PipeRunResult)2 FixedQuerySender (nl.nn.adapterframework.jdbc.FixedQuerySender)2 IbisJobDetail (nl.nn.adapterframework.scheduler.IbisJobDetail)2 SchedulerHelper (nl.nn.adapterframework.scheduler.SchedulerHelper)2 DatabaseJob (nl.nn.adapterframework.scheduler.job.DatabaseJob)2 IJob (nl.nn.adapterframework.scheduler.job.IJob)2 Scheduler (org.quartz.Scheduler)2 SchedulerException (org.quartz.SchedulerException)2 StringReader (java.io.StringReader)1 ResultSet (java.sql.ResultSet)1