Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
Parallel Programming Lab 3
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
julanar.ali
Parallel Programming Lab 3
Commits
63696f85
Commit
63696f85
authored
Nov 28, 2023
by
julanar.ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding testing
parent
9d46b2d2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
vcs.xml
.idea/vcs.xml
+6
-0
testThreadPool.java
src/test/java/ThreadPoolTests/testThreadPool.java
+29
-0
ThreadPool.class
target/classes/ThreadPool/ThreadPool.class
+0
-0
testThreadPool.class
target/test-classes/ThreadPoolTests/testThreadPool.class
+0
-0
No files found.
.idea/vcs.xml
0 → 100644
View file @
63696f85
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
src/test/java/ThreadPoolTests/testThreadPool.java
0 → 100644
View file @
63696f85
package
ThreadPoolTests
;
import
ThreadPool.ThreadPool
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
fail
;
public
class
testThreadPool
{
@Test
public
void
testThreadPool
()
{
ThreadPool
threadPool
=
new
ThreadPool
(
3
,
10
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
int
taskNo
=
i
;
try
{
threadPool
.
execute
(()
->
{
String
message
=
Thread
.
currentThread
().
getName
()
+
": Task "
+
taskNo
;
System
.
out
.
println
(
message
);
});
}
catch
(
Exception
e
)
{
fail
(
"Exception should not be thrown"
);
}
}
threadPool
.
waitUntilAllTasksFinished
(
5000
);
threadPool
.
stop
();
}
}
target/classes/ThreadPool/ThreadPool.class
View file @
63696f85
No preview for this file type
target/test-classes/ThreadPoolTests/testThreadPool.class
0 → 100644
View file @
63696f85
File added
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