use of org.talend.core.runtime.process.ITalendProcessJavaProject in project tdi-studio-se by Talend.
the class JobJavaScriptsManager method getSrcRootLocation.
/**
* Get the path of .JAVA/src
*
* @throws Exception
*/
protected IPath getSrcRootLocation() throws Exception {
ITalendProcessJavaProject talendProcessJavaProject = RepositoryPlugin.getDefault().getRunProcessService().getTalendProcessJavaProject();
if (talendProcessJavaProject == null) {
//$NON-NLS-1$
return new Path("");
}
IProject project = talendProcessJavaProject.getProject();
IJavaProject javaProject = talendProcessJavaProject.getJavaProject();
IPackageFragmentRoot[] pp = javaProject.getAllPackageFragmentRoots();
IPackageFragmentRoot src = null;
for (IPackageFragmentRoot root : pp) {
if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
src = root;
break;
}
}
IPath root = project.getParent().getLocation();
root = root.append(src.getPath());
return root;
}
use of org.talend.core.runtime.process.ITalendProcessJavaProject in project tdi-studio-se by Talend.
the class StandardJobStandaloneBuildProviderTest method test_createPomCreator_nonAssemblyFile.
@Test
public void test_createPomCreator_nonAssemblyFile() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(IBuildPomCreatorParameters.PROCESSOR, new TestProcessor());
ITalendProcessJavaProject talendProcessJavaProject = RepositoryPlugin.getDefault().getRunProcessService().getTalendProcessJavaProject();
parameters.put(IBuildPomCreatorParameters.FILE_POM, talendProcessJavaProject.getProject().getFile("pom_abc.xml"));
parameters.put(IBuildParametes.ITEM, PropertiesFactory.eINSTANCE.createProcessItem());
parameters.put(IBuildPomCreatorParameters.FILE_ASSEMBLY, new Object());
RepositoryObjectTypeBuildProvider provider = createTestBuildProvider();
Assert.assertNull(provider.createPomCreator(parameters));
}
use of org.talend.core.runtime.process.ITalendProcessJavaProject in project tdi-studio-se by Talend.
the class StandardJobStandaloneBuildProviderTest method test_createPomCreator_nullAssemblyFile.
@Test
public void test_createPomCreator_nullAssemblyFile() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(IBuildPomCreatorParameters.PROCESSOR, new TestProcessor());
ITalendProcessJavaProject talendProcessJavaProject = RepositoryPlugin.getDefault().getRunProcessService().getTalendProcessJavaProject();
parameters.put(IBuildPomCreatorParameters.FILE_POM, talendProcessJavaProject.getProject().getFile("pom_abc.xml"));
parameters.put(IBuildParametes.ITEM, PropertiesFactory.eINSTANCE.createProcessItem());
// parameters.put(IBuildPomCreatorParameters.FILE_ASSEMBLY, null);
RepositoryObjectTypeBuildProvider provider = createTestBuildProvider();
Assert.assertNull(provider.createPomCreator(parameters));
}
use of org.talend.core.runtime.process.ITalendProcessJavaProject in project tdi-studio-se by Talend.
the class AbstractStandardJobBuildProviderTest method test_createPomCreator_nonArgumentsMap.
@Test
public void test_createPomCreator_nonArgumentsMap() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(IBuildPomCreatorParameters.PROCESSOR, new TestProcessor());
ITalendProcessJavaProject talendProcessJavaProject = RepositoryPlugin.getDefault().getRunProcessService().getTalendProcessJavaProject();
parameters.put(IBuildPomCreatorParameters.FILE_POM, talendProcessJavaProject.getProject().getFile("pom_abc.xml"));
parameters.put(IBuildParametes.ITEM, PropertiesFactory.eINSTANCE.createProcessItem());
parameters.put(IBuildPomCreatorParameters.ARGUMENTS_MAP, new Object());
RepositoryObjectTypeBuildProvider provider = createTestBuildProvider();
Assert.assertNull(provider.createPomCreator(parameters));
}
use of org.talend.core.runtime.process.ITalendProcessJavaProject in project tdi-studio-se by Talend.
the class AbstractStandardJobBuildProviderTest method test_createPomCreator_nonItem.
@Test
public void test_createPomCreator_nonItem() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(IBuildPomCreatorParameters.PROCESSOR, new TestProcessor());
ITalendProcessJavaProject talendProcessJavaProject = RepositoryPlugin.getDefault().getRunProcessService().getTalendProcessJavaProject();
parameters.put(IBuildPomCreatorParameters.FILE_POM, talendProcessJavaProject.getProject().getFile("pom_abc.xml"));
parameters.put(IBuildParametes.ITEM, new Object());
RepositoryObjectTypeBuildProvider provider = createTestBuildProvider();
Assert.assertNull(provider.createPomCreator(parameters));
}
Aggregations