org.springframework.yarn.boot.test.junit
Class AbstractBootYarnClusterTests

java.lang.Object
  extended by org.springframework.yarn.test.junit.AbstractYarnClusterTests
      extended by org.springframework.yarn.boot.test.junit.AbstractBootYarnClusterTests
All Implemented Interfaces:
Aware, ApplicationContextAware

public abstract class AbstractBootYarnClusterTests
extends org.springframework.yarn.test.junit.AbstractYarnClusterTests

Abstract base class providing default functionality for running tests for Spring Yarn Boot based apps using Yarn mini cluster.

Author:
Janne Valkealahti

Nested Class Summary
static class AbstractBootYarnClusterTests.EmptyConfig
          Empty Spring @Configuration class which can be referenced from tests solely using JavaConfig.
 
Field Summary
 
Fields inherited from class org.springframework.yarn.test.junit.AbstractYarnClusterTests
applicationContext, configuration, yarnClient, yarnCluster
 
Constructor Summary
AbstractBootYarnClusterTests()
           
 
Method Summary
 void setYarnClient(org.springframework.yarn.client.YarnClient yarnClient)
           
protected  org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWait(Object source, String[] args)
          Submits application and wait state.
protected  org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWait(Object source, String[] args, long timeout, TimeUnit unit)
          Submits application and wait state.
protected  org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWaitState(Object source, String[] args, long timeout, TimeUnit unit, YarnApplicationState... applicationStates)
          Submits application and wait state.
 
Methods inherited from class org.springframework.yarn.test.junit.AbstractYarnClusterTests
getApplicationContext, getConfiguration, getState, getYarnClient, getYarnCluster, killApplication, setApplicationContext, setConfiguration, setYarnCluster, submitApplication, submitApplicationAndWait, submitApplicationAndWait, submitApplicationAndWaitState, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBootYarnClusterTests

public AbstractBootYarnClusterTests()
Method Detail

setYarnClient

public void setYarnClient(org.springframework.yarn.client.YarnClient yarnClient)
Overrides:
setYarnClient in class org.springframework.yarn.test.junit.AbstractYarnClusterTests

submitApplicationAndWait

protected org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWait(Object source,
                                                                                       String[] args)
                                                                                throws Exception
Submits application and wait state. On default waits 60 seconds.

Parameters:
source - the boot application config source
args - the boot application args
Returns:
Application info for submit
Throws:
Exception - if exception occurred
See Also:
ApplicationInfo, submitApplicationAndWaitState(Object, String[], long, TimeUnit, YarnApplicationState...)

submitApplicationAndWait

protected org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWait(Object source,
                                                                                       String[] args,
                                                                                       long timeout,
                                                                                       TimeUnit unit)
                                                                                throws Exception
Submits application and wait state.

Parameters:
source - the boot application config source
args - the boot application args
timeout - the timeout for wait
unit - the unit for timeout
Returns:
Application info for submit
Throws:
Exception - if exception occurred
See Also:
ApplicationInfo, submitApplicationAndWaitState(Object, String[], long, TimeUnit, YarnApplicationState...)

submitApplicationAndWaitState

protected org.springframework.yarn.test.junit.ApplicationInfo submitApplicationAndWaitState(Object source,
                                                                                            String[] args,
                                                                                            long timeout,
                                                                                            TimeUnit unit,
                                                                                            YarnApplicationState... applicationStates)
                                                                                     throws Exception
Submits application and wait state. Returned state is NULL if something failed or final known state after the wait/poll operations. Array of application states can be used to return immediately from wait loop if state is matched.

Parameters:
source - the boot application config source
args - the boot application args
timeout - the timeout for wait
unit - the unit for timeout
applicationStates - the application states to wait
Returns:
Application info for submit
Throws:
Exception - if exception occurred
See Also:
ApplicationInfo