Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
Institut für Informatik
dbis
dbis-isochrone
isochrone
Commits
1bf5cd27
Commit
1bf5cd27
authored
10 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
added test for reachable bus stations (fixes todo in isochrone class)
parent
9178a571
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/it/unibz/inf/isochrone/network/ReachabilityTest.java
+63
-0
63 additions, 0 deletions
...java/it/unibz/inf/isochrone/network/ReachabilityTest.java
with
63 additions
and
0 deletions
src/test/java/it/unibz/inf/isochrone/network/ReachabilityTest.java
0 → 100644
+
63
−
0
View file @
1bf5cd27
package
it.unibz.inf.isochrone.network
;
import
it.unibz.inf.isochrone.algorithm.MineX
;
import
it.unibz.inf.isochrone.config.ConfigDataset
;
import
it.unibz.inf.isochrone.network.AlgorithmHelper.AlgorithmResult
;
import
it.unibz.inf.isochrone.util.EnumContainer.Direction
;
import
it.unibz.inf.isochrone.util.EnumContainer.Mode
;
import
java.util.Calendar
;
import
java.util.Collection
;
import
java.util.GregorianCalendar
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
/**
* This checks if some well known isochrones are calculated the right way. Note
* that there is the possibility that one of the test fails due to changes in
* the network. So one should check for such changes (e.g. by visual isochrone
* comparison using a GUI), before fixing a broken test.
*/
public
class
ReachabilityTest
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ReachabilityTest
.
class
);
// local test parameters
private
static
final
String
DATASET
=
"bz"
;
private
static
final
Double
WALKING_SPEED
=
1.0
;
private
static
final
int
DURATION
=
900
;
private
static
final
Calendar
TIME
=
new
GregorianCalendar
(
2011
,
9
,
14
,
9
,
0
,
0
);
private
static
final
int
STARTNODE_ID
=
2000499
;
// FUB; Dominikanerplatz (also NodeID 2000500)
private
static
final
Mode
MODE
=
Mode
.
MULTIMODAL
;
private
static
final
Direction
DIRECTION
=
Direction
.
INCOMING
;
private
static
final
TestParameters
PARAM_LOCAL
=
new
TestParameters
(
WALKING_SPEED
,
DURATION
,
TIME
,
MODE
,
STARTNODE_ID
,
DATASET
,
DIRECTION
);
@BeforeClass
public
void
setup
()
{
LOGGER
.
info
(
"Starting test(s) in class \""
+
ReachabilityTest
.
class
.
getSimpleName
()
+
"\""
);
// loads dataset configurations (we do this before testing, so timings are correct)
ConfigDataset
.
getInstance
(
PARAM_LOCAL
.
getDataset
());
}
@Test
public
void
testBzBusStation15
()
{
final
int
nodeIdToCheck
=
5117
;
// bus station id = 5117; Defregger Str./Fagenstraße (reachable by bus route 1)
LOGGER
.
info
(
"Checking nodes from FUB (15min isncoming isochrone)"
);
final
AlgorithmResult
result
=
AlgorithmHelper
.
run
(
MineX
.
class
,
PARAM_LOCAL
,
true
);
final
Collection
<
Node
>
resultNodes
=
result
.
getOutput
().
getNodes
();
boolean
foundNode
=
false
;
for
(
final
Node
node
:
resultNodes
)
{
if
(
node
.
getId
()
==
nodeIdToCheck
)
{
foundNode
=
true
;
break
;
}
}
Assert
.
assertTrue
(
foundNode
,
"Expected node not found in 15min incoming isochrone to FUB"
);
}
}
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