<commit_before>import static org.jfrog.artifactory.client.ArtifactoryClient.create
import spock.lang.Specification

class Ivy2pomTest extends Specification {
    def 'test name'() {
        setup:
        def artifactory = create("http://localhost:8088/artifactory", "admin", "password")

        //when:

        //then:

        //cleanup:
    }
}
<commit_msg>Added working test for ivy2pom plugin<commit_after>import org.jfrog.artifactory.client.model.builder.impl.RepositoryBuildersImpl
import static org.jfrog.artifactory.client.ArtifactoryClient.create
import groovy.xml.MarkupBuilder
import spock.lang.Specification

class Ivy2pomTest extends Specification {
    def 'simple ivy to pom plugin test'() {
        setup:
        def artifactory = create("http://localhost:8088/artifactory", "admin", "password")
        def builder = RepositoryBuildersImpl.create()
        def repo1 = builder.localRepositoryBuilder().key('repo1').build()
        def ivy = builder.localRepositoryBuilder().key('ivy').repoLayoutRef('ivy-default').build()
        artifactory.repositories().create(0, repo1)
        artifactory.repositories().create(0, ivy)
        def ivypath = 'myorg/mymodule/2.0/ivy.xml'
        def pompath = 'myorg/mymodule/2.0/mymodule-2.0.pom'
        def xml = new StringWriter()
        new MarkupBuilder(xml).'ivy-module'(version: 2.0) {
            info(organisation: "myorg", module: "mymodule", revision: 2.0)
        }
        artifactory.repository('ivy').upload(ivypath, new ByteArrayInputStream(xml.toString().bytes)).doUpload()

        when:
        def pomfile = new XmlParser().parse(artifactory.repository('ext-release-local').download(pompath).doDownload())

        then:
        pomfile.groupId.text()== 'myorg'
        pomfile.artifactId.text()== 'mymodule'
        pomfile.version.text() == '2.0'

        cleanup:
        artifactory.repository('ext-release-local').delete('myorg')
        artifactory.repository('ivy').delete()
        artifactory.repository('repo1').delete()
    }
}

{'fraction_non_alphanumeric': 0.1357107478949975, 'fraction_numerical': 0.014363546310054482, 'mean_word_length': 3.261603375527426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4109087', 'n_tokens_mistral': 646, 'n_tokens_neox': 627, 'n_words': 103}