当前位置: 首页>>代码示例>>Java>>正文


Java Job.join方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.jobs.Job.join方法的典型用法代码示例。如果您正苦于以下问题:Java Job.join方法的具体用法?Java Job.join怎么用?Java Job.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.jobs.Job的用法示例。


在下文中一共展示了Job.join方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appEngineWebWithJava8Runtime_Java8

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithJava8Runtime_Java8()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project =
      projectCreator.withFacetVersions(JavaFacet.VERSION_1_8).getFacetedProject();
  createAppEngineWebWithJava8Runtime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_8, WebFacetUtils.WEB_31,
      AppEngineStandardFacetChangeListener.APP_ENGINE_STANDARD_JRE8);
  assertJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例2: appEngineWebWithJava8Runtime_Java8_Web31

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithJava8Runtime_Java8_Web31()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_8, WebFacetUtils.WEB_31).getFacetedProject();
  createAppEngineWebWithJava8Runtime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_8, WebFacetUtils.WEB_31,
      AppEngineStandardFacetChangeListener.APP_ENGINE_STANDARD_JRE8);
  assertJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例3: testAppEngineFacetAdded

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void testAppEngineFacetAdded() throws CoreException, InterruptedException {
  IProject project = projectCreator.getProject();
  IFacetedProject facetedProject = ProjectFacetsManager.create(project);
  Job convertJob = new AppEngineStandardProjectConvertJob(facetedProject);
  convertJob.schedule();
  convertJob.join();
  assertTrue(AppEngineStandardFacet.hasFacet(facetedProject));

  // verify App Engine standard files are present
  IFile webXml = WebProjectUtil.findInWebInf(project, new Path("web.xml"));
  assertTrue(webXml.exists());
  assertTrue(WebProjectUtil.findInWebInf(project, new Path("appengine-web.xml")).exists());

  // verify no overlap in WEB-INF and source paths
  // Java 1.7 facet sets the source path to src/ which will overlap with the
  // default src/main/webapp used in the AppEngineStandardFacet installer
  IFolder webInfFolder = (IFolder) webXml.getParent();
  assertEquals("WEB-INF", webInfFolder.getName());
  IPath webInfPath = webInfFolder.getProjectRelativePath();
  List<IPath> sourcePaths = WebProjectUtil.getJavaSourcePaths(project);
  for (IPath sourcePath : sourcePaths) {
    assertFalse(sourcePath.isPrefixOf(webInfPath));
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:AppEngineStandardProjectConvertJobTest.java

示例4: convertGpeProject

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
private void convertGpeProject(URL zipFile)
    throws CoreException, IOException, InterruptedException {
  List<IProject> projects =
      ProjectUtils.importProjects(zipFile,
      false /* checkBuildErrors */, null);
  assertEquals(1, projects.size());
  project = projects.get(0);
  IFacetedProject facetedProject = ProjectFacetsManager.create(project,
      true /* convert to faceted project if necessary */, null /* no monitor here */);

  Job conversionJob = new AppEngineStandardProjectConvertJob(facetedProject);
  conversionJob.schedule();
  conversionJob.join();
  assertTrue("conversion should not have failed", conversionJob.getResult().isOK());

  // ensure facet versions haven't been downgraded
  assertEquals(JavaFacet.VERSION_1_7, facetedProject.getProjectFacetVersion(JavaFacet.FACET));
  assertEquals(WebFacetUtils.WEB_25,
      facetedProject.getProjectFacetVersion(WebFacetUtils.WEB_FACET));
  assertEquals(AppEngineStandardFacet.JRE7,
      facetedProject.getProjectFacetVersion(AppEngineStandardFacet.FACET));
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:23,代码来源:GpeConversionTest.java

示例5: appEngineWebWithJava8Runtime_Java7_Web31

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithJava8Runtime_Java7_Web31()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_7, WebFacetUtils.WEB_31).getFacetedProject();
  createAppEngineWebWithJava8Runtime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_8, WebFacetUtils.WEB_31,
      AppEngineStandardFacetChangeListener.APP_ENGINE_STANDARD_JRE8);
  assertJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例6: appEngineWebWithJava8Runtime_Java7_Web25

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithJava8Runtime_Java7_Web25()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25).getFacetedProject();
  createAppEngineWebWithJava8Runtime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_8, WebFacetUtils.WEB_25,
      AppEngineStandardFacetChangeListener.APP_ENGINE_STANDARD_JRE8);
  assertJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例7: appEngineWebWithJava8Runtime_Java8_Web25

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithJava8Runtime_Java8_Web25()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_8, WebFacetUtils.WEB_25).getFacetedProject();
  createAppEngineWebWithJava8Runtime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_8, WebFacetUtils.WEB_25,
      AppEngineStandardFacetChangeListener.APP_ENGINE_STANDARD_JRE8);
  assertJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例8: testIgnoringExceptionLocations

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
 * Test that {@link NullPointerException}'s are ignored.
 *
 * @throws InterruptedException
 *           the exception that is thrown if the test job was interrupted
 */
@Test
public void testIgnoringExceptionLocations() throws InterruptedException {
  assertFalse("NullPointerException must not have been logged.", errorLogListener.isExceptionLogged(NullPointerException.class));
  errorLogListener.ignoreException(NullPointerException.class, "com.avaloq.tools.ddk.test.core.util.ErrorLogListenerTest");

  final Job job = new Job("testIgnoringExceptionLocations") {

    @Override
    @SuppressWarnings("PMD.AvoidThrowingNullPointerException")
    protected IStatus run(final IProgressMonitor monitor) {
      // We really want to thrown a null pointer exception here because we test that such exceptions are ignored.
      throw new NullPointerException();
    }
  };
  job.schedule();
  job.join();

  assertTrue("NullPointerException must have been logged.", errorLogListener.isExceptionLogged(NullPointerException.class));
  assertFalse("NullPointerException must have been ignored.", errorLogListener.getLoggedExceptions().contains(NullPointerException.class));
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:27,代码来源:ErrorLogListenerTest.java

示例9: appEngineWebWithNoRuntime_Java7_Web25

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithNoRuntime_Java7_Web25()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25).getFacetedProject();
  createAppEngineWebWithNoRuntime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25,
      AppEngineStandardFacet.JRE7);
  assertNoJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例10: appEngineWebWithNoRuntime_Java8_Web31

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithNoRuntime_Java8_Web31()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_8, WebFacetUtils.WEB_31).getFacetedProject();
  createAppEngineWebWithNoRuntime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25,
      AppEngineStandardFacet.JRE7);
  assertNoJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例11: appEngineWebWithNoRuntime_Java8

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithNoRuntime_Java8()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project =
      projectCreator.withFacetVersions(JavaFacet.VERSION_1_8).getFacetedProject();
  createAppEngineWebWithNoRuntime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25,
      AppEngineStandardFacet.JRE7);
  assertNoJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例12: appEngineWebWithNoRuntime_Java8_Web25

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void appEngineWebWithNoRuntime_Java8_Web25()
    throws CoreException, IOException, InterruptedException, SAXException {
  IFacetedProject project = projectCreator
      .withFacetVersions(JavaFacet.VERSION_1_8, WebFacetUtils.WEB_25).getFacetedProject();
  createAppEngineWebWithNoRuntime(project);

  Job conversionJob = new AppEngineStandardProjectConvertJob(project);
  conversionJob.schedule();
  conversionJob.join();
  assertIsOk("conversion should never fail", conversionJob.getResult());

  assertFacetVersions(project, JavaFacet.VERSION_1_7, WebFacetUtils.WEB_25,
      AppEngineStandardFacet.JRE7);
  assertNoJava8Runtime(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:ConversionTests.java

示例13: joinJob

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Override
public void joinJob(final Job job) throws InterruptedException {
    final Display display = Display.getCurrent();

    if (display != null && display.getThread() == Thread.currentThread()) {
        while (job.getResult() == null) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    } else {
        // display should only be null if the program is exiting
        job.join();
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:16,代码来源:UIAsyncObjectWaiter.java

示例14: joinJob

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Override
public void joinJob(final Job job) throws InterruptedException {
    final IAsyncObjectWaiter e = getExtension();
    if (e != null) {
        e.joinJob(job);
    } else {
        job.join();
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:10,代码来源:ExtensionPointAsyncObjectWaiter.java

示例15: testRun_abandonStaleJob

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Test
public void testRun_abandonStaleJob() throws InterruptedException, ProjectRepositoryException {
  when(projectRepository.getAppEngineApplication(credential, "projectId"))
      .thenReturn(AppEngine.NO_APPENGINE_APPLICATION);

  // Prepare another concurrent query job.
  Credential staleCredential = mock(Credential.class);

  GcpProject staleProject = new GcpProject("name", "staleProjectId");
  ProjectRepository projectRepository2 = mock(ProjectRepository.class);
  when(projectRepository2.getAppEngineApplication(staleCredential, "staleProjectId"))
      .thenThrow(new ProjectRepositoryException("testException"));

  // This second job is stale, i.e., it was fired, but user has selected another credential.
  Predicate<Job> notLatest = Predicates.alwaysFalse();
  Job staleJob = new AppEngineApplicationQueryJob(staleProject, staleCredential,
      projectRepository2, projectSelector, EXPECTED_LINK, notLatest);

  queryJob.schedule();
  queryJob.join();
  // Make the stale job complete even after "queryJob" finishes.
  staleJob.schedule();
  staleJob.join();

  verify(projectRepository).getAppEngineApplication(credential, "projectId");
  verify(projectRepository2).getAppEngineApplication(staleCredential, "staleProjectId");

  verify(projectSelector).setStatusLink(EXPECTED_MESSAGE_WHEN_NO_APPLICATION, EXPECTED_LINK);
  verify(projectSelector, never()).setStatusLink(EXPECTED_MESSAGE_WHEN_EXCEPTION, null);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:31,代码来源:AppEngineApplicationQueryJobTest.java


注:本文中的org.eclipse.core.runtime.jobs.Job.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。