public abstract class AbstractHadoopClusterTests
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected org.apache.hadoop.conf.Configuration |
configuration |
protected HadoopCluster |
hadoopCluster |
Constructor and Description |
---|
AbstractHadoopClusterTests() |
Modifier and Type | Method and Description |
---|---|
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the
ApplicationContext for tests. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the running cluster runtime
Configuration for tests. |
protected org.apache.hadoop.fs.FileSystem |
getFileSystem()
Returns a configured
FileSystem instance for
test cases to read and write files to it. |
HadoopCluster |
getHadoopCluster()
Gets the running
HadoopCluster for tests. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Sets the
Configuration . |
void |
setHadoopCluster(HadoopCluster hadoopCluster)
Sets the
HadoopCluster |
protected org.springframework.context.ApplicationContext applicationContext
protected org.apache.hadoop.conf.Configuration configuration
protected HadoopCluster hadoopCluster
public org.springframework.context.ApplicationContext getApplicationContext()
ApplicationContext
for tests.public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
public org.apache.hadoop.conf.Configuration getConfiguration()
Configuration
for tests.@Autowired public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Configuration
.configuration
- the Configurationpublic HadoopCluster getHadoopCluster()
HadoopCluster
for tests.@Autowired public void setHadoopCluster(HadoopCluster hadoopCluster)
HadoopCluster
hadoopCluster
- the Hadoop clusterprotected org.apache.hadoop.fs.FileSystem getFileSystem() throws java.io.IOException
FileSystem
instance for
test cases to read and write files to it.
Tests should use this FileSystem
instance.
java.io.IOException
- exception