Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
FALCON-2314 Bump TestNG version to 6.13.1 to avoid BeanShell dependency
Build and tests are good locally.

Author: Denes Bodo <dbodo@hortonworks.com>

Reviewers: @pallavi-rao

Closes #390 from dionusos/FALCON-2314 and squashes the following commits:

84075a5 [Denes Bodo] Correct member name
5d68a99 [Denes Bodo] FALCON-2314 Bump TestNG version to 6.13.1 to avoid BeanShell dependency
  • Loading branch information
Denes Bodo authored and Pallavi Nagesha Rao committed Feb 21, 2018
1 parent a819b5b commit 3c2d79497832ce7c28dd672e4f9b161a527b50f2
Showing 2 changed files with 11 additions and 9 deletions.
@@ -39,7 +39,8 @@ public class EvictedInstanceSerDeTest {

private EmbeddedCluster cluster;
private FileSystem fs;
private Path csvFilePath;
private Path csvFilePathWithNoContent;
private Path csvFilePathWithContent;
private StringBuffer evictedInstancePaths = new StringBuffer(
"thrift://falcon-distcp-1.cs1cloud.internal:9083/default/retention_hours_7/year=2010")
.append(EvictedInstanceSerDe.INSTANCEPATH_SEPARATOR)
@@ -51,7 +52,8 @@ public void start() throws Exception {
String hdfsUrl = cluster.getConf().get(HadoopClientFactory.FS_DEFAULT_NAME_KEY);

fs = FileSystem.get(cluster.getConf());
csvFilePath = new Path(hdfsUrl + "/falcon/staging/feed/instancePaths-2014-10-01-01-00.csv");
csvFilePathWithNoContent = new Path(hdfsUrl + "/falcon/staging/feed/instancePaths-2014-10-01-01-00.csv");
csvFilePathWithContent = new Path(hdfsUrl + "/falcon/staging/feed/instancePaths-2014-10-01-02-00.csv");
}

@AfterClass
@@ -61,27 +63,27 @@ public void close() throws Exception {

@Test
public void testSerializeEvictedInstancePathsForNoEviction() throws Exception {
EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePath, new StringBuffer());
EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePathWithNoContent, new StringBuffer());

Assert.assertEquals(readLogFile(csvFilePath),
Assert.assertEquals(readLogFile(csvFilePathWithNoContent),
EvictedInstanceSerDe.INSTANCEPATH_PREFIX);
}

@Test
public void testSerializeEvictedInstancePathsWithEviction() throws Exception {
EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePath, evictedInstancePaths);
Assert.assertEquals(readLogFile(csvFilePath), evictedInstancePaths.toString());
EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePathWithContent, evictedInstancePaths);
Assert.assertEquals(readLogFile(csvFilePathWithContent), evictedInstancePaths.toString());
}

@Test(dependsOnMethods = "testSerializeEvictedInstancePathsForNoEviction")
public void testDeserializeEvictedInstancePathsForNoEviction() throws Exception {
String[] instancePaths = EvictedInstanceSerDe.deserializeEvictedInstancePaths(fs, csvFilePath);
String[] instancePaths = EvictedInstanceSerDe.deserializeEvictedInstancePaths(fs, csvFilePathWithNoContent);
Assert.assertEquals(instancePaths.length, 0);
}

@Test(dependsOnMethods = "testSerializeEvictedInstancePathsWithEviction")
public void testDeserializeEvictedInstancePathsWithEviction() throws Exception {
String[] instancePaths = EvictedInstanceSerDe.deserializeEvictedInstancePaths(fs, csvFilePath);
String[] instancePaths = EvictedInstanceSerDe.deserializeEvictedInstancePaths(fs, csvFilePathWithContent);
Assert.assertEquals(instancePaths.length, 2);
Assert.assertTrue(instancePaths[0].equals(
"thrift://falcon-distcp-1.cs1cloud.internal:9083/default/retention_hours_7/year=2010"));
@@ -810,7 +810,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<version>6.13.1</version>
<scope>test</scope>
</dependency>

0 comments on commit 3c2d794

Please sign in to comment.