Search in sources :

Example 76 with Disabled

use of org.junit.jupiter.api.Disabled in project mybatis-3 by mybatis.

the class ScriptRunnerTest method shouldRunScriptsBySendingFullScriptAtOnce.

@Test
@Disabled("This fails with HSQLDB 2.0 due to the create index statements in the schema script")
void shouldRunScriptsBySendingFullScriptAtOnce() throws Exception {
    DataSource ds = createUnpooledDataSource(JPETSTORE_PROPERTIES);
    Connection conn = ds.getConnection();
    ScriptRunner runner = new ScriptRunner(conn);
    runner.setSendFullScript(true);
    runner.setAutoCommit(true);
    runner.setStopOnError(false);
    runner.setErrorLogWriter(null);
    runner.setLogWriter(null);
    conn.close();
    runJPetStoreScripts(runner);
    assertProductsTableExistsAndLoaded();
}
Also used : Connection(java.sql.Connection) PooledDataSource(org.apache.ibatis.datasource.pooled.PooledDataSource) DataSource(javax.sql.DataSource) UnpooledDataSource(org.apache.ibatis.datasource.unpooled.UnpooledDataSource) BaseDataTest(org.apache.ibatis.BaseDataTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 77 with Disabled

use of org.junit.jupiter.api.Disabled in project mybatis-3 by mybatis.

the class DuplicateStatementsTest method shouldGetFirstFourUsers_Annotated.

@Test
@Disabled("fails currently - issue 507")
void shouldGetFirstFourUsers_Annotated() {
    sqlSessionFactory.getConfiguration().addMapper(AnnotatedMapper.class);
    try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
        AnnotatedMapper mapper = sqlSession.getMapper(AnnotatedMapper.class);
        List<User> users = mapper.getAllUsers(new RowBounds(0, 4));
        Assertions.assertEquals(4, users.size());
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) RowBounds(org.apache.ibatis.session.RowBounds) Test(org.junit.jupiter.api.Test) BaseDataTest(org.apache.ibatis.BaseDataTest) Disabled(org.junit.jupiter.api.Disabled)

Example 78 with Disabled

use of org.junit.jupiter.api.Disabled in project mybatis-3 by mybatis.

the class SelectKeyTest method testAnnotatedUpdateTable2WithGeneratedKey.

@Test
@Disabled("HSQLDB is not returning the generated column after the update")
void testAnnotatedUpdateTable2WithGeneratedKey() {
    try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
        Name name = new Name();
        name.setName("barney");
        AnnotatedMapper mapper = sqlSession.getMapper(AnnotatedMapper.class);
        int rows = mapper.insertTable2WithGeneratedKey(name);
        assertEquals(1, rows);
        assertEquals(22, name.getNameId());
        assertEquals("barney_fred", name.getGeneratedName());
        name.setName("Wilma");
        rows = mapper.updateTable2WithGeneratedKey(name);
        assertEquals(1, rows);
        assertEquals(22, name.getNameId());
        assertEquals("Wilma_fred", name.getGeneratedName());
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) BaseDataTest(org.apache.ibatis.BaseDataTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 79 with Disabled

use of org.junit.jupiter.api.Disabled in project mybatis-3 by mybatis.

the class BindingTest method shouldExecuteBoundSelectBlogUsingConstructorWithResultMapCollection.

@Disabled
// issue #480 and #101
@Test
void shouldExecuteBoundSelectBlogUsingConstructorWithResultMapCollection() {
    try (SqlSession session = sqlSessionFactory.openSession()) {
        BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
        Blog blog = mapper.selectBlogUsingConstructorWithResultMapCollection(1);
        assertEquals(1, blog.getId());
        assertEquals("Jim Business", blog.getTitle());
        assertNotNull(blog.getAuthor(), "author should not be null");
        List<Post> posts = blog.getPosts();
        assertTrue(posts != null && !posts.isEmpty(), "posts should not be empty");
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) DraftPost(org.apache.ibatis.domain.blog.DraftPost) Post(org.apache.ibatis.domain.blog.Post) Blog(org.apache.ibatis.domain.blog.Blog) BaseDataTest(org.apache.ibatis.BaseDataTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 80 with Disabled

use of org.junit.jupiter.api.Disabled in project mybatis-3 by mybatis.

the class TimestampWithTimezoneTypeHandlerTest method shouldInsertOffsetTime.

@Disabled("HSQLDB 2.4.1 does not support this.")
@Test
void shouldInsertOffsetTime() {
    OffsetTime ot = OffsetTime.of(11, 22, 33, 123456000, ZoneOffset.ofHoursMinutes(1, 23));
    try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
        Mapper mapper = sqlSession.getMapper(Mapper.class);
        Record record = new Record();
        record.setId(3);
        record.setOt(ot);
        int result = mapper.insertOffsetTime(record);
        assertEquals(1, result);
        sqlSession.commit();
    }
    try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
        Mapper mapper = sqlSession.getMapper(Mapper.class);
        Record record = mapper.selectById(3);
        assertEquals(ot, record.getOt());
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) OffsetTime(java.time.OffsetTime) BaseDataTest(org.apache.ibatis.BaseDataTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)228 Test (org.junit.jupiter.api.Test)214 File (java.io.File)13 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)9 NAR (nars.NAR)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 BaseDataTest (org.apache.ibatis.BaseDataTest)8 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7 SqlSession (org.apache.ibatis.session.SqlSession)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 AnswerSet (at.ac.tuwien.kr.alpha.api.AnswerSet)6 ASPCore2Program (at.ac.tuwien.kr.alpha.api.programs.ASPCore2Program)6 FieldValueModel (com.synopsys.integration.alert.common.rest.model.FieldValueModel)6 IntegrationPerformanceTestRunner (com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner)6 List (java.util.List)6 RectDouble2D (jcog.tree.rtree.rect.RectDouble2D)6