Skip to content

Conversation

@yangjianzhou
Copy link

1 . update .gitignore and ignore .iml . ipr and so on
2 . add xlsDataSetLoader and test it where XlsDataSetLoaderTest

Copy link

@ppodgorsek ppodgorsek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the inline comments, was there a reason to rename the context file?

*.iml
*.ipr
*.iws
*/*.iml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.iml

Suggested change
*/*.iml

*.ipr
*.iws
*/*.iml
*/*.iws

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.iws

Suggested change
*/*.iws

*.iws
*/*.iml
*/*.iws
*/*.ipr

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.ipr

Suggested change
*/*.ipr


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the existing configuration need to be changed?

Suggested change
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
@ContextConfiguration

assertEquals(1, personList.size());
assertEquals("wu", personList.get(0).getLastName());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also test testRemove() to be consistent with the above test class.

public class XlsDataSetLoader extends AbstractDataSetLoader {

@Override
protected IDataSet createDataSet(Resource resource) throws Exception {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected IDataSet createDataSet(Resource resource) throws Exception {
protected IDataSet createDataSet(final Resource resource) throws Exception {

import java.io.InputStream;

/**
* Created by yangjianzhou on 17-11-18.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Created by yangjianzhou on 17-11-18.
* {@link com.github.springtestdbunit.dataset.DataSetLoader DataSetLoader} for Excel (.xls) files.
*
* Created by yangjianzhou on 17-11-18.

import static org.junit.Assert.assertEquals;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
@ContextConfiguration

@ppodgorsek
Copy link

XLS support added in a maintained repository: https://github.com/ppodgorsek/spring-test-dbunit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants