Package org.eclipse.xtext.xbase.testing
Class CompilationTestHelper.Result
- java.lang.Object
-
- org.eclipse.xtext.xbase.testing.CompilationTestHelper.Result
-
- Enclosing class:
- CompilationTestHelper
public static class CompilationTestHelper.Result extends java.lang.ObjectA result contains information about various aspects of a compiled piece of code.- Noextend:
- This class is not intended to be subclassed by clients.
- Noinstantiate:
- This class is not intended to be instantiated by clients.
-
-
Constructor Summary
Constructors Constructor Description Result()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCompile()protected voiddoGenerate()protected voiddoIndex()protected voiddoLinking()protected voiddoValidation()java.util.Map<java.lang.String,java.lang.CharSequence>getAllGeneratedResources()java.lang.ClassLoadergetClassLoader()Ensures compilation has happened and returns the class loader including compiled classes.java.lang.Class<?>getCompiledClass()Convenience method for single generated Java classesjava.lang.Class<?>getCompiledClass(java.lang.String className)Convenience method for single generated Java classesjava.util.Map<java.lang.String,java.lang.Class<?>>getCompiledClasses()Ensures compilation has happened and returns any generated and compiled Java classes.java.util.List<org.eclipse.xtext.validation.Issue>getErrorsAndWarnings()Ensures validation has happened and returns any errors and warningsjava.util.Map<java.lang.String,java.lang.String>getGeneratedCode()Ensures generation happened and returns a map of the generated Java source files.java.lang.StringgetGeneratedCode(java.lang.String typeName)convenience method.org.eclipse.emf.ecore.resource.ResourceSetgetResourceSet()java.lang.StringgetSingleGeneratedCode()Convenience method for the common case, that only one file is generated.protected voidsetCheckMode(org.eclipse.xtext.validation.CheckMode checkMode)protected voidsetJavaCompiler(OnTheFlyJavaCompiler2 javaCompiler)protected voidsetOutputConfigurations(java.lang.Iterable<? extends org.eclipse.xtext.generator.OutputConfiguration> outputConfiguration)protected voidsetResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> sources)protected voidsetResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
-
-
Method Detail
-
setResourceSet
protected void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
setCheckMode
protected void setCheckMode(org.eclipse.xtext.validation.CheckMode checkMode)
- Since:
- 2.8
-
setResources
protected void setResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> sources)
-
setJavaCompiler
protected void setJavaCompiler(OnTheFlyJavaCompiler2 javaCompiler)
- Since:
- 2.9
-
setOutputConfigurations
protected void setOutputConfigurations(java.lang.Iterable<? extends org.eclipse.xtext.generator.OutputConfiguration> outputConfiguration)
-
getErrorsAndWarnings
public java.util.List<org.eclipse.xtext.validation.Issue> getErrorsAndWarnings()
Ensures validation has happened and returns any errors and warnings- Returns:
- errors and warnings contained in the currently processed sources
-
getCompiledClasses
public java.util.Map<java.lang.String,java.lang.Class<?>> getCompiledClasses()
Ensures compilation has happened and returns any generated and compiled Java classes.- Returns:
- the compiled Java classes
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Ensures compilation has happened and returns the class loader including compiled classes.- Returns:
- the class loader after the compilation happend
-
getGeneratedCode
public java.util.Map<java.lang.String,java.lang.String> getGeneratedCode()
Ensures generation happened and returns a map of the generated Java source files.- Returns:
- a map of the generated Java source files, where the key is the qualified class name and the value the generated Java code.
-
getGeneratedCode
public java.lang.String getGeneratedCode(java.lang.String typeName)
convenience method. Same as getGeneratedCode().get(typeName)
-
getSingleGeneratedCode
public java.lang.String getSingleGeneratedCode()
Convenience method for the common case, that only one file is generated.
-
getResourceSet
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
- Returns:
- the resource set used in this compilation process
-
getCompiledClass
public java.lang.Class<?> getCompiledClass()
Convenience method for single generated Java classes
-
getCompiledClass
public java.lang.Class<?> getCompiledClass(java.lang.String className)
Convenience method for single generated Java classes
-
getAllGeneratedResources
public java.util.Map<java.lang.String,java.lang.CharSequence> getAllGeneratedResources()
- Returns:
- all generated resources. the key is the file path and the value denotes the generated text.
-
doIndex
protected void doIndex()
-
doLinking
protected void doLinking()
-
doValidation
protected void doValidation()
-
doGenerate
protected void doGenerate()
-
doCompile
protected void doCompile()
-
-