Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary and Varbinary types for framework #119

Merged
merged 4 commits into from
Jan 18, 2017

Conversation

Suraiya-Hameed
Copy link
Contributor

Support for binary and varbinary type.

The new files have same header as the rest of test framework, we can apply the changes throughout the source once header format is finalized.

@@ -251,16 +253,22 @@ String populateTableSql() {
for (int colNum = 0; colNum < totalColumns; colNum++) {

// TODO: add betterway to enclose data
if (JDBCType.CHAR == getColumn(colNum).getSqlType().getJdbctype()
if (JDBCType.CHAR == getColumn(colNum).getSqlType().getJdbctype()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Can we have one utility method to get JDBCType

public JDBCType getJDBCType(DBColumn column) {
 return column.getSqlType().getJdbcType();
}
```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, that sounds good.

|| JDBCType.VARCHAR == getColumn(colNum).getSqlType().getJdbctype()
|| JDBCType.NCHAR == getColumn(colNum).getSqlType().getJdbctype()
|| JDBCType.NVARCHAR == getColumn(colNum).getSqlType().getJdbctype()
|| JDBCType.TIMESTAMP == getColumn(colNum).getSqlType().getJdbctype()
|| JDBCType.DATE == getColumn(colNum).getSqlType().getJdbctype()
|| JDBCType.TIME == getColumn(colNum).getSqlType().getJdbctype())
|| JDBCType.TIME == getColumn(colNum).getSqlType().getJdbctype()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: In order to reduce complexity it is better to create new method having all conditions and call that method in your if condition.
If method is reusable then you can move this method to Util class. Otherwise create this helper method in same class.


import java.sql.JDBCType;
import java.util.concurrent.ThreadLocalRandom;

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add appropriate java docs?

@v-nisidh v-nisidh merged commit 85dd53d into microsoft:dev Jan 18, 2017
@Suraiya-Hameed Suraiya-Hameed deleted the frameworkUpdate branch January 18, 2017 23:40
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