@Test public void testSimpleGetDataSet() { ClassicQuandlSessionInterface session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/MSFT.csv"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/MSFT").build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
@Test public void testSimpleGetDataSet() { QuandlSession session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/MSFT.csv"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/MSFT").build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequest() { DataSetRequest.Builder.of(null).build(); }
@Test public void testMostComplexGetDataSet() { ClassicQuandlSessionInterface session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?start_date=2009-01-01&end_date=2010-12-31&column_index=4&collapse=quarterly&limit=10&transform=normalize"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL") .withStartDate(LocalDate.of(2009, 1, 1)) .withEndDate(LocalDate.of(2010, 12, 31)) .withMaxRows(10) .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestEndDate() { DataSetRequest.Builder.of("Hello").withEndDate(null).build(); }
/** * The main body of the code. */ private void run() { ClassicQuandlSession session = ClassicQuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder .of("WIKI/AAPL") .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); System.out.println(tabularResult.toPrettyPrintedString()); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestSortOrder() { DataSetRequest.Builder.of("Hello").withSortOrder(null).build(); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestEndDate() { DataSetRequest.Builder.of("Hello").withEndDate(null).build(); }
public TABLE_TYPE getDataSet(final String symbol) { return getDataSet(DataSetRequest.Builder.of(symbol).build()); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestFrequency() { DataSetRequest.Builder.of("Hello").withFrequency(null).build(); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestStartDate() { DataSetRequest.Builder.of("Hello").withStartDate(null).build(); }
@Test public void testMostComplexGetDataSet() { QuandlSession session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?start_date=2009-01-01&end_date=2010-12-31&column_index=4&collapse=quarterly&limit=10&transform=normalize"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL") .withStartDate(LocalDate.of(2009, 1, 1)) .withEndDate(LocalDate.of(2010, 12, 31)) .withMaxRows(10) .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder .of("WIKI/AAPL") .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); System.out.println(tabularResult.toPrettyPrintedString()); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestTransform() { DataSetRequest.Builder.of("Hello").withTransform(null).build(); }
@Test(expectedExceptions = QuandlRuntimeException.class) public final void testDataSetRequestSortOrder() { DataSetRequest.Builder.of("Hello").withSortOrder(null).build(); }
/** * The main body of the code. */ private void run() { TableSawQuandlSession session = TableSawQuandlSession.create(); Table table = session.getDataSet( DataSetRequest.Builder.of("WIKI/AAPL").withMaxRows(10).build()); System.out.println(table); }
@Test public void testMoreComplexGetDataSet() { QuandlSession session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?column_index=4&collapse=quarterly&transform=normalize"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL") .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
/** * The main body of the code. */ private void run() { ClassicQuandlSession session = ClassicQuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder.of("WIKI/AAPL").withMaxRows(10).build()); System.out.println(tabularResult.toPrettyPrintedString()); }
@Test public void testMoreComplexGetDataSet() { ClassicQuandlSessionInterface session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?column_index=4&collapse=quarterly&transform=normalize"); TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL") .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder.of("WIKI/AAPL").build()); System.out.println(tabularResult.toPrettyPrintedString()); }