<commit_before>/*
 * Copyright 2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.gradle.integtests.resolve.custom

import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import org.gradle.integtests.fixtures.SFTPServer
import org.junit.Rule
import org.gradle.integtests.fixtures.IvyRepository
import spock.lang.IgnoreIf
import org.gradle.util.Jvm
import org.gradle.internal.os.OperatingSystem

@IgnoreIf ( { OperatingSystem.current().isWindows() })
class IvySFtpResolverIntegrationTest extends AbstractIntegrationSpec {

    @Rule
    public final SFTPServer server = new SFTPServer(2022, "127.0.0.1")

    def "setup"() {
        requireOwnUserHomeDir()
    }

    public void "can resolve and cache dependencies from an SFTP Ivy repository"() {
        given:
        def repo = ivyRepo()
        
        def module = repo.module('group', 'projectA', '1.2')
        def ivyModule =  module.publish()
        println ivyModule.ivyFile.absolutePath
        println ivyModule.jarFile.absolutePath

        and:
        buildFile << """<commit_msg>GRADLE-2104 fix unused imports<commit_after>/*
 * Copyright 2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.gradle.integtests.resolve.custom

import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import org.gradle.integtests.fixtures.IvyRepository
import org.gradle.integtests.fixtures.SFTPServer
import org.gradle.internal.os.OperatingSystem
import org.junit.Rule
import spock.lang.IgnoreIf

@IgnoreIf ( { OperatingSystem.current().isWindows() })
class IvySFtpResolverIntegrationTest extends AbstractIntegrationSpec {

    @Rule
    public final SFTPServer server = new SFTPServer(2022, "127.0.0.1")

    def "setup"() {
        requireOwnUserHomeDir()
    }

    public void "can resolve and cache dependencies from an SFTP Ivy repository"() {
        given:
        def repo = ivyRepo()
        
        def module = repo.module('group', 'projectA', '1.2')
        def ivyModule =  module.publish()
        println ivyModule.ivyFile.absolutePath
        println ivyModule.jarFile.absolutePath

        and:
        buildFile << """
{'fraction_non_alphanumeric': 0.08498759305210918, 'fraction_numerical': 0.013647642679900745, 'mean_word_length': 3.5168067226890756, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5018254', 'n_tokens_mistral': 920, 'n_tokens_neox': 880, 'n_words': 299}