Search in sources :

Example 1 with BaseExchange

use of org.knowm.xchange.BaseExchange in project XChange by knowm.

the class MetaDataFileTest method metaDataFileNameTest.

@Test
public void metaDataFileNameTest() {
    ExchangeSpecification exSpec = new ExchangeSpecification(OkCoinExchange.class);
    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    String metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    Assert.isTrue("okcoin_china".equals(metaDataFileName), "the meta data file name not equal \"okcoin_china\" ???");
    System.out.println("metaDataFileName=" + metaDataFileName);
    exSpec.setExchangeSpecificParametersItem("Use_Intl", true);
    metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    Assert.isTrue("okcoin_intl".equals(metaDataFileName), "the meta data file name not equal \"okcoin_intl\" ???");
    System.out.println("metaDataFileName=" + metaDataFileName);
    exSpec.setExchangeSpecificParametersItem("Use_Intl", true);
    exSpec.setExchangeSpecificParametersItem("Use_Futures", true);
    metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    Assert.isTrue("okcoin_futures".equals(metaDataFileName), "the meta data file name not equal \"okcoin_futures\" ???");
    System.out.println("metaDataFileName=" + metaDataFileName);
}
Also used : BaseExchange(org.knowm.xchange.BaseExchange) OkCoinExchange(org.knowm.xchange.okcoin.OkCoinExchange) Exchange(org.knowm.xchange.Exchange) BaseExchange(org.knowm.xchange.BaseExchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) Test(org.junit.Test)

Example 2 with BaseExchange

use of org.knowm.xchange.BaseExchange in project XChange by knowm.

the class MetaDataFileTest method loadMetaDataFileNameForChinaTest.

@Test
public void loadMetaDataFileNameForChinaTest() {
    ExchangeSpecification exSpec = new ExchangeSpecification(OkCoinExchange.class);
    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    String metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    loadMetaDataFileContents(metaDataFileName);
    exSpec.setExchangeSpecificParametersItem("Use_Intl", true);
    metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    loadMetaDataFileContents(metaDataFileName);
    exSpec.setExchangeSpecificParametersItem("Use_Intl", true);
    exSpec.setExchangeSpecificParametersItem("Use_Futures", true);
    metaDataFileName = ((BaseExchange) exchange).getMetaDataFileName(exSpec);
    loadMetaDataFileContents(metaDataFileName);
}
Also used : BaseExchange(org.knowm.xchange.BaseExchange) OkCoinExchange(org.knowm.xchange.okcoin.OkCoinExchange) Exchange(org.knowm.xchange.Exchange) BaseExchange(org.knowm.xchange.BaseExchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 BaseExchange (org.knowm.xchange.BaseExchange)2 Exchange (org.knowm.xchange.Exchange)2 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)2 OkCoinExchange (org.knowm.xchange.okcoin.OkCoinExchange)2