Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * $Id: 23824 2012-02-06 17:47:44Z evangelinamrm $
  * --------------------------------------------------------------------------------------
  * Copyright (c) MuleSoft, Inc.  All rights reserved.
  * The software in this package is published under the terms of the CPAL v1.0
  * license, a copy of which has been included with this distribution in the
  * LICENSE.txt file.
package org.mule.transport.sftp.dataintegrity;
import static org.junit.Assert.assertTrue;
Tests that files are not deleted if the temp directory can't be created
    private static final int EXCEPTION_TIMEOUT = 3000;
    private static String INBOUND_ENDPOINT_NAME = "inboundEndpoint";
    public SftpCantCreateTempDirectoryTestCase(ConfigVariant variantString configResources)
    public static Collection<Object[]> parameters()
        return Arrays.asList(new Object[][]{
    public void before() throws Exception
    // Commented because it's failing even though the test is excluded
    public void after() throws Exception
        Runtime.getRuntime().exec(new String[]{"chmod""777"});

No write access on the outbound directory and thus the TEMP directory cant be created. The source file should still exist
    public void testCantCreateTempDirectory() throws Exception
        MuleClient muleClient = new MuleClient();
        Runtime.getRuntime().exec(new String[]{"chmod""320"});
        final CountDownLatch exceptionLatch = new CountDownLatch(1);
        .registerListener(new LatchDownExceptionListener(exceptionLatch));
        muleClient.dispatch("sftp://localhost:" + .getNumber() + "/" + ,
New to GrepCode? Check out our FAQ X