Package net.officefloor.polyglot.test
Class AbstractPolyglotFunctionTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- net.officefloor.frame.test.OfficeFrameTestCase
-
- net.officefloor.polyglot.test.AbstractPolyglotFunctionTest
-
- All Implemented Interfaces:
junit.framework.Test
public abstract class AbstractPolyglotFunctionTest extends OfficeFrameTestCase
Abstract tests for a polyglot function via aSectionSource
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractPolyglotFunctionTest.CollectionReturn
static class
AbstractPolyglotFunctionTest.FlowHandlers
static class
AbstractPolyglotFunctionTest.ObjectReturn
static class
AbstractPolyglotFunctionTest.ParameterPass
static class
AbstractPolyglotFunctionTest.ParameterReturn
static class
AbstractPolyglotFunctionTest.PrimitiveReturn
static class
AbstractPolyglotFunctionTest.VariablePass
static class
AbstractPolyglotFunctionTest.VariableReturn
-
Nested classes/interfaces inherited from class net.officefloor.frame.test.OfficeFrameTestCase
OfficeFrameTestCase.FailOperation, OfficeFrameTestCase.GuiTest, OfficeFrameTestCase.MultithreadedTestLogic<T extends java.lang.Throwable>, OfficeFrameTestCase.StressTest, OfficeFrameTestCase.TestCapture<T extends java.lang.Throwable>, OfficeFrameTestCase.TestLogic<R,T extends java.lang.Throwable>, OfficeFrameTestCase.UsesDockerTest, OfficeFrameTestCase.UsesGCloudTest, OfficeFrameTestCase.WaitForTruePredicate<T extends java.lang.Throwable>
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.fasterxml.jackson.databind.ObjectMapper
mapper
ObjectMapper
.protected OfficeFloor
officeFloor
-
Fields inherited from class net.officefloor.frame.test.OfficeFrameTestCase
CLASS_LOADER_EXTRA_CLASS_NAME, CLASS_LOADER_EXTRA_PACKAGE_NAME, END_OF_LINE
-
-
Constructor Summary
Constructors Constructor Description AbstractPolyglotFunctionTest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.String
asynchronousFlow(CompileOfficeContext context)
protected abstract void
asynchronousFlow(AsynchronousFlow flowOne, AsynchronousFlow flowTwo)
protected abstract CollectionTypes
collections(java.util.List<java.lang.Integer> list, java.util.Set<java.lang.Character> set, java.util.Map<java.lang.String,JavaObject> map)
protected abstract java.lang.String
collections(CompileOfficeContext context, OfficeSectionInput handleResult)
protected abstract java.lang.String
flow(CompileOfficeContext context, OfficeSectionInput next, OfficeSectionInput flow, OfficeSectionInput flowWithCallback, OfficeSectionInput flowWithParameterAndCallback, OfficeSectionInput flowWithParameter, OfficeSectionInput exception)
protected abstract void
httpException()
protected abstract void
httpException(OfficeFlowSourceNode pass, CompileWebContext context)
protected abstract ObjectTypes
objects(java.lang.String string, JavaObject object, int[] primitiveArray, JavaObject[] objectArray)
protected abstract java.lang.String
objects(CompileOfficeContext context, OfficeSectionInput handleResult)
protected abstract ParameterTypes
parameter(java.lang.String parameter)
protected abstract void
parameter(OfficeSectionOutput pass, CompileOfficeContext context, OfficeSectionInput handleResult)
protected abstract PrimitiveTypes
primitives(boolean _boolean, byte _byte, short _short, char _char, int _int, long _long, float _float, double _double)
protected abstract java.lang.String
primitives(CompileOfficeContext context, OfficeSectionInput handleResult)
protected void
tearDown()
void
testDirectAsynchronousFlow()
Validate directAsynchronousFlow
.void
testDirectCollections()
Ensure can pass collections.void
testDirectHttpException()
Ensure can run direct forHttpException
.void
testDirectMultiThreaded()
Ensure safe to run directly multi-threaded.void
testDirectObject()
Ensure can pass in a Java object.void
testDirectParameter()
Ensure can provideParameter
.void
testDirectPrimitives()
Ensure can use primitive types.void
testDirectVariables()
Ensure can handle variables.void
testDirectWeb()
Ensure can run direct for web.void
testFlow()
Ensure can invoke flow.void
testInvokeAsynchronousFlow()
Ensure can invokeAsynchronousFlow
.void
testInvokeCollections()
Ensure can invoke collections.void
testInvokeHttpException()
Ensure can invoke to handleHttpException
.void
testInvokeMultiThreaded()
Ensure safe to run invoked multi-threaded.void
testInvokeObject()
Ensure can invoke object types.void
testInvokeParameter()
Ensure can use parameter.void
testInvokePrimitives()
Ensure can invoke primitive types.void
testInvokeVariables()
Ensure can using variables.void
testInvokeWeb()
Ensure can invoke for web.protected abstract VariableTypes
variables(char val, In<java.lang.String> in, Out<JavaObject> out, Var<java.lang.Integer> var)
protected abstract void
variables(OfficeSectionOutput pass, CompileOfficeContext context, OfficeSectionInput handleResult)
protected abstract void
web(java.lang.String pathParameter, java.lang.String queryParameter, java.lang.String headerParameter, java.lang.String cookieParameter, MockHttpParameters httpParameters, MockHttpObject httpObject, ObjectResponse<WebTypes> response)
protected abstract void
web(OfficeFlowSourceNode pass, CompileWebContext context)
-
Methods inherited from class net.officefloor.frame.test.OfficeFrameTestCase
assertContents, assertContents, assertFail, assertFail, assertFail, assertGraph, assertGraph, assertList, assertList, assertList, assertList, assertList, assertProperties, assertTextEquals, assertXmlEquals, captureLoggerOutput, clearDirectory, control, copyDirectory, createFile, createMock, createNewClassLoader, createPlatformIndependentText, createSynchronizedMock, deleteDirectory, displayGraph, displayGraph, doMultiThreadedTest, doMultiThreadedTest, doTest, fail, findFile, findFile, findInputStream, getDisplayRunTime, getDisplayRunTime, getFileContents, getFileLocation, getItem, getPackageRelativePath, getProperty, isGuiAvailable, isPrintMessages, isSkipStressTests, isSkipTestsUsingDocker, isSkipTestsUsingGCloud, printHeapMemoryDiagnostics, printMessage, printMessage, printMessage, recordReturn, recordReturn, registerMockObject, removeXmlWhiteSpacing, replayMockObjects, runBare, setDebugVerbose, setLogGC, setVerbose, sleep, throwException, timeout, timeout, verifyMockObjects, waitForTrue, waitForTrue
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString
-
-
-
-
Field Detail
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
ObjectMapper
.
-
officeFloor
protected OfficeFloor officeFloor
-
-
Method Detail
-
tearDown
protected void tearDown() throws java.lang.Exception
- Overrides:
tearDown
in classjunit.framework.TestCase
- Throws:
java.lang.Exception
-
testDirectPrimitives
public void testDirectPrimitives() throws java.lang.Exception
Ensure can use primitive types.- Throws:
java.lang.Exception
-
primitives
protected abstract PrimitiveTypes primitives(boolean _boolean, byte _byte, short _short, char _char, int _int, long _long, float _float, double _double) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokePrimitives
public void testInvokePrimitives() throws java.lang.Throwable
Ensure can invoke primitive types.- Throws:
java.lang.Throwable
-
primitives
protected abstract java.lang.String primitives(CompileOfficeContext context, OfficeSectionInput handleResult)
-
testDirectObject
public void testDirectObject() throws java.lang.Exception
Ensure can pass in a Java object.- Throws:
java.lang.Exception
-
objects
protected abstract ObjectTypes objects(java.lang.String string, JavaObject object, int[] primitiveArray, JavaObject[] objectArray) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeObject
public void testInvokeObject() throws java.lang.Throwable
Ensure can invoke object types.- Throws:
java.lang.Throwable
-
objects
protected abstract java.lang.String objects(CompileOfficeContext context, OfficeSectionInput handleResult)
-
testDirectCollections
public void testDirectCollections() throws java.lang.Exception
Ensure can pass collections.- Throws:
java.lang.Exception
-
collections
protected abstract CollectionTypes collections(java.util.List<java.lang.Integer> list, java.util.Set<java.lang.Character> set, java.util.Map<java.lang.String,JavaObject> map) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeCollections
public void testInvokeCollections() throws java.lang.Throwable
Ensure can invoke collections.- Throws:
java.lang.Throwable
-
collections
protected abstract java.lang.String collections(CompileOfficeContext context, OfficeSectionInput handleResult)
-
testDirectVariables
public void testDirectVariables() throws java.lang.Exception
Ensure can handle variables.- Throws:
java.lang.Exception
-
variables
protected abstract VariableTypes variables(char val, In<java.lang.String> in, Out<JavaObject> out, Var<java.lang.Integer> var) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeVariables
public void testInvokeVariables() throws java.lang.Throwable
Ensure can using variables.- Throws:
java.lang.Throwable
-
variables
protected abstract void variables(OfficeSectionOutput pass, CompileOfficeContext context, OfficeSectionInput handleResult)
-
testDirectParameter
public void testDirectParameter() throws java.lang.Exception
Ensure can provideParameter
.- Throws:
java.lang.Exception
-
parameter
protected abstract ParameterTypes parameter(java.lang.String parameter) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeParameter
public void testInvokeParameter() throws java.lang.Throwable
Ensure can use parameter.- Throws:
java.lang.Throwable
-
parameter
protected abstract void parameter(OfficeSectionOutput pass, CompileOfficeContext context, OfficeSectionInput handleResult)
-
testDirectMultiThreaded
public void testDirectMultiThreaded() throws java.lang.Exception
Ensure safe to run directly multi-threaded.- Throws:
java.lang.Exception
-
testInvokeMultiThreaded
public void testInvokeMultiThreaded() throws java.lang.Throwable
Ensure safe to run invoked multi-threaded.- Throws:
java.lang.Throwable
-
testDirectWeb
public void testDirectWeb() throws java.lang.Exception
Ensure can run direct for web.- Throws:
java.lang.Exception
-
web
protected abstract void web(java.lang.String pathParameter, java.lang.String queryParameter, java.lang.String headerParameter, java.lang.String cookieParameter, MockHttpParameters httpParameters, MockHttpObject httpObject, ObjectResponse<WebTypes> response) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeWeb
public void testInvokeWeb() throws java.lang.Throwable
Ensure can invoke for web.- Throws:
java.lang.Throwable
-
web
protected abstract void web(OfficeFlowSourceNode pass, CompileWebContext context)
-
testDirectHttpException
public void testDirectHttpException() throws java.lang.Throwable
Ensure can run direct forHttpException
.- Throws:
java.lang.Throwable
-
httpException
protected abstract void httpException() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
testInvokeHttpException
public void testInvokeHttpException() throws java.lang.Throwable
Ensure can invoke to handleHttpException
.- Throws:
java.lang.Throwable
-
httpException
protected abstract void httpException(OfficeFlowSourceNode pass, CompileWebContext context)
-
testFlow
public void testFlow() throws java.lang.Throwable
Ensure can invoke flow.- Throws:
java.lang.Throwable
-
flow
protected abstract java.lang.String flow(CompileOfficeContext context, OfficeSectionInput next, OfficeSectionInput flow, OfficeSectionInput flowWithCallback, OfficeSectionInput flowWithParameterAndCallback, OfficeSectionInput flowWithParameter, OfficeSectionInput exception)
-
testDirectAsynchronousFlow
public void testDirectAsynchronousFlow() throws java.lang.Throwable
Validate directAsynchronousFlow
.- Throws:
java.lang.Throwable
-
asynchronousFlow
protected abstract void asynchronousFlow(AsynchronousFlow flowOne, AsynchronousFlow flowTwo) throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInvokeAsynchronousFlow
public void testInvokeAsynchronousFlow() throws java.lang.Throwable
Ensure can invokeAsynchronousFlow
.- Throws:
java.lang.Throwable
-
asynchronousFlow
protected abstract java.lang.String asynchronousFlow(CompileOfficeContext context)
-
-