Skip to content

Commit

Permalink
#46, make wilma-mock releasable (jar, src, pom) and fix func test tha…
Browse files Browse the repository at this point in the history
…t does not work except on official test env
  • Loading branch information
tkohegyi committed Jun 24, 2015
1 parent ec74b95 commit c6b0c68
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.net.Inet4Address;

/**
* Tests the localhost request blocking functionality.
Expand All @@ -49,6 +50,11 @@ public class BlockLocalhostUsageTest extends WilmaTestCase {

public void testLocalhostBlocking() throws Exception {
//given
String actualHost = Inet4Address.getLocalHost().getHostAddress();
if (!tcTargetUrl.contains(actualHost) && !tcTargetUrl.contains("127.0.0.1")) {
//in case we are in foreign test environment, or not testing the localhost, this TC should be N/A
naTestCase("Running on unknown test environment, marking this Test as N/A.");
}
setOperationModeTo(tcStubOperationState);
setLocalhostBlockingTo(tcState);
RequestParameters requestParameters = createRequestParameters();
Expand Down
28 changes: 24 additions & 4 deletions wilma-mock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ along with Wilma. If not, see <http://www.gnu.org/licenses/>.

description = "wilma-mock"

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'

group = 'com.epam.wilma.mock'
version = "$wilmaVersion"
version = "$wilmaVersion.$buildNumber"

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand All @@ -36,7 +34,8 @@ mainClassName = 'com.epam.wilma.mock.client.WilmaMock'
jar {
manifest.attributes( 'provider': 'gradle')
manifest.attributes( 'Main-Class': mainClassName)
manifest.attributes( 'Implementation-Title': "$componentName-v$version"+'.'+"$buildNumber")
manifest.attributes( 'Implementation-Title': "$componentName-v$version")
archiveName = "$componentName-$version"+'.jar'
}

repositories {
Expand All @@ -58,6 +57,7 @@ checkstyle.configFile = file("$rootProject.rootDir/config/checkstyle/checkstyle.
checkstyle.configProperties = ['samedir' : "$rootProject.rootDir/config/checkstyle"]
checkstyle.toolVersion = '5.6'
checkstyle.ignoreFailures = true

test.useTestNG()

configurations {
Expand Down Expand Up @@ -90,3 +90,23 @@ task jacocoReport(type: JacocoReport) {
})
}
}

task copyJarToDistributions (type: Copy) {
dependsOn(sourceZip)
from(rootProject.rootDir.absolutePath + '/wilma-mock/build/libs/')
into(rootProject.rootDir.absolutePath + '/wilma-mock/build/distributions')
}

task createPom << {
pom {
}.writeTo("$buildDir/distributions/wlima-mock-$version"+'.pom')

This comment has been minimized.

Copy link
@tkohegyi

tkohegyi Jun 25, 2015

Author Contributor

typo - pls fix by using: "$componentName-$version"+'.pom'

}
createPom.dependsOn(copyJarToDistributions)

uploadArchives {
repositories {
mavenDeployer {
repository(url: "${myLocalRepository}")
}
}
}
5 changes: 2 additions & 3 deletions wilma-mock/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
componentName=Wilma-Mock
buildNumber=DEV
org.gradle.daemon=true
componentName=wilma-mock
buildNumber=DEV

0 comments on commit c6b0c68

Please sign in to comment.