Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
09dcd5b1
Commit
09dcd5b1
authored
5 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
unused test function removed
parent
9a91f723
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!782
Resolve "Replace deprecated APIs"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
persist/src/main/java/lcsb/mapviewer/persist/DbUtils.java
+0
-29
0 additions, 29 deletions
persist/src/main/java/lcsb/mapviewer/persist/DbUtils.java
persist/src/test/java/lcsb/mapviewer/persist/dao/user/UserDaoTest.java
+7
-14
7 additions, 14 deletions
...est/java/lcsb/mapviewer/persist/dao/user/UserDaoTest.java
with
7 additions
and
43 deletions
persist/src/main/java/lcsb/mapviewer/persist/DbUtils.java
+
0
−
29
View file @
09dcd5b1
...
...
@@ -71,35 +71,6 @@ public class DbUtils extends Observable {
this
.
sessionFactory
=
sessionFactory
;
}
/**
* Executes sql query given in the parameter.
*
* @param query
* sql query to be executed
* @return The number of entities updated or deleted.
*/
public
int
executeSqlQuery
(
String
query
)
{
return
executeSqlQuery
(
query
,
new
HashMap
<
String
,
Object
>());
}
/**
* Executes sql query given in the parameter.
*
* @param query
* sql query to be executed
* @param params
* map of parameters used in the query
* @return The number of entities updated or deleted.
*/
public
int
executeSqlQuery
(
String
query
,
Map
<
String
,
Object
>
params
)
{
SQLQuery
sqlQuery
=
getSessionFactory
().
getCurrentSession
().
createSQLQuery
(
query
);
for
(
Entry
<
String
,
Object
>
entry
:
params
.
entrySet
())
{
sqlQuery
.
setParameter
(
entry
.
getKey
(),
entry
.
getValue
());
}
return
sqlQuery
.
executeUpdate
();
}
/**
* Returns hibernate session for current thread.
*
...
...
This diff is collapsed.
Click to expand it.
persist/src/test/java/lcsb/mapviewer/persist/dao/user/UserDaoTest.java
+
7
−
14
View file @
09dcd5b1
...
...
@@ -6,10 +6,9 @@ import static org.junit.Assert.assertNull;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.logging.log4j.*
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -38,19 +37,13 @@ public class UserDaoTest extends PersistTestFunctions {
protected
PasswordEncoder
passwordEncoder
;
protected
Logger
logger
=
LogManager
.
getLogger
(
UserDaoTest
.
class
.
getName
());
String
testLogin
=
"test_login123"
;
String
testEmail
=
"a@a.pl"
;
String
testPasswd
=
"pwd"
;
String
testLogin2
=
"test_login_tmp"
;
String
testName
=
"John"
;
String
testSurname
=
"Doe"
;
private
String
testLogin
=
"test_login123"
;
private
String
testEmail
=
"a@a.pl"
;
private
String
testPasswd
=
"pwd"
;
private
String
testLogin2
=
"test_login_tmp"
;
@Before
public
void
setUp
()
throws
Exception
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"login_param"
,
testLogin
);
params
.
put
(
"login_param2"
,
testLogin2
);
dbUtils
.
executeSqlQuery
(
"delete from user_table where login = :login_param or login = :login_param2"
,
params
);
}
@After
...
...
@@ -275,7 +268,7 @@ public class UserDaoTest extends PersistTestFunctions {
UserAnnotationSchema
uas
=
new
UserAnnotationSchema
();
user
.
setAnnotationSchema
(
uas
);
UserClassAnnotators
classAnnotators
=
new
UserClassAnnotators
(
Integer
.
class
);
AnnotatorData
annotatorData
=
new
AnnotatorData
(
String
.
class
);
AnnotatorData
annotatorData
=
new
AnnotatorData
(
String
.
class
);
classAnnotators
.
addAnnotator
(
annotatorData
);
uas
.
addClassAnnotator
(
classAnnotators
);
AnnotatorConfigParameter
param
=
new
AnnotatorConfigParameter
(
AnnotatorParamDefinition
.
KEGG_ORGANISM_IDENTIFIER
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment