Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository 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
Christopher Schankula
2XB3FinalProject
Commits
92beb168
Commit
92beb168
authored
7 years ago
by
Ar1sD
Browse files
Options
Downloads
Patches
Plain Diff
Working JUnits
parent
39019979
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/TestBasicSearchResult.java
+1
-44
1 addition, 44 deletions
src/test/TestBasicSearchResult.java
src/test/TestCluster.java
+7
-4
7 additions, 4 deletions
src/test/TestCluster.java
with
8 additions
and
48 deletions
src/test/TestBasicSearchResult.java
+
1
−
44
View file @
92beb168
...
...
@@ -51,47 +51,4 @@ public class TestBasicSearchResult {
BasicSearchResult
bsr
=
BasicSearch
.
range
(
448306
,
1990
,
2008
);
// Anura
assert
(
bsr
.
sum
()
==
9
);
}
}
//public class TestBasicSearchResult {
// public static TrawlExpert te;
//
// @Before
// public void setUp() throws Exception {
// // Assumes serialized data is present
// te = new TrawlExpert();
// FileProcessor.setPath("smalldata.csv");
// FileProcessor.initProcessing();
// }
//
// @Test
// public void testTaxonId() {
// BasicSearchResult bsr = te.rangeSearch(154210, 1990, 2000); // Esox lucius
// assert(bsr.taxonId() == 154210);
// }
//
// @Test
// public void testYearLo() {
// BasicSearchResult bsr = te.rangeSearch(154210, 1990, 2000); // Esox lucius
// assert(bsr.yearLo() == 1990);
// }
//
// @Test
// public void testYearHi() {
// BasicSearchResult bsr = te.rangeSearch(154210, 1990, 2000); // Esox lucius
// assert(bsr.yearHi() == 2000);
// }
//
// @Test
// public void testSize() {
// BasicSearchResult bsr = te.rangeSearch(154210, 1990, 2000); // Esox lucius
// assert(bsr.n() == 4);
// }
//
// @Test
// public void testSum() {
// BasicSearchResult bsr = te.rangeSearch(448306, 1990, 2008); // Anura
// assert(bsr.sum() == 9);
// }
//}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/TestCluster.java
+
7
−
4
View file @
92beb168
...
...
@@ -33,7 +33,7 @@ public class TestCluster {
@Test
public
void
testCluster1
()
{
bsr
=
BasicSearch
.
range
(
154210
,
1990
,
2008
);
// Esox lucius
clus
=
Cluster
.
cluster
(
1
.0
,
bsr
);
clus
=
Cluster
.
cluster
(
0
.0
,
bsr
);
assert
(
clus
.
size
()
==
bsr
.
n
());
}
...
...
@@ -51,7 +51,7 @@ public class TestCluster {
public
void
testCluster3
()
{
bsr
=
BasicSearch
.
range
(
448306
,
1990
,
2008
);
// Anura
clus
=
Cluster
.
cluster
(
30.0
,
bsr
);
System
.
out
.
println
(
clus
.
get
(
2
).
N
());
System
.
out
.
println
(
clus
.
get
(
0
).
N
());
assert
(
clus
.
get
(
0
).
N
()
==
3
);
}
...
...
@@ -59,8 +59,11 @@ public class TestCluster {
@Test
public
void
testCluster4
()
{
bsr
=
BasicSearch
.
range
(
154210
,
1990
,
2008
);
// Esox lucius
clus
=
Cluster
.
cluster
(
300.0
,
bsr
);
clus
=
Cluster
.
cluster
(
9000.0
,
bsr
);
String
format
=
"|%1$-15s|%2$-15s|%3$-15s|%4$-15s|%5$-15s\n"
;
for
(
int
i
=
0
;
i
<
clus
.
size
();
i
++)
System
.
out
.
format
(
format
,
(
i
+
1
),
String
.
format
(
"%.5f"
,
clus
.
get
(
i
).
centroid
().
getY
()),
String
.
format
(
"%.5f"
,
clus
.
get
(
i
).
centroid
().
getX
()),
clus
.
get
(
i
).
N
(),
clus
.
get
(
i
).
getCount
());
System
.
out
.
println
(
clus
.
get
(
0
).
N
());
assert
(
clus
.
get
(
0
).
N
()
==
4
);
assert
(
clus
.
get
(
0
).
N
()
==
2
);
}
}
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