本文整理汇总了Java中org.eclipse.jdt.core.IJavaProject.findType方法的典型用法代码示例。如果您正苦于以下问题:Java IJavaProject.findType方法的具体用法?Java IJavaProject.findType怎么用?Java IJavaProject.findType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IJavaProject
的用法示例。
在下文中一共展示了IJavaProject.findType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetFullyQualifiedName
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testGetFullyQualifiedName() throws Exception {
IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
IType type = project.findType("SimpleImpl");
String s = JDTManager.getFullyQualifiedName(type);
assertEquals("SimpleImpl.java", s);
}
示例2: testGetGraphModelPath
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testGetGraphModelPath() throws Exception {
IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
IType type = project.findType("SimpleImpl");
IPath path = JDTManager.getGraphModelPath(project.getProject(),type);
assertEquals("/" + PROJECT_NAME +"/src/test/resources/Simple.json", path.toString());
}
示例3: testFindGeneratorFactoryParseInvocation
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testFindGeneratorFactoryParseInvocation() throws Exception {
IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
IFile impl = (IFile) ResourceManager
.getResource(project.getProject().getFullPath().append("src/test/java/SimpleImpl.java").toString());
IOHelper.appendParseGeneratorCall (impl);
IType type = project.findType("SimpleImpl");
Set<String> invocations = JDTManager.findGeneratorFactoryParseInvocation(project.getProject(), type);
assertEquals (1,invocations.size());
String value = invocations.iterator().next();
assertEquals("random(edge_coverage(100))", value);
}
示例4: testGetStartableGraphWalkerClasses
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testGetStartableGraphWalkerClasses() throws Exception {
IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true,true);
List<IType> types = JDTManager.getStartableGraphWalkerClasses(project.getProject().getName());
assertTrue (types.size()==1);
IType type = project.findType("SimpleImpl");
assertEquals(type,types.get(0));
}
示例5: testGetOrphanGraphWalkerClasses
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testGetOrphanGraphWalkerClasses() throws Exception {
IJavaProject project = ProjectHelper.getOrCreateSharedGW4Project(PROJECT_NAME, true);
IType type = project.findType("Model_AImpl");
List<IType> types = JDTManager.getOrphanGraphWalkerClasses(type, true);
assertTrue (types.size()==1);
IType typeB = project.findType("Model_BImpl");
assertEquals(typeB,types.get(0));
}
示例6: testGetSharedContexts
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
@Test
public void testGetSharedContexts() throws Exception {
IJavaProject pj = ProjectHelper.getOrCreateSharedGW4Project(PROJECT_NAME,true);
IType type = pj.findType("Model_AImpl");
IType typeB = pj.findType("Model_BImpl");
List<IType> others = new ArrayList<IType> ();
others.add(typeB);
List<IType> shared = GraphWalkerFacade.getSharedContexts(pj.getProject(), type, others);
assertEquals(shared.size(),1);
}
示例7: getJavaType
import org.eclipse.jdt.core.IJavaProject; //导入方法依赖的package包/类
/**
* Obtient le type JDT pour un nom complet qualifié dans un projet donné.
*
* @param fullyQualifiedName Nom complet qualifié.
* @param project Projet.
* @return Le type JDT, <code>null</code> sinon.
*/
public static IType getJavaType(String fullyQualifiedName, IProject project) {
IJavaProject javaProject = JavaCore.create(project);
try {
return javaProject.findType(fullyQualifiedName);
} catch (Exception e) {
ErrorUtils.handle(e);
}
return null;
}