Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1B4B6200C67 for ; Mon, 15 May 2017 13:03:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 19DC2160BCE; Mon, 15 May 2017 11:03:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8801C160BE3 for ; Mon, 15 May 2017 13:03:09 +0200 (CEST) Received: (qmail 56222 invoked by uid 500); 15 May 2017 11:03:08 -0000 Mailing-List: contact commits-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list commits@polygene.apache.org Received: (qmail 55482 invoked by uid 99); 15 May 2017 11:03:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2017 11:03:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DE444E0061; Mon, 15 May 2017 11:03:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: paulmerlin@apache.org To: commits@polygene.apache.org Date: Mon, 15 May 2017 11:03:07 -0000 Message-Id: <2ea7b378d63540f6906e0917bd5bc6c3@git.apache.org> In-Reply-To: <81344bc2677c4f7a8c448c7dc43520ed@git.apache.org> References: <81344bc2677c4f7a8c448c7dc43520ed@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/50] polygene-java git commit: :tutorials:hello refine archived-at: Mon, 15 May 2017 11:03:11 -0000 :tutorials:hello refine Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/779e8553 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/779e8553 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/779e8553 Branch: refs/heads/develop Commit: 779e8553fdca8a0de648617dc41edf3407be4dad Parents: ee44495 Author: Paul Merlin Authored: Mon May 15 09:06:26 2017 +0200 Committer: Paul Merlin Committed: Mon May 15 09:06:26 2017 +0200 ---------------------------------------------------------------------- .../org/apache/polygene/tutorials/hello/Hello.java | 16 +++++++--------- .../apache/polygene/tutorials/hello/HelloTest.java | 2 -- 2 files changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/779e8553/tutorials/hello/src/main/java/org/apache/polygene/tutorials/hello/Hello.java ---------------------------------------------------------------------- diff --git a/tutorials/hello/src/main/java/org/apache/polygene/tutorials/hello/Hello.java b/tutorials/hello/src/main/java/org/apache/polygene/tutorials/hello/Hello.java index cf0f58f..f0fd7e4 100644 --- a/tutorials/hello/src/main/java/org/apache/polygene/tutorials/hello/Hello.java +++ b/tutorials/hello/src/main/java/org/apache/polygene/tutorials/hello/Hello.java @@ -19,7 +19,6 @@ */ package org.apache.polygene.tutorials.hello; -import org.apache.polygene.api.common.UseDefaults; import org.apache.polygene.api.injection.scope.This; import org.apache.polygene.api.mixin.Mixins; import org.apache.polygene.api.property.Property; @@ -28,10 +27,10 @@ import org.apache.polygene.library.constraints.annotation.NotEmpty; // START SNIPPET: body /** - * This Composite interface declares a simple "Hello World" interface with a single say() method. What is being - * said is defined in the HelloWorldState interface, which is a private mixin. + * This Composite interface declares a simple "Hello World" interface with a single say() method. + * What is being said is defined in the HelloWorldState interface, which is a private mixin. */ -@Mixins( { Hello.HelloWorldMixin.class } ) +@Mixins( Hello.HelloWorldMixin.class ) public interface Hello { String say(); @@ -39,10 +38,11 @@ public interface Hello /** * This is the implementation of the say() method. */ - public abstract class HelloWorldMixin + class HelloWorldMixin implements Hello { - // @This reference the composite itself, and since HelloWorldState is not part of the public interface, + // @This reference the composite itself, + // and since HelloWorldState is not part of the public interface, // it is a private mixin. @This private State state; @@ -57,14 +57,12 @@ public interface Hello /** * This interface contains only the state of the HelloWorld object. */ - public interface State + interface State { @NotEmpty - @UseDefaults Property phrase(); @NotEmpty - @UseDefaults Property name(); } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/779e8553/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest.java ---------------------------------------------------------------------- diff --git a/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest.java b/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest.java index d752fdd..4a2453f 100644 --- a/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest.java +++ b/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest.java @@ -22,7 +22,6 @@ package org.apache.polygene.tutorials.hello; import org.apache.polygene.test.AbstractPolygeneTest; import org.junit.Test; import org.apache.polygene.api.value.ValueBuilder; -import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import static org.hamcrest.CoreMatchers.equalTo; @@ -36,7 +35,6 @@ public class HelloTest extends AbstractPolygeneTest // START SNIPPET: step2 @Override public void assemble( ModuleAssembly module ) - throws AssemblyException { module.values( Hello.class ); }