You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2014/12/15 16:51:59 UTC

[1/4] incubator-brooklyn git commit: BROOKLYN-83: fix SensorResourceTest

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/0.7.0-M2-incubating 3b2eac0df -> 94b42b85e


BROOKLYN-83: fix SensorResourceTest

- On getting a sensor, if no "Accepts" header is given, then we don't
  control whether json or plain text comes back.
  It is dependent on the method order, which is compiler-specific.
- Therefore delete the test that gave no Accepts and then asserted
  it was json.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2754796c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2754796c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2754796c

Branch: refs/heads/0.7.0-M2-incubating
Commit: 2754796cd9ee976cf3c32b8f9cc75c597032cbc9
Parents: c2af0b2
Author: Aled Sage <al...@gmail.com>
Authored: Thu Nov 13 12:58:55 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Mon Dec 15 11:35:23 2014 +0000

----------------------------------------------------------------------
 .../rest/resources/SensorResourceTest.java      | 27 +++++++++-----------
 1 file changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2754796c/usage/rest-server/src/test/java/brooklyn/rest/resources/SensorResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/SensorResourceTest.java b/usage/rest-server/src/test/java/brooklyn/rest/resources/SensorResourceTest.java
index 564435d..bb80035 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/SensorResourceTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/SensorResourceTest.java
@@ -163,14 +163,12 @@ public class SensorResourceTest extends BrooklynRestResourceTest {
         return response;
     }
     
-    /** Check we can get a sensor, and it defaults is to non-raw json, that is a string picking up the rendering hint */
-    @Test
-    public void testGet() throws Exception {
-        // the double quotes are here because getEntity(String) does not parse json
-        doSensorTest(null, null, "\"12345 frogs\"");
-    }
-
-    /** Same as {@link #testGet()}, but explicitly requesting json should give json */
+    /**
+     * Check we can get a sensor, explicitly requesting json; gives a string picking up the rendering hint.
+     * 
+     * If no "Accepts" header is given, then we don't control whether json or plain text comes back.
+     * It is dependent on the method order, which is compiler-specific.
+     */
     @Test
     public void testGetJson() throws Exception {
         doSensorTest(null, MediaType.APPLICATION_JSON_TYPE, "\"12345 frogs\"");
@@ -190,13 +188,12 @@ public class SensorResourceTest extends BrooklynRestResourceTest {
         doSensorTest(null, MediaType.TEXT_PLAIN_TYPE, "12345 frogs");
     }
 
-    /** Check setting {@code raw} to {@code true} when we get ignores display value hint */
-    @Test
-    public void testGetRaw() throws Exception {
-        doSensorTest(true, null, 12345);
-    }
-    
-    /** As {@link #testGetRaw()} with json explicitly set (is the same) */
+    /** 
+     * Check that when we set {@code raw = true}, the result ignores the display value hint.
+     *
+     * If no "Accepts" header is given, then we don't control whether json or plain text comes back.
+     * It is dependent on the method order, which is compiler-specific.
+     */
     @Test
     public void testGetRawJson() throws Exception {
         doSensorTest(true, MediaType.APPLICATION_JSON_TYPE, 12345);


[3/4] incubator-brooklyn git commit: Add make-source-release script

Posted by ri...@apache.org.
Add make-source-release script


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/52554dc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/52554dc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/52554dc9

Branch: refs/heads/0.7.0-M2-incubating
Commit: 52554dc9414e23531a26ac8d63f1f89889d81d23
Parents: 3b2eac0
Author: Richard Downer <ri...@apache.org>
Authored: Mon Dec 15 11:24:05 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Mon Dec 15 11:35:23 2014 +0000

----------------------------------------------------------------------
 usage/scripts/make-source-release.sh | 123 ++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/52554dc9/usage/scripts/make-source-release.sh
----------------------------------------------------------------------
diff --git a/usage/scripts/make-source-release.sh b/usage/scripts/make-source-release.sh
new file mode 100755
index 0000000..626998d
--- /dev/null
+++ b/usage/scripts/make-source-release.sh
@@ -0,0 +1,123 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# creates a source release - this is a .tar.gz file containing all the source code files that are permitted to be released.
+
+show_help() {
+    echo >&2 "usage: make-source-release [-v version] [-r rc_number]"
+    echo >&2 "    -v version: specifies the name of this version."
+    echo >&2 "                defaults to the version given in pom.xml."
+    echo >&2 "    -r rc_number: specifies the release candidate number."
+    echo >&2 "                  defaults to blank, meaning no release candidate suffix."
+    echo >&2 "When a RC number is given, the produced artifact names include the 'rc' suffix,"
+    echo >&2 "but the contents of the archive artifact do *not* include the suffix. Therefore,"
+    echo >&2 "turning a release candidate into a release requires only renaming the artifacts."
+}
+
+confirm () {
+    # call with a prompt string or use a default
+    read -r -p "${1:-Are you sure? [y/N]} " response
+    case $response in
+        [yY][eE][sS]|[yY]) 
+            true
+            ;;
+        *)
+            false
+            ;;
+    esac
+}
+
+rc_suffix=
+OPTIND=1
+while getopts "h?v:r:" opt; do
+    case "$opt" in
+        h|\?)
+            show_help
+            exit 0
+            ;;
+        v)
+            current_version=$OPTARG
+            ;;
+        r)
+            rc_suffix=$OPTARG
+            ;;
+        *)
+            show_help
+            exit 1
+    esac
+done
+
+shift $((OPTIND-1))
+[ "$1" = "--" ] && shift
+
+[ -d .git ] || {
+echo "Must run in brooklyn project root directory"
+exit 1
+}
+
+if [ -z "${current_version}" ]; then
+    # Some magic to derive the anticipated version of the release.
+    # Use xpath to query the version number in the pom
+    xpath='xpath'
+    type -P $xpath &>/dev/null && {
+    set +e
+    current_version=$( xpath pom.xml '/project/version/text()' 2>/dev/null )
+    set -e
+} || {
+echo "Cannot guess version number as $xpath command not found."
+}
+fi
+if [ -z "${current_version}" ]; then
+    echo >&2 "Version could not be guessed and not given as a command line option"
+    exit 1
+fi
+
+release_name=apache-brooklyn-${current_version}
+if [ -z "$rc_suffix"]; then
+    artifact_name=${release_name}
+else
+    artifact_name=${release_name}-rc${rc_suffix}
+fi
+
+echo "The version is ${current_version}"
+echo "The rc suffix is ${rc_suffix}"
+echo "The release name is ${release_name}"
+echo "The artifact name is ${artifact_name}"
+echo ""
+echo "WARNING! This script will run 'git clean -dxf' to remove ALL files that are not under Git source control."
+echo "This includes build artifacts and all uncommitted local files and directories."
+echo "If you want to check what will happen, answer no and run 'git clean -dxn' to dry run."
+confirm || exit
+git clean -dxf
+
+echo "Creating source release folder ${release_name}"
+mkdir -p ${release_name}
+rsync -rtp --exclude ${release_name} --exclude .git\* --exclude '**/*.[ejw]ar' . ${release_name}
+
+mkdir -p ${artifact_name}
+echo "Creating artifact ${artifact_name}/${artifact_name}.tar.gz"
+tar czf ${artifact_name}/${artifact_name}.tar.gz apache-brooklyn-${current_version}
+( cd ${artifact_name} && md5 ${artifact_name}.tar.gz > ${artifact_name}.tar.gz.md5 )
+( cd ${artifact_name} && shasum -b -a 1 ${artifact_name}.tar.gz > ${artifact_name}.tar.gz.sha1 )
+( cd ${artifact_name} && shasum -b -a 256 ${artifact_name}.tar.gz > ${artifact_name}.tar.gz.sha256 )
+
+echo "Sign the release? This will require a working gpg2 and your private key passphrase."
+confirm && ( cd ${artifact_name} && gpg2 --armor --output ${artifact_name}.tar.gz.asc --detach-sig ${artifact_name}.tar.gz )
+


[2/4] incubator-brooklyn git commit: Revise LICENSE and NOTICE following mentor feedback

Posted by ri...@apache.org.
Revise LICENSE and NOTICE following mentor feedback

See:
https://mail-archives.apache.org/mod_mbox/incubator-brooklyn-dev/201412.mbox/%3C20141211165910.GG36553%40Chips-MacBook-Air.local%3E

MIT/BSD licensed subcomponents now credited in LICENSE instead of
NOTICE. Reviewed ASL2 credits in NOTICE; determined that they do not
have their own NOTICE file, and therefore there is no need to mention
them, per https://www.apache.org/dev/licensing-howto.html#alv2-dep.
This meant that there were no credits remaining in NOTICE; replaced
NOTICE with boilerplate recommended by
https://www.apache.org/dev/licensing-howto.html#simple.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c2af0b27
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c2af0b27
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c2af0b27

Branch: refs/heads/0.7.0-M2-incubating
Commit: c2af0b27a87042e7d0d045a793cc25e7dd99e813
Parents: 52554dc
Author: Richard Downer <ri...@apache.org>
Authored: Fri Dec 12 14:45:39 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Mon Dec 15 11:35:23 2014 +0000

----------------------------------------------------------------------
 LICENSE | 72 +++++++++++++++++++++++++++++++++++++++++++++--------
 NOTICE  | 81 ++----------------------------------------------------------
 2 files changed, 64 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2af0b27/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 7694da5..df7b30f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -177,18 +177,73 @@ http://www.apache.org/licenses/
 
 
 
+---------------------------------------------------
 
-OTHER LICENSES
+This distribution contains third party resources.
 
-This software incorporates minor components developed elsewhere, as described in 
-the accompanying NOTICE file. In addition to the Apache License 2.0 (above),
-the other licenses referenced there under which those components are used are:
+This product includes software developed at The jQuery Foundation (http://jquery.org/):
+jquery.js, selected jquery*.js.
+Copyright (c) John Resig (2011).
+Licensed under the MIT license (see below).
 
+This product includes software developed at The Dojo Foundation (http://dojofoundation.org/):
+require.js, text.js, sizzle.js in jquery.js.
+Copyright (c) The Dojo Foundation (2011, 2012).
+Licensed under the MIT license (see below).
 
+This product includes software developed at DocumentCloud Inc (http://www.documentcloud.org/):
+backbone.js, underscore.js.
+Copyright (c) Jeremy Ashkenas, DocumentCloud Inc (2010-2013).
+Licensed under the MIT license (see below).
 
-The MIT License ("MIT")
+This product includes software developed by Miller Medeiros (https://github.com/millermedeiros/):
+async.js.
+Copyright (c) Miller Medeiros (2011).
+Licensed under the MIT license (see below).
+
+This product includes software developed at Twitter, Inc (http://twitter.com):
+typeahead.js, bloodhound.js
+Copyright (c) Twitter, Inc (2013).
+Licensed under the MIT license (see below).
+
+This product includes software developed by Yehuda Katz (https://github.com/wycats/):
+handlebars*.js.
+Copyright (c) Yehuda Katz (2012).
+Licensed under the MIT license (see below).
+
+This product includes software developed by "Cowboy" Ben Alman (http://benalman.com/).
+jquery.ba-bbq*.js
+Copyright (c) "Cowboy" Ben Alman (2010).
+Licensed under the MIT license (see below).
+
+This product includes software developed by WonderGroup and Jordan Thomas (http://labs.wondergroup.com/demos/mini-ui/index.html):
+jquery.wiggle.js.
+Copyright (c) WonderGroup and Jordan Thomas (2010).
+Licensed under the MIT license (see below).
+
+This product includes software developed by Tim Wood (http://momentjs.com):
+moment.js
+Copyright (c) Tim Wood, Iskren Chernev, Moment.js contributors (2011-2014).
+Licensed under the MIT license (see below).
+
+This product includes software developed by ZeroClipboard contributors (https://github.com/zeroclipboard):
+ZeroClipboard.js
+Copyright (c) Jon Rohan, James M. Greene (2014).
+Licensed under the MIT license (see below).
 
-Copyright (c) <year> <copyright holders>
+
+This product includes software developed at SpryMedia Ltd  (http://sprymedia.co.uk/):
+jquery.dataTables.js, dataTables.extensions.js.
+Copyright (c) Allan Jardine (2008-2012).
+Licensed under the New BSD license (see below).
+
+This product includes software developed by js-uri contributors (https://code.google.com/js-uri):
+URI.js.
+Copyright (c) js-uri contributors (2013).
+Licensed under the New BSD license (see below).
+
+
+The MIT License ("MIT")
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -212,10 +267,7 @@ THE SOFTWARE.
 
 The BSD 3-Clause License ("New BSD")
 
-Copyright (c) <YEAR>, <OWNER>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, 
+Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
 1. Redistributions of source code must retain the above copyright notice, 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2af0b27/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 08039f7..6f99615 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,82 +1,5 @@
 Apache Brooklyn
 Copyright 2014 The Apache Software Foundation
 
-
-This product includes software developed at The Apache Software Foundation (http://www.apache.org/):
-All code unless otherwise specified.
-Copyright (c) The Apache Software Foundation
-Licensed under the Apache License 2.0.
-
-This product includes software developed at The OSGi Alliance (http://www.osgi.org/):
-Java sources in org.osgi.*.
-Copyright (c) The OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at The jQuery Foundation (http://jquery.org/):
-jquery.js, selected jquery*.js.
-Copyright (c) John Resig (2011).
-Licensed under the MIT license (also available under GPLv2).
-
-This product includes software developed at The Dojo Foundation (http://dojofoundation.org/):
-require.js, text.js, sizzle.js in jquery.js.
-Copyright (c) The Dojo Foundation (2011, 2012).
-require.js and text.js licensed under the MIT license (also available under New BSD).
-sizzle.js portions of jquery.js licensed under the MIT license (also available under New BSD and GPL).
-
-This product includes software developed at SpryMedia Ltd  (http://sprymedia.co.uk/):
-jquery.dataTables.js, dataTables.extensions.js.
-Copyright (c) Allan Jardine (2008-2012).
-Licensed under the New BSD license (also available under GPLv2 and newer versions under Apache License 2.0).
-
-This product includes software developed at DocumentCloud Inc (http://www.documentcloud.org/):
-backbone.js, underscore.js.
-Copyright (c) Jeremy Ashkenas, DocumentCloud Inc (2010-2013).
-Licensed under the MIT license.
-
-This product includes software developed by Miller Medeiros (https://github.com/millermedeiros/):
-async.js.
-Copyright (c) Miller Medeiros (2011).
-Licensed under the MIT license.
-
-This product includes software developed at Twitter, Inc (http://twitter.com):
-bootstrap.js.
-Copyright (c) Twitter, Inc (2012).
-Licensed under the Apache License 2.0.
-typeahead.js, bloodhound.js
-Copyright (c) Twitter, Inc (2013).
-Licensed under the MIT License.
-
-This product includes software developed by Yehuda Katz (https://github.com/wycats/):
-handlebars*.js.
-Copyright (c) Yehuda Katz (2012).
-Licensed under the MIT license.
-
-This product includes software developed by "Cowboy" Ben Alman (http://benalman.com/).
-jquery.ba-bbq*.js
-Copyright (c) "Cowboy" Ben Alman (2010).
-Licensed under the MIT license (also available under GPL).
-
-This product includes software developed by WonderGroup and Jordan Thomas (http://labs.wondergroup.com/demos/mini-ui/index.html):
-jquery.wiggle.js.
-Copyright (c) WonderGroup and Jordan Thomas (2010).
-Licensed under the MIT license.
-
-This product includes software developed by Tim Wood (http://momentjs.com):
-moment.js
-Copyright (c) Tim Wood, Iskren Chernev, Moment.js contributors (2011-2014). 
-Licensed under the MIT license.
-
-This product includes software developed at Wordnik, Inc (https://github.com/wordnik/):
-swagger*.js.
-Copyright (c) Wordnik, Inc (2011-2014).
-Licensed under the Apache License 2.0.
-
-This product includes software developed by js-uri contributors (https://code.google.com/js-uri):
-URI.js.
-Copyright (c) js-uri contributors (2013).
-Licensed under the New BSD License.
-
-This product includes software developed by ZeroClipboard contributors (https://github.com/zeroclipboard):
-ZeroClipboard.{js,swf}
-Copyright (c) Jon Rohan, James M. Greene (2014).
-Licensed under the MIT license.
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).


[4/4] incubator-brooklyn git commit: Add workaround for BROOKLYN-1 to README.md

Posted by ri...@apache.org.
Add workaround for BROOKLYN-1 to README.md


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/94b42b85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/94b42b85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/94b42b85

Branch: refs/heads/0.7.0-M2-incubating
Commit: 94b42b85e80efd817f951326238864e37edc2cb0
Parents: 2754796
Author: Richard Downer <ri...@apache.org>
Authored: Mon Dec 15 11:15:47 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Mon Dec 15 13:07:31 2014 +0000

----------------------------------------------------------------------
 README.md | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94b42b85/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 63425a7..b5ffd5a 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,14 @@ Three quick start options are available:
 * Alternatively, [download the latest release](https://github.com/brooklyncentral/brooklyn/tarball/master) (tgz),
 * or, fork or clone the repo: `git clone git://github.com/brooklyncentral/brooklyn.git` then `mvn clean install`.
 
+Please note that there is a known issue with the build which may affect you when
+freshly-extracted source tree
+([BROOKLYN-1](https://issues.apache.org/jira/browse/BROOKLYN-1)). The workaround
+is to issue the command `mvn clean` on the fresh source tree - you should then
+be able to build without problem. Many in the Brooklyn community typically run
+`mvn clean install` and so there may be other idiosyncracies to which this
+workaround applies.
+
 ## Community