本文整理匯總了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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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