Examples of SqlServerEnvironment


Examples of dbfit.environment.SqlServerEnvironment

public class SqlServerDbEnvironmentUnitTests {

    @Test
    public void buildInsertCommand_AllInputParameters() throws Exception {
        dbfit.environment.SqlServerEnvironment env = new SqlServerEnvironment("SqlServer");

        String expectedResult = "insert into DummyTable([Column1],[Column Two],[ColumnThree]) values (?,?,?)";
        DbParameterAccessor[] parameters = new DbParameterAccessor[3];

        parameters[0] = new DbParameterAccessor("Column1", Direction.INPUT, 0, null, 0);
        parameters[1] = new DbParameterAccessor("Column Two", Direction.INPUT, 0, null, 1);
        parameters[2] = new DbParameterAccessor("ColumnThree", Direction.INPUT, 0, null, 2);

        String actualResult = env.buildInsertCommand("DummyTable", parameters);

        assertEquals(expectedResult, actualResult);
    }
View Full Code Here

Examples of dbfit.environment.SqlServerEnvironment

        assertEquals(expectedResult, actualResult);
    }

    @Test
    public void buildInsertCommand_SpiceItUpWithAnOutputParameter() throws Exception {
        dbfit.environment.SqlServerEnvironment env = new SqlServerEnvironment("SqlServer");

        String expectedResult = "insert into DummyTable([Column1]) values (?)";
        DbParameterAccessor[] parameters = new DbParameterAccessor[2];

        parameters[0] = new DbParameterAccessor("Column1", Direction.INPUT, 0, null, 0);
        parameters[1] = new DbParameterAccessor("Column2", Direction.OUTPUT, 0, null, 0);

        String actualResult = env.buildInsertCommand("DummyTable", parameters);

        assertEquals(expectedResult, actualResult);
    }
View Full Code Here

Examples of org.jtester.module.database.environment.impl.SqlServerEnvironment

    case MYSQL:
      return new MySqlEnvironment(dataSourceName, dataSourceFrom);
    case ORACLE:
      return new OracleEnvironment(dataSourceName, dataSourceFrom);
    case SQLSERVER:
      return new SqlServerEnvironment(dataSourceName, dataSourceFrom);
    case DERBYDB:
      return new DerbyEnvironment(dataSourceName, dataSourceFrom);
    default:
      throw new RuntimeException("unsupport database type:" + dataSourceType.name());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.