@Test public void testChangeQueue() throws Exception { CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-datetimemaven/target/test.jar", TestHelpers.qVip, 42, "MarsuApplication", null, "Franquin", "ModuleMachin", "other", "other", false, cnx); int i = JobRequest.create("MarsuApplication", "TestUser").submit(); JqmClientFactory.getClient().setJobQueue(i, TestHelpers.qSlow); addAndStartEngine(); TestHelpers.waitFor(1, 10000, cnx); List<JobInstance> res = Query.create().addSortAsc(Sort.DATEENQUEUE).run(); Assert.assertEquals(1, res.size()); Assert.assertEquals(State.ENDED, res.get(0).getState()); Assert.assertEquals("SlowQueue", res.get(0).getQueue().getName()); }
@Test public void testEnqueueWithQueue() throws Exception { CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-datetimemaven/target/test.jar", TestHelpers.qVip, 42, "MarsuApplication", null, "Franquin", "ModuleMachin", "other", "other", false, cnx); int i = JobRequest.create("MarsuApplication", "TestUser").setQueueName("NormalQueue").submit(); addAndStartEngine(); TestHelpers.waitFor(1, 10000, cnx); JobInstance ji = JqmClientFactory.getClient().getJob(i); Assert.assertEquals("NormalQueue", ji.getQueue().getName()); }