Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Orekit
Rugged
Commits
88468bc1
Commit
88468bc1
authored
10 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Improved test by displaying source folder for aster resources files.
parent
7de59d18
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
aster/src/test/java/org/orekit/rugged/aster/AsterTileUpdaterTest.java
+39
-1
39 additions, 1 deletion
...st/java/org/orekit/rugged/aster/AsterTileUpdaterTest.java
with
39 additions
and
1 deletion
aster/src/test/java/org/orekit/rugged/aster/AsterTileUpdaterTest.java
+
39
−
1
View file @
88468bc1
...
@@ -78,7 +78,45 @@ public class AsterTileUpdaterTest {
...
@@ -78,7 +78,45 @@ public class AsterTileUpdaterTest {
try
{
try
{
String
warningResource
=
"org/orekit/rugged/geotiff/ASTER-files-warning.txt"
;
String
warningResource
=
"org/orekit/rugged/geotiff/ASTER-files-warning.txt"
;
URL
url
=
AsterTileUpdaterTest
.
class
.
getClassLoader
().
getResource
(
warningResource
);
URL
url
=
AsterTileUpdaterTest
.
class
.
getClassLoader
().
getResource
(
warningResource
);
warningFile
=
new
File
(
url
.
toURI
().
getPath
());
File
compiledWarningFile
=
new
File
(
url
.
toURI
().
getPath
());
// the resource found above is in the "compiled" area of the build system,
// however, we want to notify users they may put ASTER files in the "source" area
// so we need to roll back the folders and find the sources.
// under eclipse, the compiled area is typically in a "bin" folder below project
// under maven, the compiled area of a multi-module component is in [component-name]/target/test-classes
// so we need to perform the following transform on the compiled path:
// replace /some/deep/path/to/project/[**]/org/orekit/rugged/geotiff/ASTER-files-warning.txt
// with /some/deep/path/to/project/[aster/src/test/resources]/org/orekit/rugged/geotiff/ASTER-files-warning.txt
File
walking
=
compiledWarningFile
;
List
<
String
>
subs
=
new
ArrayList
<
String
>();
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
subs
.
add
(
0
,
walking
.
getName
());
walking
=
walking
.
getParentFile
();
}
subs
.
set
(
0
,
"resources"
);
subs
.
add
(
0
,
"test"
);
subs
.
add
(
0
,
"src"
);
subs
.
add
(
0
,
"aster"
);
while
(
walking
.
exists
())
{
File
sourceWarningFile
=
walking
;
for
(
String
sub
:
subs
)
{
if
(
sourceWarningFile
.
exists
())
{
sourceWarningFile
=
new
File
(
sourceWarningFile
,
sub
);
}
}
if
(
sourceWarningFile
.
exists
())
{
warningFile
=
sourceWarningFile
;
return
;
}
else
{
walking
=
walking
.
getParentFile
();
}
}
// we didn't find the source file, use the "compiled" one
warningFile
=
compiledWarningFile
;
}
catch
(
URISyntaxException
urise
)
{
}
catch
(
URISyntaxException
urise
)
{
Assert
.
fail
(
urise
.
getLocalizedMessage
());
Assert
.
fail
(
urise
.
getLocalizedMessage
());
}
}
...
...
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