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);
}
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);
}
Aggregations