// Copyright 2022 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package db_test import ( "context" "testing" "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" "github.com/stretchr/testify/assert" ) func TestIterate(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) xe := unittest.GetXORMEngine() assert.NoError(t, xe.Sync(&repo_model.RepoUnit{})) cnt, err := db.GetEngine(db.DefaultContext).Count(&repo_model.RepoUnit{}) assert.NoError(t, err) var repoUnitCnt int err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repo *repo_model.RepoUnit) error { repoUnitCnt++ return nil }) assert.NoError(t, err) assert.EqualValues(t, cnt, repoUnitCnt) err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error { has, err := db.ExistByID[repo_model.RepoUnit](ctx, repoUnit.ID) if err != nil { return err } if !has { return db.ErrNotExist{Resource: "repo_unit", ID: repoUnit.ID} } return nil }) assert.NoError(t, err) } jQuery clone for GWT, and much more: https://github.com/gwtquery/gwtquerywww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/update_docs_svn.sh
blob: 21993d25844916ec62dfc51e38a819c686e74388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# Script to update javadoc deployed in svn

pushd gwtquery-core
mvn javadoc:javadoc
popd

cp -r gwtquery-core/target/site/apidocs/* gwtquery-core/javadoc/

for i in `find gwtquery-core/javadoc/ -type d | grep -v .svn | sed -e 's#gwtquery-core/javadoc/##g' `
do
   [ ! -d gwtquery-core/target/site/apidocs/$i ] && svn delete gwtquery-core/javadoc/$i 
done

for i in `find gwtquery-core/javadoc/ -type f | grep -v .svn | sed -e 's#gwtquery-core/javadoc/##g' `
do
   [ ! -f gwtquery-core/target/site/apidocs/$i ] && svn delete gwtquery-core/javadoc/$i 
done

find gwtquery-core/javadoc/  | grep -v .svn | xargs svn add

find gwtquery-core/javadoc/ -type f -name "*html" -exec svn propset svn:mime-type text/html '{}' ';'


svn commit -m 'updated javadocs' gwtquery-core/javadoc/