Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
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
沈俊林
java-gitlab-api
Commits
e6a337f8
Commit
e6a337f8
authored
Oct 23, 2014
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29 from mfriedenhagen/integration-tests
Make integrative test run as during phase verify.
parents
6fbc5478
593c89df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
5 deletions
+43
-5
pom.xml
pom.xml
+26
-1
GitlabAPIT.java
src/test/java/org/gitlab/api/GitlabAPIT.java
+17
-4
No files found.
pom.xml
View file @
e6a337f8
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<parent>
<parent>
<groupId>
org.sonatype.oss
</groupId>
<groupId>
org.sonatype.oss
</groupId>
<artifactId>
oss-parent
</artifactId>
<artifactId>
oss-parent
</artifactId>
<version>
7
</version>
<version>
9
</version>
</parent>
</parent>
<developers>
<developers>
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -104,6 +105,30 @@
...
@@ -104,6 +105,30 @@
<target>
1.6
</target>
<target>
1.6
</target>
</configuration>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.17
</version>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-failsafe-plugin
</artifactId>
<version>
2.17
</version>
<executions>
<execution>
<id>
default-integration-test
</id>
<goals>
<goal>
integration-test
</goal>
</goals>
</execution>
<execution>
<id>
default-verify
</id>
<goals>
<goal>
verify
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
src/test/java/org/gitlab/api/GitlabAPIT
est
.java
→
src/test/java/org/gitlab/api/GitlabAPIT.java
View file @
e6a337f8
...
@@ -11,21 +11,34 @@ import java.net.URL;
...
@@ -11,21 +11,34 @@ import java.net.URL;
import
java.util.UUID
;
import
java.util.UUID
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assume
.
assumeNoException
;
public
class
GitlabAPITest
{
import
java.net.ConnectException
;
public
class
GitlabAPIT
{
GitlabAPI
_api
;
GitlabAPI
_api
;
private
static
final
String
TEST_URL
=
"http://localhost"
;
private
static
final
String
TEST_URL
=
System
.
getProperty
(
"TEST_URL"
,
"http://localhost"
)
;
private
static
final
String
TEST_TOKEN
=
"y0E5b9761b7y4qk"
;
private
static
final
String
TEST_TOKEN
=
System
.
getProperty
(
"TEST_TOKEN"
,
"y0E5b9761b7y4qk"
)
;
String
rand
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
substring
(
0
,
8
);
String
rand
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
substring
(
0
,
8
);
@Before
@Before
public
void
setup
()
{
public
void
setup
()
throws
IOException
{
_api
=
GitlabAPI
.
connect
(
TEST_URL
,
TEST_TOKEN
);
_api
=
GitlabAPI
.
connect
(
TEST_URL
,
TEST_TOKEN
);
try
{
_api
.
dispatch
().
with
(
"login"
,
"INVALID"
).
with
(
"password"
,
rand
).
to
(
"session"
,
GitlabUser
.
class
);
}
catch
(
ConnectException
e
)
{
assumeNoException
(
"GITLAB not running on '"
+
TEST_URL
+
"', skipping..."
,
e
);
}
catch
(
IOException
e
)
{
final
String
message
=
e
.
getMessage
();
if
(!
message
.
equals
(
"{\"message\":\"401 Unauthorized\"}"
))
{
throw
new
AssertionError
(
"Expected an unauthorized message"
,
e
);
}
}
}
}
@Test
@Test
...
...
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