@Retention(value=RUNTIME) @Target(value=TYPE) @ContextConfiguration(loader=YarnDelegatingSmartContextLoader.class) @MiniYarnCluster public @interface MiniYarnClusterTest
MiniYarnCluster
,
@ContextConfiguration
using loader YarnDelegatingSmartContextLoader
and empty Spring @Configuration
.
Typical use for this annotation would look like:
@MiniYarnClusterTest public class AppTests extends AbstractBootYarnClusterTests { @Test public void testApp() { // test methods } }
If user wants to use a simple composed annotation and use a
custom @Configuration
, there are two options.
Use classes attribute with @MiniYarnCluster
to override
default context configuration class.
@MiniYarnClusterTest(classes = AppTests.Config.class) public class AppTests extends AbstractBootYarnClusterTests { @Test public void testApp() { // test methods } @Configuration public static class Config { // custom config } }
If more functionality is needed for composed annotation, one can simply duplicate
functionality of this @MiniYarnClusterTest
annotation.
@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @ContextConfiguration(loader=YarnDelegatingSmartContextLoader.class) @MiniYarnCluster public @interface CustomMiniYarnClusterTest { Class<?>[] classes() default { CustomMiniYarnClusterTest.Config.class }; @Configuration public static class Config { @Bean public String myCustomBean() { return "myCustomBean"; } } }
Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class<?>[] |
classes
Defaults to empty configuration.
|
java.lang.String |
clusterName |
java.lang.String |
configName |
java.lang.String |
id |
boolean |
inheritInitializers |
boolean |
inheritLocations |
java.lang.Class<? extends org.springframework.context.ApplicationContextInitializer<? extends org.springframework.context.ConfigurableApplicationContext>>[] |
initializers |
java.lang.String[] |
locations |
java.lang.String |
name |
int |
nodes |
public abstract java.lang.String configName
MiniYarnCluster.configName()
public abstract java.lang.String clusterName
MiniYarnCluster.clusterName()
public abstract java.lang.String id
MiniYarnCluster.id()
public abstract int nodes
MiniYarnCluster.nodes()
public abstract java.lang.String[] locations
ContextConfiguration.locations()
public abstract java.lang.Class<?>[] classes
ContextConfiguration.classes()
public abstract java.lang.Class<? extends org.springframework.context.ApplicationContextInitializer<? extends org.springframework.context.ConfigurableApplicationContext>>[] initializers
ContextConfiguration.initializers()
public abstract boolean inheritLocations
ContextConfiguration.inheritLocations()
public abstract boolean inheritInitializers
ContextConfiguration.inheritInitializers()
public abstract java.lang.String name
ContextConfiguration.name()