Search in sources :

Example 46 with RepoResult

use of com.searchcode.app.model.RepoResult in project searchcode-server by boyter.

the class RepoTest method testRepoSaveGetCacheBug.

public void testRepoSaveGetCacheBug() {
    this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
    for (int i = 0; i < 200; i++) {
        assertThat(repo.getRepoByName("myname")).isNotNull();
    }
    this.repo.deleteRepoByName("myname");
}
Also used : RepoResult(com.searchcode.app.model.RepoResult)

Example 47 with RepoResult

use of com.searchcode.app.model.RepoResult in project searchcode-server by boyter.

the class RepoTest method testGetRepoByNameUsingNull.

public void testGetRepoByNameUsingNull() {
    RepoResult repoResult = this.repo.getRepoByName(null);
    assertThat(repoResult).isNull();
}
Also used : RepoResult(com.searchcode.app.model.RepoResult)

Example 48 with RepoResult

use of com.searchcode.app.model.RepoResult in project searchcode-server by boyter.

the class RepoTest method testGetAllRepo.

public void testGetAllRepo() {
    this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
    assertThat(this.repo.getAllRepo().size()).isGreaterThanOrEqualTo(1);
    this.repo.deleteRepoByName("myname");
}
Also used : RepoResult(com.searchcode.app.model.RepoResult)

Example 49 with RepoResult

use of com.searchcode.app.model.RepoResult in project searchcode-server by boyter.

the class RepoTest method testRepoByUrlMemoryLeak.

public void testRepoByUrlMemoryLeak() {
    for (int i = 0; i < 200; i++) {
        this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
        assertThat(this.repo.getRepoByUrl("myurl")).isNotNull();
        this.repo.deleteRepoByName("myname");
    }
}
Also used : RepoResult(com.searchcode.app.model.RepoResult)

Example 50 with RepoResult

use of com.searchcode.app.model.RepoResult in project searchcode-server by boyter.

the class RepoTest method testRepoByUrl.

public void testRepoByUrl() {
    this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
    assertThat(this.repo.getRepoByUrl("myurl")).isNotNull();
    this.repo.deleteRepoByName("myname");
}
Also used : RepoResult(com.searchcode.app.model.RepoResult)

Aggregations

RepoResult (com.searchcode.app.model.RepoResult)59 Repo (com.searchcode.app.dao.Repo)13 ApiResponse (com.searchcode.app.dto.api.ApiResponse)9 RepoResultApiResponse (com.searchcode.app.dto.api.RepoResultApiResponse)9 Request (spark.Request)9 ValidatorResult (com.searchcode.app.model.ValidatorResult)8 ApiRouteService (com.searchcode.app.service.route.ApiRouteService)8 UniqueRepoQueue (com.searchcode.app.util.UniqueRepoQueue)8 Connection (java.sql.Connection)5 PreparedStatement (java.sql.PreparedStatement)5 SQLException (java.sql.SQLException)5 ResultSet (java.sql.ResultSet)4 ArrayList (java.util.ArrayList)3 RepositoryChanged (com.searchcode.app.dto.RepositoryChanged)2 RunningIndexJob (com.searchcode.app.dto.RunningIndexJob)2 File (java.io.File)2 Gson (com.google.gson.Gson)1 Data (com.searchcode.app.dao.Data)1 IndexBaseRepoJob (com.searchcode.app.jobs.repository.IndexBaseRepoJob)1 IndexFileRepoJob (com.searchcode.app.jobs.repository.IndexFileRepoJob)1