File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33##1 .8.33**
44* support plugin test engine
5+ * Choose port randomly when running automation test in batch mode #1317
56* wrong file object inject from form field into the controller param #1316
67* API doc - URL path variable in POST endpoint info is incorrect #1284
78* ` SampleData.ProvidedBy ` is not effective on int type field #1310
Original file line number Diff line number Diff line change 7272
7373import java .awt .*;
7474import java .io .File ;
75+ import java .io .IOException ;
7576import java .lang .reflect .Field ;
7677import java .lang .reflect .Method ;
7778import java .lang .reflect .Modifier ;
79+ import java .net .ServerSocket ;
7880import java .nio .charset .StandardCharsets ;
7981import java .text .DateFormat ;
8082import java .text .SimpleDateFormat ;
@@ -1877,7 +1879,11 @@ protected T httpPort(int port) {
18771879
18781880 public int httpPort () {
18791881 if (-1 == httpPort ) {
1880- httpPort = get (HTTP_PORT , 5460 );
1882+ if ("test" .equalsIgnoreCase (Act .profile ())) {
1883+ httpPort = randomPort ();
1884+ } else {
1885+ httpPort = get (HTTP_PORT , 5460 );
1886+ }
18811887 }
18821888 return httpPort ;
18831889 }
@@ -1888,6 +1894,18 @@ private void _mergeHttpPort(AppConfig conf) {
18881894 }
18891895 }
18901896
1897+ private static int randomPort () {
1898+ ServerSocket ss = null ;
1899+ try {
1900+ ss = new ServerSocket (0 );
1901+ return ss .getLocalPort ();
1902+ } catch (IOException e ) {
1903+ throw E .ioException (e );
1904+ } finally {
1905+ IO .close (ss );
1906+ }
1907+ }
1908+
18911909 private Boolean httpSecure = null ;
18921910
18931911 protected T httpSecure (boolean secure ) {
Original file line number Diff line number Diff line change 1+ * .iml
2+ target
3+ .idea
4+ classes
5+ * .log
6+ * .DS_Store
7+ * all.sql
8+ tmp /
9+ ** /.act *
10+ ** /.classpath
11+ ** /.settings
12+ ** /.project
13+ ** /.settings /
14+ store1 /
15+ test.mv.db
16+ test.trace.db
17+ act.pid
18+ .workspace
19+ * .geany
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xmlns =" http://maven.apache.org/POM/4.0.0"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
5+ <modelVersion >4.0.0</modelVersion >
6+
7+ <artifactId >gh1315-test</artifactId >
8+ <version >1.8.8.8-SNAPSHOT</version >
9+
10+ <name >ActFramework Test App for Github Issue 863</name >
11+
12+ <parent >
13+ <groupId >org.actframework</groupId >
14+ <artifactId >act-starter-parent</artifactId >
15+ <version >1.8.32.0</version >
16+ </parent >
17+
18+ <properties >
19+ <!-- remove the following line if you are on Java 7-->
20+ <java .version>1.8</java .version>
21+ <app .entry>test.AppEntry</app .entry>
22+ </properties >
23+
24+ <dependencies >
25+ <!-- add your dependencies here -->
26+ <dependency >
27+ <groupId >org.actframework</groupId >
28+ <artifactId >act</artifactId >
29+ <version >1.8.33-SNAPSHOT</version >
30+ </dependency >
31+ <dependency >
32+ <groupId >org.actframework</groupId >
33+ <artifactId >act-beetl</artifactId >
34+ </dependency >
35+ </dependencies >
36+
37+ </project >
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ echo building ...
3+ mvn -q compile act:run
Original file line number Diff line number Diff line change 1+ echo building ...
2+ mvn -q compile act:run
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ echo building ...
3+ mvn -q compile act:e2e
Original file line number Diff line number Diff line change 1+ echo building ...
2+ mvn -q compile act:e2e
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ if [ ! -f target/dist/start ]; then
3+ echo building ...
4+ mvn -q clean package
5+ cd target/dist
6+ tar xzf * .tar.gz
7+ else
8+ cd target/dist
9+ fi
10+ ./run $*
Original file line number Diff line number Diff line change 1+ package test ;
2+
3+ import act .Act ;
4+ import act .controller .Controller ;
5+ import act .util .JsonView ;
6+ import org .osgl .mvc .annotation .GetAction ;
7+
8+ @ SuppressWarnings ("unused" )
9+ @ JsonView
10+ public class AppEntry extends Controller .Util {
11+
12+ @ GetAction
13+ public void test () {
14+ renderTemplate ("/test.html" );
15+ }
16+
17+
18+ public static void main (String [] args ) throws Exception {
19+ Act .start ();
20+ }
21+
22+ }
You can’t perform that action at this time.
0 commit comments