BAEL-4516: Cleanup sources
This commit is contained in:
parent
0df340f847
commit
92d27d3876
@ -5,11 +5,11 @@ plugins{
|
||||
description = "Gradle 5 root project"
|
||||
allprojects {
|
||||
apply plugin :"java"
|
||||
apply plugin :"nebula.lint"
|
||||
gradleLint {
|
||||
rules=['unused-dependency']
|
||||
reportFormat = 'text'
|
||||
}
|
||||
// apply plugin :"nebula.lint"
|
||||
// gradleLint {
|
||||
// rules=['unused-dependency']
|
||||
// reportFormat = 'text'
|
||||
// }
|
||||
group = "com.baeldung"
|
||||
version = "0.0.1"
|
||||
sourceCompatibility = "1.8"
|
||||
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
|
||||
|
@ -1,10 +1,12 @@
|
||||
|
||||
apply plugin: "eclipse"
|
||||
// apply plugin: "eclipse"
|
||||
apply plugin: "java"
|
||||
|
||||
description = "Source Sets example"
|
||||
|
||||
task printSourceSetInformation(){
|
||||
description = "Print source set information"
|
||||
|
||||
doLast{
|
||||
sourceSets.each { srcSet ->
|
||||
println "["+srcSet.name+"]"
|
||||
@ -19,14 +21,6 @@ task printSourceSetInformation(){
|
||||
}
|
||||
}
|
||||
|
||||
task printConfigurationInformation(){
|
||||
doLast{
|
||||
configurations.each { config ->
|
||||
println "["+config.name+"]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets{
|
||||
itest {
|
||||
compileClasspath += sourceSets.main.output
|
||||
@ -42,26 +36,31 @@ test {
|
||||
}
|
||||
}
|
||||
|
||||
// main {
|
||||
// java {
|
||||
// srcDir('src/random')
|
||||
// }
|
||||
// }
|
||||
dependencies {
|
||||
implementation('org.apache.httpcomponents:httpclient:4.5.12')
|
||||
testImplementation('junit:junit:4.12')
|
||||
itestImplementation('com.google.guava:guava:29.0-jre')
|
||||
}
|
||||
|
||||
configurations {
|
||||
itestImplementation.extendsFrom(testImplementation)
|
||||
itestRuntimeOnly.extendsFrom(t)
|
||||
task itest(type: Test) {
|
||||
description = "Run integration tests"
|
||||
group = "verification"
|
||||
testClassesDirs = sourceSets.itest.output.classesDirs
|
||||
classpath = sourceSets.itest.runtimeClasspath
|
||||
}
|
||||
|
||||
task itest(Type: test) {
|
||||
|
||||
itest {
|
||||
testLogging {
|
||||
events "passed","skipped", "failed"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
itestImplementation.extendsFrom(testImplementation)
|
||||
itestRuntimeOnly.extendsFrom(testRuntimeOnly)
|
||||
}
|
||||
|
||||
|
||||
// eclipse {
|
||||
// classpath {
|
||||
// plusConfigurations+=[configurations.itestCompileClasspath]
|
||||
|
@ -3,27 +3,29 @@ package com.baeldung.itest;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
//import java.util.List;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.main.SourceSetsObject;
|
||||
//import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class SourceSetsItest {
|
||||
|
||||
|
||||
@Test
|
||||
public void whenRunThenSuccess() {
|
||||
|
||||
SourceSetsObject underTest = new SourceSetsObject("lorem","ipsum");
|
||||
SourceSetsObject underTest = new SourceSetsObject("lorem", "ipsum");
|
||||
|
||||
assertThat(underTest.getUser(), is("lorem"));
|
||||
assertThat(underTest.getPassword(), is("ipsum"));
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void whenRunThenFail() {
|
||||
// List<String> someStrings = ImmutableList.of("Baeldung", "is", "cool");
|
||||
// assertThat(false, is(true));
|
||||
// }
|
||||
|
||||
@Test
|
||||
public void givenImmutableListwhenRunThenSuccess() {
|
||||
|
||||
List<String> someStrings = ImmutableList.of("Baeldung", "is", "cool");
|
||||
|
||||
assertThat(someStrings.size(), is(3));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user