Skip to content

Commit

Permalink
Add test structure
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Fahey <claudio.fahey@dell.com>
  • Loading branch information
Claudio Fahey committed Jun 1, 2020
1 parent 2b3a033 commit 0e57327
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pravega-client-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ archivesBaseName = 'pravega-client-examples'
resources

ext {
// junitJupiterVersion = '5.3.1'
junitVersion = '4.11'
commonsCLIVersion = '1.4'
}

dependencies {
testCompile "junit:junit:${junitVersion}"
// testCompile "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
testCompile "io.pravega:pravega-standalone:${pravegaVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"

compile "io.pravega:pravega-client:${pravegaVersion}",
"io.pravega:pravega-common:${pravegaVersion}",
Expand Down
2 changes: 1 addition & 1 deletion pravega-client-examples/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</encoder>
</appender>

<root level="ERROR">
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package io.pravega.example;

import io.pravega.utils.SetupUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicReference;

public class StreamProcessingTest {
static final Logger log = LoggerFactory.getLogger(StreamProcessingTest.class);

protected static final AtomicReference<SetupUtils> SETUP_UTILS = new AtomicReference<>();

@BeforeClass
public static void setup() throws Exception {
SETUP_UTILS.set(new SetupUtils());
if( SETUP_UTILS.get() == null) throw new RuntimeException("This is null");
SETUP_UTILS.get().startAllServices();
}

@AfterClass
public static void tearDown() throws Exception {
SETUP_UTILS.get().stopAllServices();
}

@Test
public void basicWriterTest() throws IOException {
String methodName = (new Object() {}).getClass().getEnclosingMethod().getName();
log.info("Test case: {}", methodName);
}
}
Loading

0 comments on commit 0e57327

Please sign in to comment.