Search in sources :

Example 1 with Aria2cRetriever

use of com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever in project otter by alibaba.

the class Aria2cDownLoadIntegration method testDownLoad_ok.

@Test
public void testDownLoad_ok() {
    DataRetriever retriever = new Aria2cRetriever("http://china.alibaba.com", tmp);
    try {
        retriever.connect();
        retriever.doRetrieve();
    } catch (DataRetrieveException ex) {
        retriever.abort();
    } finally {
        retriever.disconnect();
    }
}
Also used : Aria2cRetriever(com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever) DataRetrieveException(com.alibaba.otter.node.etl.common.io.download.exception.DataRetrieveException) DataRetriever(com.alibaba.otter.node.etl.common.io.download.DataRetriever) Test(org.testng.annotations.Test) BaseOtterTest(com.alibaba.otter.node.etl.BaseOtterTest)

Example 2 with Aria2cRetriever

use of com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever in project otter by alibaba.

the class Aria2cDownLoadIntegration method testDownLoad_failed.

@Test
public void testDownLoad_failed() {
    DataRetriever retriever = new Aria2cRetriever("aaaaaaa/sssss", tmp);
    try {
        retriever.connect();
        retriever.doRetrieve();
    } catch (DataRetrieveException ex) {
        retriever.abort();
    } finally {
        retriever.disconnect();
    }
}
Also used : Aria2cRetriever(com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever) DataRetrieveException(com.alibaba.otter.node.etl.common.io.download.exception.DataRetrieveException) DataRetriever(com.alibaba.otter.node.etl.common.io.download.DataRetriever) Test(org.testng.annotations.Test) BaseOtterTest(com.alibaba.otter.node.etl.BaseOtterTest)

Aggregations

BaseOtterTest (com.alibaba.otter.node.etl.BaseOtterTest)2 DataRetriever (com.alibaba.otter.node.etl.common.io.download.DataRetriever)2 DataRetrieveException (com.alibaba.otter.node.etl.common.io.download.exception.DataRetrieveException)2 Aria2cRetriever (com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever)2 Test (org.testng.annotations.Test)2