Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
PP-01-Threads-Review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mohamadbashar.disoki
PP-01-Threads-Review
Commits
721929cf
Commit
721929cf
authored
Oct 18, 2023
by
Mohamad Bashar Desoki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Save Student Service
parent
426d96c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
16 deletions
+97
-16
.gitignore
.gitignore
+1
-1
workspace.xml
.idea/workspace.xml
+53
-15
Student.java
src/main/java/Student.java
+15
-0
StudentService.java
src/main/java/StudentService.java
+13
-0
StudentServiceTest.java
src/test/java/StudentServiceTest.java
+15
-0
No files found.
.gitignore
View file @
721929cf
...
@@ -11,7 +11,7 @@ target/
...
@@ -11,7 +11,7 @@ target/
*.iws
*.iws
*.iml
*.iml
*.ipr
*.ipr
.idea/
*.xml
.idea/
### Eclipse ###
### Eclipse ###
.apt_generated
.apt_generated
...
...
.idea/workspace.xml
View file @
721929cf
...
@@ -4,41 +4,79 @@
...
@@ -4,41 +4,79 @@
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"
6c1c1ef0-2a41-4015-9b74-a0b70a17938b
"
name=
"Changes"
comment=
""
>
<list
default=
"true"
id=
"
58d4b7b2-63a8-4164-95ff-e494b5fc28c6
"
name=
"Changes"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/
.gitignore
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/
src/main/java/Student.java
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/
.idea/misc.xml
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/
src/main/java/StudentService.java
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/
.idea/vcs.xml
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/
src/test/java/StudentServiceTest.java
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.gitignore
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/pom
.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace
.xml"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
</component>
<component
name=
"FileTemplateManagerImpl"
>
<option
name=
"RECENT_TEMPLATES"
>
<list>
<option
value=
"Class"
/>
</list>
</option>
</component>
<component
name=
"Git.Settings"
>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
</component>
<component
name=
"ProjectId"
id=
"2WtojctnFodHRVo1eRr4RdUUYTx"
/>
<component
name=
"MarkdownSettingsMigration"
>
<option
name=
"stateVersion"
value=
"1"
/>
</component>
<component
name=
"ProjectId"
id=
"2WtzzJA6EkVb6eqVoUQpRGaY50v"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectViewState"
>
<component
name=
"ProjectViewState"
>
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
</component>
</component>
<component
name=
"PropertiesComponent"
>
<![CDATA[{
<component
name=
"PropertiesComponent"
>
{
"keyToString": {
"
keyToString
"
: {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"
RunOnceActivity.OpenProjectViewOnStart
"
:
"
true
"
,
"RunOnceActivity.ShowReadmeOnStart": "true"
"
RunOnceActivity.ShowReadmeOnStart
"
:
"
true
"
,
"
last_opened_file_path
"
:
"
D:/HIAST Library/Teaching/PP/2024/lec1/Lec1-Threads
"
}
}
}]]>
</component>
}
</component>
<component
name=
"RunManager"
selected=
"JUnit.StudentServiceTest.testStudentService"
>
<configuration
name=
"StudentServiceTest"
type=
"JUnit"
factoryName=
"JUnit"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"Lec1-Threads"
/>
<option
name=
"PACKAGE_NAME"
value=
""
/>
<option
name=
"MAIN_CLASS_NAME"
value=
"StudentServiceTest"
/>
<option
name=
"TEST_OBJECT"
value=
"class"
/>
<method
v=
"2"
>
<option
name=
"Make"
enabled=
"true"
/>
</method>
</configuration>
<configuration
name=
"StudentServiceTest.testStudentService"
type=
"JUnit"
factoryName=
"JUnit"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"Lec1-Threads"
/>
<option
name=
"PACKAGE_NAME"
value=
""
/>
<option
name=
"MAIN_CLASS_NAME"
value=
"StudentServiceTest"
/>
<option
name=
"METHOD_NAME"
value=
"testStudentService"
/>
<option
name=
"TEST_OBJECT"
value=
"method"
/>
<method
v=
"2"
>
<option
name=
"Make"
enabled=
"true"
/>
</method>
</configuration>
<recent_temporary>
<list>
<item
itemvalue=
"JUnit.StudentServiceTest.testStudentService"
/>
<item
itemvalue=
"JUnit.StudentServiceTest"
/>
</list>
</recent_temporary>
</component>
<component
name=
"SpellCheckerSettings"
RuntimeDictionaries=
"0"
Folders=
"0"
CustomDictionaries=
"0"
DefaultDictionary=
"application-level"
UseSingleDictionary=
"true"
transferred=
"true"
/>
<component
name=
"SpellCheckerSettings"
RuntimeDictionaries=
"0"
Folders=
"0"
CustomDictionaries=
"0"
DefaultDictionary=
"application-level"
UseSingleDictionary=
"true"
transferred=
"true"
/>
<component
name=
"TaskManager"
>
<component
name=
"TaskManager"
>
<task
active=
"true"
id=
"Default"
summary=
"Default task"
>
<task
active=
"true"
id=
"Default"
summary=
"Default task"
>
<changelist
id=
"
6c1c1ef0-2a41-4015-9b74-a0b70a17938b
"
name=
"Changes"
comment=
""
/>
<changelist
id=
"
58d4b7b2-63a8-4164-95ff-e494b5fc28c6
"
name=
"Changes"
comment=
""
/>
<created>
1697
5613760
46
</created>
<created>
1697
6103418
46
</created>
<option
name=
"number"
value=
"Default"
/>
<option
name=
"number"
value=
"Default"
/>
<option
name=
"presentableId"
value=
"Default"
/>
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1697
5613760
46
</updated>
<updated>
1697
6103418
46
</updated>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
src/main/java/Student.java
0 → 100644
View file @
721929cf
public
class
Student
{
private
String
name
;
public
Student
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
src/main/java/StudentService.java
0 → 100644
View file @
721929cf
import
java.util.UUID
;
public
class
StudentService
{
public
String
SaveStudent
(
Student
student
){
System
.
out
.
println
(
"Save new Student: "
+
student
.
getName
());
try
{
Thread
.
sleep
(
2000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
UUID
.
randomUUID
().
toString
();
}
}
src/test/java/StudentServiceTest.java
0 → 100644
View file @
721929cf
import
junit.framework.TestCase
;
public
class
StudentServiceTest
extends
TestCase
{
public
void
testStudentService
()
{
long
StartTime
=
System
.
currentTimeMillis
();
Student
student
=
new
Student
(
"Mhd"
);
StudentService
svc
=
new
StudentService
();
svc
.
SaveStudent
(
student
);
long
end
=
System
.
currentTimeMillis
()-
StartTime
;
System
.
out
.
println
(
"Time Taken: "
+
end
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment