Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Collector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Legacy
gitolite
user
iwakeh
Collector
Commits
ac00d7a0
Commit
ac00d7a0
authored
Jul 6, 2016
by
iwakeh
Browse files
Options
Downloads
Patches
Plain Diff
Implement #19373 and add one word to comment in build.xml.
parent
050a88ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.xml
+1
-1
1 addition, 1 deletion
build.xml
src/test/java/org/torproject/collector/MainTest.java
+23
-0
23 additions, 0 deletions
src/test/java/org/torproject/collector/MainTest.java
with
24 additions
and
1 deletion
build.xml
+
1
−
1
View file @
ac00d7a0
...
...
@@ -224,7 +224,7 @@
</target>
<target
name=
"test"
depends=
"compile,compile-tests"
>
<junit
fork=
"true"
haltonfailure=
"true"
printsummary=
"off"
>
<!-- The following jvmargs prevent test access to the network. -->
<!-- The following
two
jvmargs prevent test access to the network. -->
<jvmarg
value=
"-Djava.security.policy=${testresources}/junittest.policy"
/>
<jvmarg
value=
"-Djava.security.manager"
/>
<jvmarg
value=
"-DLOGBASE=${generated}/test-logs"
/>
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/torproject/collector/MainTest.java
+
23
−
0
View file @
ac00d7a0
...
...
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertEquals;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
fail
;
import
org.torproject.collector.conf.Key
;
import
org.torproject.collector.conf.ConfigurationException
;
...
...
@@ -23,6 +24,7 @@ import java.security.AccessControlException;
import
java.security.Policy
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Properties
;
import
java.util.Random
;
import
org.junit.rules.TemporaryFolder
;
...
...
@@ -69,4 +71,25 @@ public class MainTest {
bw
.
close
();
}
/* Verifies the contents of the default collector.properties file.
All properties specified have to be present but nothing else. */
@Test
()
public
void
testPropertiesFile
()
throws
Exception
{
Properties
props
=
new
Properties
();
props
.
load
(
getClass
().
getClassLoader
().
getResourceAsStream
(
Main
.
CONF_FILE
));
for
(
Key
key
:
Key
.
values
())
{
assertNotNull
(
"Property '"
+
key
.
name
()
+
"' not specified in "
+
Main
.
CONF_FILE
+
"."
,
props
.
getProperty
(
key
.
name
()));
}
for
(
String
propName
:
props
.
stringPropertyNames
())
{
try
{
Key
.
valueOf
(
propName
);
}
catch
(
IllegalArgumentException
ex
)
{
fail
(
"Invalid property name '"
+
propName
+
"' found in "
+
Main
.
CONF_FILE
+
"."
);
}
}
}
}
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
sign in
to comment