<commit_before>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package functionalTests.filetransfer;

import java.io.File;
import java.util.List;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.objectweb.proactive.api.ProDeployment;
import org.objectweb.proactive.core.config.PAProperties;
import org.objectweb.proactive.core.descriptor.data.ProActiveDescriptor;
import org.objectweb.proactive.core.descriptor.data.VirtualNode;
import org.objectweb.proactive.core.filetransfer.RemoteFile;
import org.objectweb.proactive.core.node.Node;
import org.objectweb.proactive.core.util.URIBuilder;
import org.objectweb.proactive.core.util.log.ProActiveLogger;
import org.objectweb.proactive.core.xml.VariableContract;
import org.objectweb.proactive.core.xml.VariableContractType;

import functionalTests.FunctionalTest;
import static junit.framework.Assert.assertTrue;

/**
 * Tests that both schems work using the ProActive FileTransfer API
 */
public class TestDeployRetrieve extends FunctionalTest {
    static final long serialVersionUID = 1;
    private static Logger logger = ProActiveLogger.getLogger("functionalTests");
    private static String XML_LOCATION = TestAPI.class.getResource(
            "/functionalTests/filetransfer/TestDeployRetrieve.xml").getPath();
    ProActiveDescriptor pad;
    File fileTest = new File("/tmp/ProActiveTestFile.dat");
    File fileRetrieved = new File("/tmp/ProActiveTestFileRetrieved.dat");
    File fileDeployed = new File("/tmp/ProActiveTestFileDeployed.dat");
    File fileRetrieved2 = new File("/tmp/ProActiveTestFileRetrieved2.dat");
    File fileDeployed2 = new File("/tmp/ProActiveTestFileDeployed2.dat");
    static int testblocksize = org.objectweb.proactive.core.filetransfer.FileBlock.DEFAULT_BLOCK_SIZE;
    static int testflyingblocks = org.objectweb.proactive.core.filetransfer.FileTransferService.DEFAULT_MAX_SIMULTANEOUS_BLOCKS;
    static int filesize = 2;

    //Descriptor variables
    String jvmProcess = "localJVM";
    String hostName = "localhost";

    @Before
    public void initTest() throws Exception {
        if (logger.isDebugEnabled()) {
            logger.debug("Creating " + filesize +
                "Mb random test file in /tmp");
        }

        //creates a new 2MB test file
        TestAPI.createRandomContentFile(fileTest.getAbsolutePath(), filesize);

        try {
            hostName = URIBuilder.getLocalAddress().getHostName();
        } catch (Exception e) {
            hostName = "localhost";
        }
    }

    @After
    public void endTest() throws Exception {
        if (pad != null) {
            pad.killall(false);
        }

        cleanIfNecessary(this.fileTest);
        cleanIfNecessary(this.fileDeployed);
        cleanIfNecessary(this.fileDeployed2);
        cleanIfNecessary(this.fileRetrieved2);
        cleanIfNecessary(this.fileRetrieved);
    }

    @Ignore
    @Test
    public void action() throws Exception {
        long fileTestSum = TestAPI.checkSum(fileTest);

        if (logger.isDebugEnabled()) {
            logger.debug("Loading descriptor from: " + XML_LOCATION);
        }
<commit_msg>OPEN - issue PROACTIVE-122: TestDeployRetrieve is deactivated  https://galpage-exp.inria.fr:8181/jira/browse/PROACTIVE-122<commit_after>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package functionalTests.filetransfer;

import java.io.File;
import java.util.List;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.objectweb.proactive.api.ProDeployment;
import org.objectweb.proactive.core.config.PAProperties;
import org.objectweb.proactive.core.descriptor.data.ProActiveDescriptor;
import org.objectweb.proactive.core.descriptor.data.VirtualNode;
import org.objectweb.proactive.core.filetransfer.RemoteFile;
import org.objectweb.proactive.core.node.Node;
import org.objectweb.proactive.core.util.URIBuilder;
import org.objectweb.proactive.core.util.log.ProActiveLogger;
import org.objectweb.proactive.core.xml.VariableContract;
import org.objectweb.proactive.core.xml.VariableContractType;

import functionalTests.FunctionalTest;
import static junit.framework.Assert.assertTrue;

/**
 * Tests that both schems work using the ProActive FileTransfer API
 */
public class TestDeployRetrieve extends FunctionalTest {
    static final long serialVersionUID = 1;
    private static Logger logger = ProActiveLogger.getLogger("functionalTests");
    private static String XML_LOCATION = TestAPI.class.getResource(
            "/functionalTests/filetransfer/TestDeployRetrieve.xml").getPath();
    ProActiveDescriptor pad;
    File fileTest = new File("/tmp/ProActiveTestFile.dat");
    File fileRetrieved = new File("/tmp/ProActiveTestFileRetrieved.dat");
    File fileDeployed = new File("/tmp/ProActiveTestFileDeployed.dat");
    File fileRetrieved2 = new File("/tmp/ProActiveTestFileRetrieved2.dat");
    File fileDeployed2 = new File("/tmp/ProActiveTestFileDeployed2.dat");
    static int testblocksize = org.objectweb.proactive.core.filetransfer.FileBlock.DEFAULT_BLOCK_SIZE;
    static int testflyingblocks = org.objectweb.proactive.core.filetransfer.FileTransferService.DEFAULT_MAX_SIMULTANEOUS_BLOCKS;
    static int filesize = 2;

    //Descriptor variables
    String jvmProcess = "localJVM";
    String hostName = "localhost";

    @Before
    public void initTest() throws Exception {
        if (logger.isDebugEnabled()) {
            logger.debug("Creating " + filesize +
                "Mb random test file in /tmp");
        }

        //creates a new 2MB test file
        TestAPI.createRandomContentFile(fileTest.getAbsolutePath(), filesize);

        try {
            hostName = URIBuilder.getLocalAddress().getHostName();
        } catch (Exception e) {
            hostName = "localhost";
        }
    }

    @After
    public void endTest() throws Exception {
        if (pad != null) {
            pad.killall(false);
        }

        cleanIfNecessary(this.fileTest);
        cleanIfNecessary(this.fileDeployed);
        cleanIfNecessary(this.fileDeployed2);
        cleanIfNecessary(this.fileRetrieved2);
        cleanIfNecessary(this.fileRetrieved);
    }

    @Test
    public void action() throws Exception {
        long fileTestSum = TestAPI.checkSum(fileTest);

        if (logger.isDebugEnabled()) {
            logger.debug("Loading descriptor from: " + XML_LOCATION);
        }

{'fraction_non_alphanumeric': 0.1178930710975472, 'fraction_numerical': 0.008590482649485701, 'mean_word_length': 3.620365535248042, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, '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': '2767988', 'n_tokens_mistral': 2516, 'n_tokens_neox': 2403, 'n_words': 639}