com.enioka.jqm.api.Query.setApplicationName()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中com.enioka.jqm.api.Query.setApplicationName方法的一些代码示例,展示了Query.setApplicationName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setApplicationName方法的具体详情如下:
包路径:com.enioka.jqm.api.Query
类名称:Query
方法名:setApplicationName

Query.setApplicationName介绍

[英]The application name is the name of the job definition - the same name that is given in the Job Definition XML. This allows to query all job instances for a single given job definition. If other names were given previously (e.g. with #setApplicationName(List) , they are removed by this method.
[中]应用程序名称是作业定义的名称,与作业定义XML中给出的名称相同。这允许查询单个给定作业定义的所有作业实例。如果之前给出了其他名称(例如使用#setApplicationName(列表),则通过此方法将其删除。

代码示例

代码示例来源:origin: enioka/jqm

public Query(String applicationName, String instanceKeyword1)
{
  this.setApplicationName(applicationName);
  this.instanceKeyword1 = instanceKeyword1;
}

代码示例来源:origin: enioka/jqm

@Test
public void testHistoryFields() throws Exception
{
  CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-datetimemaven/target/test.jar", TestHelpers.qVip, 42,
      "MarsuApplication", null, "Franquin", "ModuleMachin", "other", "other2", true, cnx);
  int i = JobRequest.create("MarsuApplication", "TestUser").setSessionID("session42").setKeyword1("k1").setKeyword2("k2").submit();
  addAndStartEngine();
  TestHelpers.waitFor(1, 10000, cnx);
  Assert.assertEquals(1, TestHelpers.getOkCount(cnx));
  JobInstance h = JqmClientFactory.getClient().getJob(i);
  SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm");
  jqmlogger.debug("enqueueDate: " + df.format(h.getEnqueueDate().getTime()));
  jqmlogger.debug("ExecutionDate: " + df.format(h.getBeganRunningDate().getTime()));
  jqmlogger.debug("EndDate: " + df.format(h.getEndDate().getTime()));
  Assert.assertTrue(h.getEnqueueDate() != null);
  Assert.assertTrue(h.getUser() != null);
  Assert.assertTrue(h.getEndDate() != null);
  Assert.assertTrue(h.getBeganRunningDate() != null);
  Assert.assertTrue(h.getSessionID() != null);
  Assert.assertEquals("session42", h.getSessionID());
  JobInstance ji = Query.create().setApplicationName("MarsuApplication").run().get(0);
  Assert.assertEquals("ModuleMachin", ji.getDefinitionKeyword1());
  Assert.assertEquals("other", ji.getDefinitionKeyword2());
  Assert.assertEquals("other2", ji.getDefinitionKeyword3());
  Assert.assertEquals("k1", ji.getKeyword1());
  Assert.assertEquals("k2", ji.getKeyword2());
  Assert.assertEquals(null, ji.getKeyword3());
}

相关文章