Skip to content

Commit

Permalink
Merge branch 'master' into 731-proxy-bean
Browse files Browse the repository at this point in the history
Conflicts:
	hummingbird-server/src/main/java/com/vaadin/hummingbird/template/model/TemplateModel.java
	hummingbird-server/src/main/java/com/vaadin/hummingbird/template/model/TemplateModelBeanUtil.java
	hummingbird-server/src/main/java/com/vaadin/hummingbird/template/model/TemplateModelProxyHandler.java
	hummingbird-server/src/test/java/com/vaadin/hummingbird/template/model/TemplateModelTest.java
  • Loading branch information
Denis Anisimov committed Jun 3, 2016
2 parents c1cdb43 + b250a8a commit e1fef00
Show file tree
Hide file tree
Showing 25 changed files with 841 additions and 217 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -22,3 +22,7 @@
scripts/*.pyc

phantomjsdriver.log

bower_components
node
node_modules
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -14,6 +14,9 @@ branches:
cache:
directories:
- $HOME/.m2
- hummingbird-tests/test-root-context/frontend/node
- hummingbird-tests/test-root-context/frontend/node_modules
- hummingbird-tests/test-root-context/frontend/bower_components
before_cache:
# remove all build artifacts
- rm -rf $HOME/.m2/repository/com/vaadin/hummingbird
Expand Down
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -27,6 +27,11 @@ Import the Project into the Workspace
1. Select the *hummingbird* folder (where you cloned the project)
1. Ensure all projects are checked
1. Click “finish” to complete the import
1. Disable HTML and XML validation in the workspace to avoid validating Bower dependencies
1. Eclipse preferences -> *Validation*
1. Uncheck *Build* for *HTML Syntax Validator*
1. Uncheck *Build* for *XML Validator*


Note that the first compilation takes a while to finish as Maven downloads dependencies used in the projects.

Expand Down
1 change: 1 addition & 0 deletions hummingbird-client/pom.xml
Expand Up @@ -145,6 +145,7 @@
<webMode>true</webMode>
<style>${gwt.module.style}</style>
<htmlunit>FF38</htmlunit>
<testTimeOut>300</testTimeOut>
</configuration>
</plugin>

Expand Down
Expand Up @@ -437,6 +437,93 @@ public void testUnregisterOverrideNode() {
assertEquals("override", element.getId());
}

public void testBindOverrideNode_properties_beforeBind() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
int id = 83;

StateNode overrideNode = createSimpleOverrideNode(id);
NodeMap props = overrideNode.getMap(NodeFeatures.ELEMENT_PROPERTIES);
props.getProperty("foo").setValue("bar");

Element element = createElement(templateNode, id);

Reactive.flush();

assertEquals("bar", WidgetUtil.getJsProperty(element, "foo"));
}

public void testBindOverrideNode_properties_afterBind() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
int id = 68;

StateNode overrideNode = createSimpleOverrideNode(id);

Element element = createElement(templateNode, id);

NodeMap props = overrideNode.getMap(NodeFeatures.ELEMENT_PROPERTIES);
props.getProperty("foo").setValue("bar");

Reactive.flush();

assertEquals("bar", WidgetUtil.getJsProperty(element, "foo"));
}

public void testBindOverrideNode_attributes_beforeBind() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
int id = 48;

StateNode overrideNode = createSimpleOverrideNode(id);
NodeMap attrs = overrideNode.getMap(NodeFeatures.ELEMENT_ATTRIBUTES);
attrs.getProperty("foo").setValue("bar");

Element element = createElement(templateNode, id);

Reactive.flush();

assertEquals("bar", element.getAttribute("foo"));
}

public void testBindOverrideNode_attributes_afterBind() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
int id = 45;

StateNode overrideNode = createSimpleOverrideNode(id);

Element element = createElement(templateNode, id);

NodeMap props = overrideNode.getMap(NodeFeatures.ELEMENT_ATTRIBUTES);
props.getProperty("foo").setValue("bar");

Reactive.flush();

assertEquals("bar", element.getAttribute("foo"));
}

public void testTemplateAttributes_bindOverrideNodeAttribute() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
templateNode.addAttribute("attr1", "value1");
templateNode.addAttribute("attr2", "value2");

int id = 37;

StateNode overrideNode = createSimpleOverrideNode(id);

Element element = createElement(templateNode, id);

NodeMap props = overrideNode.getMap(NodeFeatures.ELEMENT_ATTRIBUTES);
props.getProperty("attr2").setValue("foo");

Reactive.flush();

assertEquals("value1", element.getAttribute("attr1"));
assertEquals("foo", element.getAttribute("attr2"));
}

public void testChildSlot() {
TestElementTemplateNode templateNode = TestElementTemplateNode
.create("div");
Expand Down

0 comments on commit e1fef00

Please sign in to comment.