Skip to content

Commit

Permalink
* [#1067] test(tag): add demo and test for used of #{set} and #{get}
Browse files Browse the repository at this point in the history
  • Loading branch information
xael-fry committed Dec 29, 2016
1 parent 98dfd40 commit 4cb487a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
13 changes: 12 additions & 1 deletion framework/src/play/deps/DependenciesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
public class DependenciesManager {

public static void main(String[] args) throws Exception {

System.setProperty("application.path", "E:\\devel\\payment-gateway-ng\\backoffice-ng");
System.setProperty("framework.path", "E:\\Framework\\play-x.x.x");
System.setProperty("play.version", "localhost");
System.setProperty("debug", "true");

String applicationPath = System.getProperty("application.path");
if (applicationPath == null) {
System.out.println("~ ERROR: cannot resolve \"application.path\"");
Expand All @@ -49,6 +55,11 @@ public static void main(String[] args) throws Exception {
return;
}

System.out.println(applicationPath);
System.out.println(frameworkPath);
System.out.println(userHomePath);
System.out.println(playVersion);

// Paths
File application = new File(applicationPath);
File framework = new File(frameworkPath);
Expand Down Expand Up @@ -406,7 +417,7 @@ public Ivy configure() throws Exception {
IvySettings ivySettings = new IvySettings();
new SettingsParser(this.logger).parse(ivySettings, new File(framework, "framework/dependencies.yml"));
new SettingsParser(this.logger).parse(ivySettings, new File(application, "conf/dependencies.yml"));
ivySettings.setDefaultResolver("mavenCentral");
ivySettings.setDefaultResolver("mavenCentral");
ivySettings.setDefaultUseOrigin(true);
PlayConflictManager conflictManager = new PlayConflictManager();
ivySettings.addConflictManager("playConflicts", conflictManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ public static void yesNo() {
public static void i18n() {
render();
}

public static void set() {
render();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
We have declared #{set transactionsData:@Application.hello()/}
#{set transactionsData:@Application.hello()/}
<ul>
<li>Get var with &#35{get 'transactionsData' /}: #{get 'transactionsData' /}</li>
<li>Get var with &#36;{transactionsData}: ${transactionsData?.url}</li>
</ul>

We can use it in form:
#{form transactionsData, method:'POST', id:'creationForm' }
<input name="test">
<input type="submit">
#{/form}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#{selenium 'set'}
open('@{tagDemos.TagDemos.set()}')
// Test with #get tag
assertTextPresent('Get var with &#35{get 'transactionsData' /}: /sayHello')
// Test with Expressions accessor
assertTextPresent('Get var with &#36{transactionsData}: /sayHello')
// Test in form tag param
assertHtmlSource('*<form action="/sayHello" method="post" accept-charset="utf-8" id="creationForm">*')
#{/selenium}

0 comments on commit 4cb487a

Please sign in to comment.