Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jto
committed
Aug 23, 2012
1 parent
c12e6c5
commit 0cce691
Showing
4 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
helpers/src/main/java/com/linkedin/plugin/WithTestServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2012 LinkedIn | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.linkedin.plugin; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
import java.lang.annotation.Target; | ||
import java.lang.annotation.ElementType; | ||
|
||
import play.test.FakeApplication; | ||
|
||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface WithTestServer { | ||
WithFakeApplication fakeApplication() default @WithFakeApplication; | ||
int port() default 3333; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import org.testng.annotations.*; | ||
|
||
import play.mvc.*; | ||
import play.test.*; | ||
import play.libs.F.*; | ||
|
||
import static play.test.Helpers.*; | ||
import static org.fest.assertions.Assertions.*; | ||
|
||
import static org.fluentlenium.core.filter.FilterConstructor.*; | ||
|
||
import com.linkedin.plugin.*; | ||
|
||
@WithTestServer | ||
public class IntegrationTest extends NGTests { | ||
@Test | ||
@WithTestServer | ||
public void test() { | ||
browser().goTo("http://localhost:3333"); | ||
assertThat(browser().pageSource()).contains("Helloworld"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ tests: | |
classes: | ||
- SimpleTest | ||
- AllWithFakeApp | ||
- IntegrationTest |