<commit_before>import spock.lang.Specification
import static org.jfrog.artifactory.client.ArtifactoryClient.create
import org.jfrog.artifactory.client.model.repository.settings.impl.NugetRepositorySettingsImpl
import org.apache.http.client.methods.*
import org.artifactory.repo.*
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.HttpResponseException

import javax.xml.ws.http.HTTPBinding
import static groovyx.net.http.Method.GET
import static groovyx.net.http.ContentType.TEXT


class BeforeSymbolServerDownloadTest extends Specification {

    static final user = 'admin'
    static final password='password'
    static final userPassword="<PASSWORD>"
    static final auth = "Basic ${userPassword.bytes.encodeBase64()}"
    static final url = "http://msdl.microsoft.com/download/symbols"
    static final filePath ='wininet.pdb/7CE26DE332694328B6EB5F3C69DB20CC2/wininet.pd_'
    def repokey = 'microsoft-symbols'

    def 'before Symbol Server download test '() {
        setup:
        def baseurl = 'http://localhost:8088/artifactory'
        def artifactory = create(baseurl, 'admin', 'password')
	def builder = artifactory.repositories().builders()

	def remoteRepo= builder.remoteRepositoryBuilder().key(repokey).url(url).repositorySettings(new NugetRepositorySettingsImpl()).build()
	artifactory.repositories().create(0,remoteRepo)
	
	when:
	def http = new HTTPBuilder("${baseurl}/${repokey}/${filePath}")
	http.setHeaders([Authorization: "${auth}"]) 

	then:
        def verified = http.request(GET, TEXT) { req ->
            response.success = { resp, inputStream ->
            }
	 }
	sleep(5000)

        when :
	def logfile ='http://localhost:8088/logs/artifactory.log'
  	def conn 
        conn = new URL (logfile).openConnection()
        conn.requestMethod = 'GET'
        conn.setRequestProperty('Authorization', auth)
        assert conn.responseCode == 200
        def reader = new InputStreamReader(conn.inputStream)
        def textlog = reader.text
        conn.disconnect()
	
	then:
	assert textlog.contains("User-Agent: Microsoft-Symbol-Server/6.3.9600.17095")==true
 
        cleanup:
	artifactory.repository(repokey).delete()
    }
}
<commit_msg>update logfile download url using artifactory api<commit_after>import spock.lang.Specification
import static org.jfrog.artifactory.client.ArtifactoryClient.create
import org.jfrog.artifactory.client.model.repository.settings.impl.NugetRepositorySettingsImpl
import org.apache.http.client.methods.*
import org.artifactory.repo.*
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.HttpResponseException

import javax.xml.ws.http.HTTPBinding
import static groovyx.net.http.Method.GET
import static groovyx.net.http.ContentType.TEXT


class BeforeSymbolServerDownloadTest extends Specification {

    static final user = 'admin'
    static final password='password'
    static final userPassword="<PASSWORD>"
    static final auth = "Basic ${userPassword.bytes.encodeBase64()}"
    static final url = "http://msdl.microsoft.com/download/symbols"
    static final filePath ='wininet.pdb/7CE26DE332694328B6EB5F3C69DB20CC2/wininet.pd_'
    def repokey = 'microsoft-symbols'

    def 'before Symbol Server download test '() {
        setup:
        def baseurl = 'http://localhost:8088/artifactory'
        def artifactory = create(baseurl, 'admin', 'password')
	def builder = artifactory.repositories().builders()

	def remoteRepo= builder.remoteRepositoryBuilder().key(repokey).url(url).repositorySettings(new NugetRepositorySettingsImpl()).build()
	artifactory.repositories().create(0,remoteRepo)
	
	when:
	def http = new HTTPBuilder("${baseurl}/${repokey}/${filePath}")
	http.setHeaders([Authorization: "${auth}"]) 

	then:
        def verified = http.request(GET, TEXT) { req ->
            response.success = { resp, inputStream ->
            }
	 }
	sleep(5000)

        when :
	def logfile ='http://localhost:8088/artifactory/api/systemlogs/downloadFile?id=artifactory.log'
  	def conn 
        conn = new URL (logfile).openConnection()
        conn.requestMethod = 'GET'
        conn.setRequestProperty('Authorization', auth)
        assert conn.responseCode == 200
        def reader = new InputStreamReader(conn.inputStream)
        def textlog = reader.text
        conn.disconnect()
	
	then:
	assert textlog.contains("User-Agent: Microsoft-Symbol-Server/6.3.9600.17095")
 
        cleanup:
	artifactory.repository(repokey).delete()
    }
}

{'fraction_non_alphanumeric': 0.11531531531531532, 'fraction_numerical': 0.022072072072072072, 'mean_word_length': 3.9620111731843575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6818173', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1319, 'n_words': 254}