changeset 610:b34112e37bf2

Merge
author Roman Kennke <rkennke@redhat.com>
date Thu, 13 Sep 2012 17:19:17 +0200
parents 430be1123985 (current diff) 966edcd4a8ce (diff)
children 66da2a491236
files thread/collector/src/main/java/com/redhat/thermostat/thread/dao/impl/ThreadDaoImpl.java
diffstat 21 files changed, 782 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/pom.xml	Thu Sep 13 17:13:25 2012 +0200
+++ b/distribution/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -132,6 +132,11 @@
                     <include>bundles.properties</include>
                   </includes>
                 </resource>
+                <resource>
+                  <directory>tools</directory>
+                  <targetPath>tools</targetPath>
+                  <filtering>true</filtering>
+                </resource>
               </resources>
             </configuration>
           </execution>
@@ -148,6 +153,7 @@
             <configuration>
               <target>
                 <chmod file="${project.build.directory}/bin/*" perm="755" />
+                <chmod file="${project.build.directory}/tools/*" perm="755" />
               </target>
             </configuration>
             <goals>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distribution/tools/setup_remote_storage.sh	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,35 @@
+#!/bin/bash
+#set -x
+
+if [ $# -ne 2 ]; then
+  echo 1>&2 "usage: $0 <ip-of-storage-host> <path-to-thermostat-home>" 
+  exit 1
+fi
+
+STORAGE_IP=$1
+
+THERMOSTAT_HOME="$2"
+THERMOSTAT_USER="t"
+THERMOSTAT_PWD="t"
+MONGO_ADMIN_USER="admin"
+MONGO_ADMIN_PWD="admin"
+
+$THERMOSTAT_HOME/bin/thermostat storage --start
+cat > /tmp/thermostat_setup.txt <<EOF
+db.addUser("$MONGO_ADMIN_USER", "$MONGO_ADMIN_PWD");
+db.auth("$MONGO_ADMIN_USER", "$MONGO_ADMIN_PWD");
+db = db.getMongo().getDB( "thermostat" );
+db.addUser("$THERMOSTAT_USER", "$THERMOSTAT_PWD");
+EOF
+
+mongo localhost:27518/admin /tmp/thermostat_setup.txt
+$THERMOSTAT_HOME/bin/thermostat storage --stop
+
+cat > $THERMOSTAT_HOME/storage/db.properties <<EOF
+PORT=27518
+BIND=$STORAGE_IP
+PROTOCOL=mongodb
+EOF
+$THERMOSTAT_HOME/bin/thermostat storage --start
+
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/README.building	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,7 @@
+# perhaps rm -rf ~/.m2
+cd path/to/thermostat/home
+mvn clean install
+cd eclipse/test-deps-bundle-wrapping
+mvn clean install
+cd ..
+mvn clean package
--- a/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/com.redhat.thermostat.eclipse.test/META-INF/MANIFEST.MF	Thu Sep 13 17:19:17 2012 +0200
@@ -1,12 +1,22 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Version: 0.4.0.qualifier
-Fragment-Host: com.redhat.thermostat.eclipse;bundle-version="0.4.0.qualifier"
 Bundle-Name: Eclipse client tests
-Bundle-SymbolicName: com.redhat.thermostat.eclipse.test
+Bundle-Activator: com.redhat.thermostat.eclipse.test.Activator
+Bundle-SymbolicName: com.redhat.thermostat.eclipse.test;singleton:=true
 Bundle-Vendor: Redhat Inc.
-Require-Bundle: org.eclipse.jdt.core,
- org.junit;bundle-version="3.8.2"
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="4.10.0",
+ com.redhat.thermostat.bundles.org.hamcrest.core;resolution:=optional,
+ com.redhat.thermostat.bundles.org.objenesis;resolution:=optional,
+ com.redhat.thermostat.bundles.org.mockito.mockito-core;resolution:=optional
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Import-Package: org.mockito,
+Import-Package: com.redhat.thermostat.common,
+ com.redhat.thermostat.common.dao,
+ com.redhat.thermostat.eclipse.model,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.mockito,
  org.mockito.stubbing
+Export-Package: com.redhat.thermostat.eclipse.test.model
--- a/eclipse/com.redhat.thermostat.eclipse.test/pom.xml	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/com.redhat.thermostat.eclipse.test/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -20,6 +20,35 @@
       <artifactId>thermostat-common-core</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>com.redhat.thermostat.eclipse.test-deps-repo</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+      <type>pom</type>
+    </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-surefire-plugin</artifactId>
+        <version>${tycho-version}</version>
+        <!--
+        <configuration>
+          <useUIHarness>true</useUIHarness>
+          <useUIThread>false</useUIThread>
+          <product>org.eclipse.platform.ide</product>
+          <dependencies>
+            <dependency>
+              <type>p2-installable-unit</type>
+              <artifactId>org.eclipse.sdk.feature.group</artifactId>
+              <version>${sdk-version}</version>
+            </dependency>
+          </dependencies>   
+        </configuration>
+        -->
+      </plugin>
+    </plugins>
+  </build>
 
 </project>
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/model/HostVmsTreeContentProviderTest.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/model/HostVmsTreeContentProviderTest.java	Thu Sep 13 17:19:17 2012 +0200
@@ -34,7 +34,7 @@
  * to do so, delete this exception statement from your version.
  */
 
-package com.redhat.thermostat.eclipse.model;
+package com.redhat.thermostat.eclipse.test.model;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -53,6 +53,8 @@
 import com.redhat.thermostat.common.HostsVMsLoader;
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.eclipse.model.HostsVmsTreeContentProvider;
+import com.redhat.thermostat.eclipse.model.HostsVmsTreeRoot;
 
 public class HostVmsTreeContentProviderTest {
 
--- a/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/model/HostsVmsLabelProviderTest.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/model/HostsVmsLabelProviderTest.java	Thu Sep 13 17:19:17 2012 +0200
@@ -34,7 +34,7 @@
  * to do so, delete this exception statement from your version.
  */
 
-package com.redhat.thermostat.eclipse.model;
+package com.redhat.thermostat.eclipse.test.model;
 
 import org.junit.After;
 import org.junit.Before;
@@ -47,6 +47,8 @@
 
 import com.redhat.thermostat.common.dao.HostRef;
 import com.redhat.thermostat.common.dao.VmRef;
+import com.redhat.thermostat.eclipse.model.HostsVmsLabelProvider;
+import com.redhat.thermostat.eclipse.model.HostsVmsTreeRoot;
 
 public class HostsVmsLabelProviderTest {
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/com.redhat.thermostat.eclipse.test/src/com/redhat/thermostat/eclipse/test/Activator.java	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.eclipse.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+    // The plug-in ID
+    public static final String PLUGIN_ID = "com.redhat.thermostat.eclipse.test"; //$NON-NLS-1$
+
+    // The shared instance
+    private static Activator plugin;
+
+    /**
+     * The constructor
+     */
+    public Activator() {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+     * )
+     */
+    public void start(BundleContext context) throws Exception {
+        super.start(context);
+        plugin = this;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+     * )
+     */
+    public void stop(BundleContext context) throws Exception {
+        plugin = null;
+        super.stop(context);
+    }
+
+    /**
+     * Returns the shared instance
+     * 
+     * @return the shared instance
+     */
+    public static Activator getDefault() {
+        return plugin;
+    }
+
+}
--- a/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/com.redhat.thermostat.eclipse/META-INF/MANIFEST.MF	Thu Sep 13 17:19:17 2012 +0200
@@ -7,8 +7,8 @@
 Bundle-Vendor: Red Hat Inc.
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
- org.eclipse.ui;bundle-version="3.103.0"
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui
 Import-Package: com.mongodb,
  com.redhat.thermostat.common,
  com.redhat.thermostat.common.appctx,
@@ -16,4 +16,6 @@
  com.redhat.thermostat.common.dao,
  com.redhat.thermostat.common.model,
  com.redhat.thermostat.common.storage
-Eclipse-ExtensibleAPI: true
+Export-Package: com.redhat.thermostat.eclipse;x-friends:=com.redhat.thermostat.eclipse.test,
+ com.redhat.thermostat.eclipse.model;x-friends:=com.redhat.thermostat.eclipse.test,
+ com.redhat.thermostat.eclipse.views;x-friends:=com.redhat.thermostat.eclipse.test
--- a/eclipse/composite-repo/pom.xml	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/composite-repo/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -53,7 +53,7 @@
     <main.basedir>${project.basedir}/..</main.basedir>  
   </properties>
 
-  <name>Thermostat Eclipse Composite p2 Repo</name>
+  <name>Thermostat Eclipse :: Composite p2 Repo</name>
 
   <build>
     <plugins>
--- a/eclipse/pom.xml	Thu Sep 13 17:13:25 2012 +0200
+++ b/eclipse/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -95,6 +95,11 @@
     <module>com.redhat.thermostat.eclipse.feature</module>
     <module>com.redhat.thermostat.eclipse.p2-repo</module>
     <module>core-p2-repository</module>
+    <module>test-deps-bundle-wrapping</module>
+    <!-- Adds p2 metadata and creates repo for plain (wrapped)
+         Java OSGi bundles so they can be found for building and
+         running tycho tests -->
+    <module>test-deps-p2-repository</module>
     <module>composite-repo</module>
   </modules>
 
@@ -110,6 +115,11 @@
       <url>${orbit-site}</url>
     </repository>
     <repository>
+      <id>local_eclipse_test_deps</id>
+      <layout>p2</layout>
+      <url>file://${basedir}/../test-deps-p2-repository/target/repository/</url>
+    </repository>
+    <repository>
       <id>maven.eclipse.org</id>
       <url>http://maven.eclipse.org/nexus/content/groups/public/</url>
     </repository>
@@ -155,10 +165,29 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-surefire-plugin</artifactId>
+        <version>${tycho-version}</version>
+        <executions>
+          <execution>
+            <id>run-tests-during-package</id>
+            <phase>package</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <version>2.3.7</version>
+        </plugin>
+        <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>tycho-compiler-plugin</artifactId>
           <version>${tycho-version}</version>
@@ -171,7 +200,7 @@
           <artifactId>tycho-surefire-plugin</artifactId>
           <version>${tycho-version}</version>
           <configuration>
-            <useUIHarness>false</useUIHarness>
+            <useUIHarness>true</useUIHarness>
             <useUIThread>flase</useUIThread>
             <dependencies>
               <dependency>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/test-deps-bundle-wrapping/org.hamcrest/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,95 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!-- 
+
+ Copyright 2012 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses />.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>thermostat-eclipse-test-deps</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.hamcrest</groupId>
+    <artifactId>com.redhat.thermostat.bundles.org.hamcrest.core</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.3</version>
+    <name>Thermostat Eclipse :: Bundles :: ${pkgArtifactId}</name>
+    <description>
+        This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.
+    </description>
+
+    <properties>
+        <pkgGroupId>org.hamcrest</pkgGroupId>
+        <pkgArtifactId>hamcrest-core</pkgArtifactId>
+        <pkgVersion>1.3</pkgVersion>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>${pkgGroupId}</groupId>
+            <artifactId>${pkgArtifactId}</artifactId>
+            <version>${pkgVersion}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+              <Bundle-Version>1.3.0</Bundle-Version>
+              <Export-Package>
+                org.hamcrest.core;uses:="org.hamcrest";version="1.3",
+                org.hamcrest;uses:="org.hamcrest.internal,
+                org.hamcrest.core";version="1.3"
+              </Export-Package>
+              <Private-Package>org.hamcrest.internal</Private-Package>
+              <Import-Package>*</Import-Package>
+            </instructions>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/test-deps-bundle-wrapping/org.mockito/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,135 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!-- 
+
+ Copyright 2012 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses />.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>thermostat-eclipse-test-deps</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.mockito</groupId>
+    <artifactId>com.redhat.thermostat.bundles.org.mockito.mockito-core</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.9.0</version>
+    <name>Thermostat Eclipse :: Bundles :: ${pkgArtifactId}</name>
+    <description>
+        This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.
+    </description>
+
+    <properties>
+        <pkgGroupId>org.mockito</pkgGroupId>
+        <pkgArtifactId>mockito-core</pkgArtifactId>
+        <pkgVersion>1.9.0</pkgVersion>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>${pkgGroupId}</groupId>
+            <artifactId>${pkgArtifactId}</artifactId>
+            <version>${pkgVersion}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+              <Private-Package>
+                org.mockito.internal*,
+                org.mockito.cglib*,
+                org.mockito.asm*,
+                org.objenesis*,
+                org.hamcrest*,
+              </Private-Package>
+              <Export-Package>
+	       org.mockito.exceptions.base;version="1.9",
+               org.mockito.exceptions;
+                 uses:="org.mockito.exceptions.verification.junit,org.mockito.exceptions.base,
+                        org.mockito.listeners,org.mockito.exceptions.misusing,
+                        org.mockito.exceptions.verification";version="1.9",
+               org.mockito.exceptions.verification;
+                 uses:="org.mockito.exceptions.base";version="1.9",
+               org.mockito.stubbing.answers;
+                 uses:="org.mockito.exceptions.base,org.mockito.invocation,org.mockito.stubbing";
+                 version="1.9",
+               org.mockito.configuration;
+                 uses:="org.mockito,org.mockito.stubbing";version="1.9",
+               org.mockito.invocation;version="1.9",
+               org.mockito.exceptions.verification.junit;
+                 uses:="junit.framework,org.mockito.exceptions.verification";version="1.9",
+               org.mockito.listeners;uses:="org.mockito.exceptions";version="1.9",
+               org.mockito;
+                 uses:="org.hamcrest,org.mockito.stubbing,org.mockito.verification,
+                        org.mockito.listeners,org.mockito.exceptions.base,org.mockito.exceptions,
+                        org.mockito.configuration,org.mockito.invocation";version="1.9",
+               org.mockito.runners;
+                 uses:="org.junit.runner,org.junit.runner.notification,org.junit.runner.manipulation";
+                 version="1.9",
+               org.mockito.exceptions.misusing;uses:="org.mockito.exceptions.base";version="1.9",
+               org.mockito.verification;uses:="org.mockito.exceptions";version="1.9",
+               org.mockito.stubbing;uses:="org.mockito.invocation";version="1.9"
+              </Export-Package>
+              <Import-Package>
+                junit.*;resolution:=optional,
+                org.junit.*;resolution:=optional,
+                org.hamcrest;version="[1.3,2.0)",
+                org.objenesis;version="[1.0,2.0)",
+                org.apache.tools.ant;resolution:=optional,
+                org.apache.tools.ant.types;resolution:=optional,
+                COM.jrockit.reflect;resolution:=optional,
+                jrockit.vm;resolution:=optional,
+                sun.reflect;resolution:=optional,
+                org.mockito*
+              </Import-Package>
+              <_removeheaders>Private-Package</_removeheaders>
+            </instructions>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/test-deps-bundle-wrapping/org.objenesis/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!-- 
+
+ Copyright 2012 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses />.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>thermostat-eclipse-test-deps</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.objenesis</groupId>
+    <artifactId>com.redhat.thermostat.bundles.org.objenesis</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0</version>
+    <name>Thermostat Eclipse :: Bundles :: ${pkgArtifactId}</name>
+    <description>
+        This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.
+    </description>
+
+    <properties>
+        <pkgGroupId>org.objenesis</pkgGroupId>
+        <pkgArtifactId>objenesis</pkgArtifactId>
+        <pkgVersion>1.0</pkgVersion>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>${pkgGroupId}</groupId>
+            <artifactId>${pkgArtifactId}</artifactId>
+            <version>${pkgVersion}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+              <Export-Package>
+                org.objenesis.instantiator.jrockit;version="1.0",
+                org.objenesis;version="1.0",
+                org.objenesis.strategy;version="1.0",
+                org.objenesis.instantiator;version="1.0",
+                org.objenesis.instantiator.basic;version="1.0",
+                org.objenesis.instantiator.sun;version="1.0",
+                org.objenesis.instantiator.gcj;version="1.0"
+              </Export-Package>
+              <Import-Package>
+                !COM.jrockit*,!jrockit.vm*,!sun.reflect,
+                org.objenesis.instantiator.jrockit;version="1.0",
+                org.objenesis;version="1.0",
+                org.objenesis.strategy;version="1.0",
+                org.objenesis.instantiator;version="1.0",
+                org.objenesis.instantiator.basic;version="1.0",
+                org.objenesis.instantiator.sun;version="1.0",
+                org.objenesis.instantiator.gcj;version="1.0"
+              </Import-Package>
+              <_nouses>true</_nouses>
+            </instructions>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/test-deps-bundle-wrapping/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,72 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!-- 
+
+ Copyright 2012 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses />.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>thermostat-eclipse-parent</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </parent>
+
+    <!-- Prepares test deps into proper bundles
+         (mockito was especially tricky so please keep this) -->
+    <artifactId>thermostat-eclipse-test-deps</artifactId>
+    <packaging>pom</packaging>
+
+    <name>Thermostat Eclipse :: Test Deps :: Bundles</name>
+
+    <modules>
+      <module>org.hamcrest</module>
+      <module>org.objenesis</module>
+      <module>org.mockito</module>
+    </modules>
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.12</version>
+          <configuration>
+            <skipTests>true</skipTests>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eclipse/test-deps-p2-repository/pom.xml	Thu Sep 13 17:19:17 2012 +0200
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+
+ Copyright 2012 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses />.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>thermostat-eclipse-parent</artifactId>
+    <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+    <version>0.4.0-SNAPSHOT</version>
+  </parent>
+  <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+  <artifactId>com.redhat.thermostat.eclipse.test-deps-repo</artifactId>
+  <version>0.4.0-SNAPSHOT</version>
+
+  <name>Thermostat Eclipse :: p2 repository for plain Java test deps</name>
+
+  <!-- Need to make deps proper bundles in order to be able to
+       generate metadata and p2 repo for it -->
+  <dependencies>
+    <dependency>
+      <groupId>com.redhat.thermostat.eclipse.parent</groupId>
+      <artifactId>thermostat-eclipse-test-deps</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+      <!-- we need this since test deps wrapping does not produce a jar
+           which is default -->
+      <type>pom</type>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <!-- Configuration for the PublishFeaturesAndBundlesMojoTest -->
+      <plugin>
+        <groupId>org.eclipse.tycho.extras</groupId>
+        <artifactId>tycho-p2-extras-plugin</artifactId>
+        <version>${tycho-version}</version>
+        <executions>
+          <execution>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>publish-features-and-bundles</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <compress>true</compress>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-bundles-for-publishing</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.hamcrest</groupId>
+                  <artifactId>com.redhat.thermostat.bundles.org.hamcrest.core</artifactId>
+                  <version>1.3</version>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.mockito</groupId>
+                  <artifactId>com.redhat.thermostat.bundles.org.mockito.mockito-core</artifactId>
+                  <version>1.9.0</version>
+                </artifactItem>
+                <artifactItem>
+                  <groupId>org.objenesis</groupId>
+                  <artifactId>com.redhat.thermostat.bundles.org.objenesis</artifactId>
+                  <version>1.0</version>
+                </artifactItem>
+              </artifactItems>
+              <outputDirectory>${project.basedir}/target/source/plugins</outputDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <packaging>pom</packaging>
+</project>
--- a/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadTableController.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/thread/client-controllers/src/main/java/com/redhat/thermostat/thread/client/controller/impl/ThreadTableController.java	Thu Sep 13 17:19:17 2012 +0200
@@ -149,7 +149,7 @@
                     double monitor = 0;
                     double sleeping = 0;
                     for (ThreadInfoData info : beanList) {
-                        State state = info.getThreadState();
+                        State state = info.getState();
                         switch (state) {
                         case RUNNABLE:
                             running++;
--- a/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/ThreadDao.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/thread/collector/src/main/java/com/redhat/thermostat/thread/dao/ThreadDao.java	Thu Sep 13 17:19:17 2012 +0200
@@ -94,10 +94,11 @@
     static final Key<Long> THREAD_BLOCKED_COUNT_KEY = new Key<Long>(THREAD_BLOCKED_COUNT, false);
     static final String THREAD_WAIT_COUNT = "threadWaitCount";
     static final Key<Long> THREAD_WAIT_COUNT_KEY = new Key<Long>(THREAD_WAIT_COUNT, false);
-            
+    
     static final Category THREAD_INFO =
             new Category("vm-thread-info", Key.AGENT_ID, Key.VM_ID,
                          Key.TIMESTAMP, THREAD_NAME_KEY, THREAD_ID_KEY,
+                         THREAD_STATE_KEY,
                          THREAD_CPU_TIME_KEY,
                          THREAD_USER_TIME_KEY, THREAD_BLOCKED_COUNT_KEY,
                          THREAD_WAIT_COUNT_KEY);
--- a/thread/collector/src/main/java/com/redhat/thermostat/thread/model/ThreadInfoData.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/thread/collector/src/main/java/com/redhat/thermostat/thread/model/ThreadInfoData.java	Thu Sep 13 17:19:17 2012 +0200
@@ -100,9 +100,14 @@
     public void setThreadId(long threadID) {
         this.threadID = threadID;
     }
+    
+    public void setState(State threadState) {
+        this.threadState = threadState;
+    }
 
-    public void setThreadState(State threadState) {
-        this.threadState = threadState;
+    @Persist
+    public void setThreadState(String threadStateString) {
+        this.threadState = Thread.State.valueOf(threadStateString);
     }
 
     @Persist
@@ -125,11 +130,16 @@
         return threadID;
     }
 
-    public State getThreadState() {
+    public State getState() {
         return threadState;
     }
 
     @Persist
+    public String getThreadState() {
+        return threadState.name();
+    }
+    
+    @Persist
     public long getTimeStamp() {
         return timestamp;
     }
--- a/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/Harvester.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/Harvester.java	Thu Sep 13 17:19:17 2012 +0200
@@ -197,7 +197,7 @@
 
               info.setThreadName(beanInfo.getThreadName());
               info.setThreadId(beanInfo.getThreadId());
-              info.setThreadState(beanInfo.getThreadState());
+              info.setState(beanInfo.getThreadState());
               info.setStackTrace(beanInfo.getStackTrace());
 
               info.setThreadCpuTime(collectorBean.getThreadCpuTime(info.getThreadId()));
--- a/thread/harvester/src/test/java/com/redhat/thermostat/thread/harvester/HarvesterTest.java	Thu Sep 13 17:13:25 2012 +0200
+++ b/thread/harvester/src/test/java/com/redhat/thermostat/thread/harvester/HarvesterTest.java	Thu Sep 13 17:19:17 2012 +0200
@@ -279,14 +279,16 @@
         ThreadInfo info1 = mock(ThreadInfo.class);
         when(info1.getThreadName()).thenReturn("fluff1");
         when(info1.getThreadId()).thenReturn(1l);
-
+        when(info1.getThreadState()).thenReturn(Thread.State.RUNNABLE);
+        
         ThreadInfo info2 = mock(ThreadInfo.class);
         when(info2.getThreadName()).thenReturn("fluff2");
         when(info2.getThreadId()).thenReturn(2l);
+        when(info2.getThreadState()).thenReturn(Thread.State.BLOCKED);
 
         ThreadInfo[] infos = new ThreadInfo[] {
             info1,
-            info2     
+            info2
         };
                 
         ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
@@ -339,6 +341,11 @@
         assertEquals("fluff1", threadInfos.get(0).getThreadName());
         assertEquals("fluff2", threadInfos.get(1).getThreadName());
         
+        assertEquals("RUNNABLE", threadInfos.get(0).getThreadState());
+        assertEquals("BLOCKED", threadInfos.get(1).getThreadState());
+        assertEquals(Thread.State.RUNNABLE, threadInfos.get(0).getState());
+        assertEquals(Thread.State.BLOCKED, threadInfos.get(1).getState());
+
         verify(collectorBean, times(1)).getThreadCpuTime(1l);
         verify(collectorBean, times(1)).getThreadCpuTime(2l);
     }