Package org.sonar.core.persistence

Examples of org.sonar.core.persistence.MyBatis


  private FakeDao dao;
  private DbSession session;

  @BeforeClass
  public static void setupBatis() {
    MyBatis batis = db.myBatis();
    batis.getSessionFactory().getConfiguration().getTypeAliasRegistry().registerAlias(DTO_ALIAS, FakeDto.class);
    batis.getSessionFactory().getConfiguration().addMapper(FakeMapper.class);
  }
View Full Code Here


  @Rule
  public TestDatabase db = new TestDatabase();

  @Test
  public void facade() throws Exception {
    MyBatis myBatis = db.myBatis();
    RuleDao ruleDao = new RuleDao(System2.INSTANCE);
    QualityProfileDao qualityProfileDao = new QualityProfileDao(myBatis, System2.INSTANCE);
    ActiveRuleDao activeRuleDao = new ActiveRuleDao(qualityProfileDao, ruleDao, System2.INSTANCE);

    DbClient client = new DbClient(db.database(), myBatis, ruleDao, activeRuleDao, qualityProfileDao);
View Full Code Here

  CoverageService service;

  @Before
  public void setUp() throws Exception {
    MyBatis myBatis = mock(MyBatis.class);
    when(myBatis.openSession(false)).thenReturn(session);
    service = new CoverageService(myBatis, measureDao, snapshotPerspectives);
  }
View Full Code Here

  @Before
  public void setUp() {
    MockUserSession.set().setLogin("admin").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);

    MyBatis myBatis = mock(MyBatis.class);
    when(myBatis.openSession(false)).thenReturn(session);
    service = new InternalPermissionTemplateService(myBatis, permissionTemplateDao, userDao, finder);
  }
View Full Code Here

      databaseCommands = DatabaseCommands.forDialect(database.getDialect());

      dbConnector = new MemoryDatabaseConnector(database);
      dbConnector.start();

      myBatis = new MyBatis(database, new Logback(), new NullQueue());
      myBatis.start();
    }
  }
View Full Code Here

    PermissionTemplateMapper mapper = mock(PermissionTemplateMapper.class);

    DbSession session = mock(DbSession.class);
    when(session.getMapper(PermissionTemplateMapper.class)).thenReturn(mapper);

    MyBatis myBatis = mock(MyBatis.class);
    when(myBatis.openSession(false)).thenReturn(session);

    permissionTemplateDao = new PermissionTemplateDao(myBatis, system);
    PermissionTemplateDto permissionTemplate = permissionTemplateDao.createPermissionTemplate(PermissionTemplateDto.DEFAULT.getName(), null, null);

    verify(mapper).insert(permissionTemplate);
View Full Code Here

TOP

Related Classes of org.sonar.core.persistence.MyBatis

Copyright © 2018 www.massapicom. 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.