public class RootTemplate extends AbstractTestTemplate
Modifier and Type | Field and Description |
---|---|
static String |
LINE_FEED |
builtTestFile, DEFAULT_IP, DEFAULT_PORT, focusLineAcceptor, HTTP, HTTPS, imports, WS, WSS
Constructor and Description |
---|
RootTemplate(String fileName,
BLangPackage builtTestFile,
BiConsumer<Integer,Integer> focusLineAcceptor) |
Modifier and Type | Method and Description |
---|---|
static RootTemplate |
fromFunction(BLangFunction function,
BLangPackage builtTestFile,
BiConsumer<Integer,Integer> focusLineAcceptor)
Create root template for a function.
|
static RootTemplate |
fromHttpService(BLangService service,
BLangTypeInit init,
BLangPackage builtTestFile,
BiConsumer<Integer,Integer> focusLineAcceptor)
Create root template for a http service.
|
static RootTemplate |
fromHttpWSService(BLangService service,
BLangTypeInit init,
BLangPackage builtTestFile,
BiConsumer<Integer,Integer> focusLineAcceptor)
Create root template for a websocket service.
|
void |
render(RendererOutput rendererOutput)
Renders content into this file template.
|
findServicePort, getSafeName, isNonExistImport, isSecureService, lowerCaseFirstLetter, upperCaseFirstLetter
public static final String LINE_FEED
public RootTemplate(String fileName, BLangPackage builtTestFile, BiConsumer<Integer,Integer> focusLineAcceptor)
public static RootTemplate fromFunction(BLangFunction function, BLangPackage builtTestFile, BiConsumer<Integer,Integer> focusLineAcceptor)
function
- functionbuiltTestFile
- built test file packagefocusLineAcceptor
- focus line acceptorpublic static RootTemplate fromHttpService(BLangService service, BLangTypeInit init, BLangPackage builtTestFile, BiConsumer<Integer,Integer> focusLineAcceptor)
service
- serviceinit
- BLangTypeInit
builtTestFile
- built test file packagefocusLineAcceptor
- focus line acceptorpublic static RootTemplate fromHttpWSService(BLangService service, BLangTypeInit init, BLangPackage builtTestFile, BiConsumer<Integer,Integer> focusLineAcceptor)
service
- serviceinit
- BLangTypeInit
builtTestFile
- built test file packagefocusLineAcceptor
- focus line acceptorpublic void render(RendererOutput rendererOutput) throws TestGeneratorException
rendererOutput
- root TemplateBasedRendererOutput
TestGeneratorException
- when template population process failsCopyright © 2019 WSO2. All rights reserved.