Skip to content

Commit

Permalink
Merge pull request #338 from sialcasa/release
Browse files Browse the repository at this point in the history
merge release into stable
  • Loading branch information
manuel-mauky committed Nov 24, 2015
2 parents f843f74 + df4897e commit f81d1c5
Show file tree
Hide file tree
Showing 45 changed files with 772 additions and 377 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
language: java

sudo: required
sudo: false

jdk:
- oraclejdk8

install: true

addons:
apt:
packages:
- oracle-java8-installer

before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update && sudo apt-get install oracle-java8-installer
- java -version

env:
Expand All @@ -19,4 +23,5 @@ env:
- secure: Bm0zIwBo4saIBlfr9YDvNqd8UN50FeT2hZyum3RFDmJqaXiUqwxw7sCz/lRjUwTfQrvGJXQ1I8le7zE4OVQdvpn4/LwwTJIjLY2jZNjzs4mZhkHzsM5IcGcL3lukR6soVYrGloQwmw63Okw2kZxces+1fveisPIKDlVaU1RTtMQ=

after_success:
- "[[ $TRAVIS_BRANCH == \"develop\" ]] && { python addServer.py; mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype' -am -DskipTests=true --settings ~/.m2/mySettings.xml; };"
- chmod ugo+x travis_snapshot_release.sh
- ./travis_snapshot_release.sh
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,33 @@ __MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler
### Maven dependency###

#### Stable Release

This is the stable release that can be used in production.

```xml
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.4.1</version>
</dependency>
```

#### Bugfix Development Snapshot

Here we make bug fixes for the current stable release.

```xml
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.4.0</version>
<version>1.4.2-SNAPSHOT</version>
</dependency>
```

#### Development Snapshot

Here we develop new features. This release is unstable and shouldn't be used in production.

```
<dependency>
<groupId>de.saxsys</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/books-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.saxsys.mvvmfx</groupId>
<artifactId>examples</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/contacts-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>de.saxsys.mvvmfx</groupId>
<artifactId>examples</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<artifactId>contacts-example</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/fx-root-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/helloworld-without-fxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/synchronizefx-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/mini-examples/welcome-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mini-examples</artifactId>
<groupId>de.saxsys.mvvmfx</groupId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<groupId>de.saxsys.mvvmfx</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/todomvc-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.saxsys.mvvmfx</groupId>
<artifactId>examples</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<artifactId>mvvmfx-cdi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion mvvmfx-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx-parent</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<artifactId>mvvmfx-guice</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package de.saxsys.mvvmfx.guice.interceptiontest;

import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;

public class InterceptedView implements FxmlView<InterceptedViewModel> {
public static boolean vmWasInjected = false;
public static boolean wasInitCalled = false;

@InjectViewModel
private InterceptedViewModel viewModel;

public void initialize() {
wasInitCalled = true;
vmWasInjected = viewModel != null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.saxsys.mvvmfx.guice.interceptiontest;

import de.saxsys.mvvmfx.ViewModel;

public class InterceptedViewModel implements ViewModel {



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.saxsys.mvvmfx.guice.interceptiontest;

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.matcher.Matchers;

public class InterceptorModule implements Module {
@Override
public void configure(Binder binder) {
binder.bindInterceptor(Matchers.subclassesOf(InterceptedView.class), Matchers.any(), new TestInterceptor());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package de.saxsys.mvvmfx.guice.interceptiontest;


import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test case to check AOP features (Interceptors) of Guice with mvvmFX.
*/
public class InterceptorTest {


@Test
// @Ignore("until fixed")
public void test() {

InterceptedView.vmWasInjected = false;
InterceptedView.wasInitCalled = false;
TestInterceptor.wasIntercepted = false;


InterceptorTestApp.main();

final InterceptedView codeBehind = InterceptorTestApp.viewTuple.getCodeBehind();


assertThat(TestInterceptor.wasIntercepted).isTrue();


assertThat(InterceptedView.wasInitCalled).isTrue();
assertThat(InterceptedView.vmWasInjected).isTrue();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package de.saxsys.mvvmfx.guice.interceptiontest;

import com.google.inject.Module;
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.ViewTuple;
import de.saxsys.mvvmfx.guice.MvvmfxGuiceApplication;
import javafx.application.Platform;
import javafx.stage.Stage;

import java.util.List;

public class InterceptorTestApp extends MvvmfxGuiceApplication {

public static ViewTuple<InterceptedView, InterceptedViewModel> viewTuple;


public static void main(String... args) {
launch(args);
}


@Override
public void startMvvmfx(Stage stage) throws Exception {

viewTuple = FluentViewLoader.fxmlView(InterceptedView.class).load();

// we can't shutdown the application in the test case so we need to do it here.
Platform.exit();
}


@Override
public void initGuiceModules(List<Module> modules) throws Exception {
modules.add(new InterceptorModule());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package de.saxsys.mvvmfx.guice.interceptiontest;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class TestInterceptor implements MethodInterceptor {
public static boolean wasIntercepted = false;

@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
wasIntercepted = true;

return methodInvocation.proceed();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package de.saxsys.mvvmfx.guice.it;

import static org.assertj.core.api.Assertions.*;

import de.saxsys.mvvmfx.guice.internal.GuiceInjector;
import org.junit.Before;
import org.junit.Test;

import de.saxsys.mvvmfx.guice.internal.GuiceInjector;
import static org.assertj.core.api.Assertions.assertThat;

public class IntegrationTest {

Expand All @@ -15,6 +14,7 @@ public void setup() {
MyApp.wasStopCalled = false;
MyModule.works = false;
MyViewModel.works = false;
MyView.wasInitCalled = false;
}

@Test
Expand Down Expand Up @@ -48,6 +48,8 @@ public void testInjectionOfPrimaryStage() {

assertThat(MyModule.works).isTrue();
assertThat(MyViewModel.works).isTrue();

assertThat(MyView.wasInitCalled).isTrue();

}

Expand Down
11 changes: 8 additions & 3 deletions mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyView.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package de.saxsys.mvvmfx.guice.it;

import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.utils.notifications.NotificationCenter;
import javafx.application.Application;
import javafx.application.HostServices;
import javafx.stage.Stage;

import javax.inject.Inject;

import de.saxsys.mvvmfx.FxmlView;

public class MyView implements FxmlView<MyViewModel> {
@Inject
Stage primaryStage;
Expand All @@ -21,5 +20,11 @@ public class MyView implements FxmlView<MyViewModel> {

@Inject
HostServices hostServices;


public static boolean wasInitCalled = false;


public void initialize() {
wasInitCalled = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ public MyViewModel(MyService service) {
assertThat(service).isNotNull();
works = true;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import javafx.scene.layout.*?>


<AnchorPane fx:controller="de.saxsys.mvvmfx.guice.interceptiontest.InterceptedView" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" />
Loading

0 comments on commit f81d1c5

Please sign in to comment.