[jboss-cvs] JBossAS SVN: r57314 - in trunk/system/src/tests/org/jboss/test: . profileservice profileservice/profiles profileservice/profiles/p0 profileservice/profiles/p0/beans profileservice/profiles/p0/ifaces profileservice/simple1 profileservice/support profileservice/test server server/profileservice

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Sep 30 22:44:39 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-09-30 22:44:33 -0400 (Sat, 30 Sep 2006)
New Revision: 57314

Added:
   trunk/system/src/tests/org/jboss/test/profileservice/
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceThing.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceView.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JBossManagedConnectionPool.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JCAMgr.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NamingService.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NoTxConnectionManager.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/PoolView.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/RARDeployment.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxConnectionManager.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxMgr.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IJCAMgr.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/INamingService.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IRemoting.java
   trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/ITxMgr.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl2.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/PropertyInfoImpl.java
   trunk/system/src/tests/org/jboss/test/profileservice/simple1/SecurityActions.java
   trunk/system/src/tests/org/jboss/test/profileservice/support/
   trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java
   trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceKernelConfig.java
   trunk/system/src/tests/org/jboss/test/profileservice/support/SecurityActions.java
   trunk/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java
   trunk/system/src/tests/org/jboss/test/profileservice/support/Simple2PSBootstrap.java
   trunk/system/src/tests/org/jboss/test/profileservice/test/
   trunk/system/src/tests/org/jboss/test/profileservice/test/DataSourceTestCase.properties
   trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.java
   trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.properties
   trunk/system/src/tests/org/jboss/test/server/
   trunk/system/src/tests/org/jboss/test/server/profileservice/
   trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
   trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
Log:
Merge the bootstrap tests and update them for the vfs and deployer changes

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceThing.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceThing.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceThing.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,32 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at DataSourceView()
+public class DataSourceThing
+{
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceView.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceView.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/DataSourceView.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.jboss.annotation.management.ManagedObject;
+
+/**
+ * The management view for the datasource deployment. Each field represents the
+ * name of the DeploymentBean property to bind to the field. 
+ * 
+ * @author starksm
+ * @version $Revision$
+ */
+ at ManagedObject
+ at Retention(value=RetentionPolicy.RUNTIME)
+public @interface DataSourceView
+{
+   public String jndiName() default "JndiName";
+   public String useJavaContext() default "UseJavaContext";
+   public String securityDomainJndiName() default "SecurityDomainJndiName";
+   
+   public String typeMapping() default "TypeMapping";
+
+   public PoolView pool() default @PoolView;
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JBossManagedConnectionPool.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JBossManagedConnectionPool.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JBossManagedConnectionPool.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,15 @@
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.annotation.management.ManagedProperty;
+import org.jboss.annotation.management.ViewUse;
+
+/**
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class JBossManagedConnectionPool {
+    @ManagedProperty (use= ViewUse.CONFIGURATION)
+    public int blockingTimeoutMillis;
+    @ManagedProperty (use= ViewUse.STATISTIC)
+    public int connectionCreatedCount;
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JCAMgr.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JCAMgr.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/JCAMgr.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,56 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.test.profileservice.profiles.p0.ifaces.IJCAMgr;
+import org.jboss.test.profileservice.profiles.p0.ifaces.INamingService;
+import org.jboss.test.profileservice.profiles.p0.ifaces.ITxMgr;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class JCAMgr
+   implements IJCAMgr
+{
+   private INamingService ns;
+   private ITxMgr txMgr;
+
+   public INamingService getNameService()
+   {
+      return ns;
+   }
+   public void setNameService(INamingService ns)
+   {
+      this.ns = ns;
+   }
+
+   public ITxMgr getTxMgr()
+   {
+      return txMgr;
+   }
+   public void setTxMgr(ITxMgr mgr)
+   {
+      this.txMgr = mgr;
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NamingService.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NamingService.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NamingService.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,35 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.test.profileservice.profiles.p0.ifaces.INamingService;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+
+public class NamingService
+   implements INamingService
+{
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NoTxConnectionManager.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NoTxConnectionManager.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/NoTxConnectionManager.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,13 @@
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.annotation.management.ManagedProperty;
+import org.jboss.annotation.management.ViewUse;
+
+/**
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class NoTxConnectionManager {
+    @ManagedProperty (use= ViewUse.CONFIGURATION)
+    public String securityDomainJndiName;
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/PoolView.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/PoolView.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/PoolView.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.jboss.annotation.management.ManagedObject;
+
+ at ManagedObject
+ at Retention(value=RetentionPolicy.RUNTIME)
+public @interface PoolView
+{
+   public String minSize() default "MinSize";
+   public String maxSize() default "MaxSize";
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/RARDeployment.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/RARDeployment.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/RARDeployment.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,13 @@
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.annotation.management.ManagedProperty;
+import org.jboss.annotation.management.ViewUse;
+
+/**
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class RARDeployment {
+    @ManagedProperty (use= ViewUse.CONFIGURATION)
+    public String connectionFactoryProperty1;
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxConnectionManager.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxConnectionManager.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxConnectionManager.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,18 @@
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.annotation.management.ManagedProperty;
+import org.jboss.annotation.management.ViewUse;
+
+/**
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class TxConnectionManager
+{
+   @ManagedProperty(use = ViewUse.CONFIGURATION)
+   public boolean trackConnectionByTx;
+
+   @ManagedProperty(use = ViewUse.CONFIGURATION)
+   public String jndiName;
+
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxMgr.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxMgr.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/beans/TxMgr.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,46 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.beans;
+
+import org.jboss.test.profileservice.profiles.p0.ifaces.ITxMgr;
+import org.jboss.test.profileservice.profiles.p0.ifaces.INamingService;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+
+public class TxMgr
+   implements ITxMgr
+{
+   INamingService ns;
+
+   public INamingService getNameService()
+   {
+      return ns;
+   }
+   public void setNameService(INamingService ns)
+   {
+      this.ns = ns;
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IJCAMgr.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IJCAMgr.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IJCAMgr.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,37 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.ifaces;
+
+/**
+ * Mock jca service
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface IJCAMgr
+{
+   public INamingService getNameService();
+   public void setNameService(INamingService ns);
+   public ITxMgr getTxMgr();
+   public void setTxMgr(ITxMgr mgr);
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/INamingService.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/INamingService.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/INamingService.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,32 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.ifaces;
+
+/**
+ * Mock name service bean
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface INamingService
+{
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IRemoting.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IRemoting.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/IRemoting.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,34 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.ifaces;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+
+public interface IRemoting
+{
+   public INamingService getNameService();
+   public void setNameService(INamingService ns);
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/ITxMgr.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/ITxMgr.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/profiles/p0/ifaces/ITxMgr.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,34 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.profiles.p0.ifaces;
+
+/**
+ * Mock tx mgr
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ITxMgr
+{
+   public INamingService getNameService();
+   public void setNameService(INamingService ns);
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,102 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.simple1;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.ManagedObject;
+
+/**
+ * A simple implementation of Deployment.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class DeploymentImpl
+   /* implements Deployment TODO */
+{
+   private String type;
+   private String name;
+   private URL rootURL;
+   private String[] files = {};
+   private ManagedObject managedObject;
+
+   public String getType()
+   {
+      return type;
+   }
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public URL getRootURL()
+   {
+      return rootURL;
+   }
+   public void setRootURL(URL rootURL)
+   {
+      this.rootURL = rootURL;
+   }
+
+   public String[] getFiles()
+   {
+      return files;
+   }
+   public void setFiles(String[] files)
+   {
+      this.files = files;
+   }
+
+   public void setManagedObject(ManagedObject managedObject)
+   {
+      this.managedObject = managedObject;
+   }
+   public ManagedObject getManagedObject()
+   {
+      return managedObject;
+   }
+   /* TODO
+   public DeploymentContext getRootContext()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+   */
+   public Set<String> getTypes()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,66 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.simple1;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.ManagedObject;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.beans.info.spi.PropertyInfo;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagementViewImpl
+   implements ManagementView
+{
+   private ProfileService ps;
+
+   ManagementViewImpl(ProfileService ps)
+   {
+      this.ps = ps;
+   }
+
+   public ManagedObject getView(ProfileKey key, String deploymentName)
+      throws NoSuchProfileException, NoSuchDeploymentException
+   {
+      Profile profile = ps.getProfile(key);
+      DeploymentContext d = profile.getDeployment(deploymentName);
+      /** TODO ManagedObject mo = d.getManagedObject();
+      return mo; */
+      return null;
+   }
+
+   public void setView(ProfileKey key, String deploymentName, HashMap<String, PropertyInfo> view)
+      throws NoSuchProfileException, IOException
+   {
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,190 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.simple1;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.DeploymentTemplate;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+
+/**
+ * A test profile with a fixed default deployment. The contents of the
+ * deployments are expected to be in the 
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ProfileImpl
+   implements Profile
+{
+   private HashMap<String, DeploymentContext> deployments;
+
+   public ProfileImpl() throws IOException
+   {
+      deployments = new HashMap<String, DeploymentContext>();
+      String deployDir = SecurityActions.getSystemProperty("jbosstest.deploy.dir");
+      URL libURL;
+      if( deployDir == null )
+      {
+         // Used codesource + ../lib
+         URL classes = getClass().getProtectionDomain().getCodeSource().getLocation();
+         libURL = new URL(classes, "../lib/");
+      }
+      else
+      {
+         libURL = new URL(deployDir);
+      }
+
+      /* TODO DeploymentImpl p0 = new DeploymentImpl();
+      p0.setName("CoreServices");
+      p0.setRootURL(libURL);
+      String[] files = {"p0.jar"};
+      p0.setFiles(files); */
+      /*
+      ArrayList<DeploymentBean> beans = new ArrayList<DeploymentBean>();
+      // NamingService
+      String nsName = "TheNamingService";
+      String nsType = "org.jboss.test.profileservice.profiles.p0.beans.NamingService";
+      DeploymentBeanImpl<BeanMetaData> ns = new DeploymentBeanImpl<BeanMetaData>(nsName, nsType);
+      AbstractBeanMetaData nsMetaData = new AbstractBeanMetaData(nsName, nsType);
+      ns.setBeanMetaData(nsMetaData);
+      beans.add(ns);
+      // JTA
+      String txName = "TheTxMgr";
+      String txType = "org.jboss.test.profileservice.profiles.p0.beans.TxMgr";
+      DeploymentBeanImpl<BeanMetaData> txMgr = new DeploymentBeanImpl<BeanMetaData>(txName, txType);
+      AbstractBeanMetaData txMetaData = new AbstractBeanMetaData(txName, txType);
+      HashSet<DemandMetaData> txDemands = new HashSet<DemandMetaData>();
+      txDemands.add(new AbstractDemandMetaData(nsName));
+      txMetaData.setDemands(txDemands);
+      txMgr.setBeanMetaData(txMetaData);
+      beans.add(txMgr);
+      // JCA
+      String jcaName = "TheJCAMgr";
+      String jcaType = "org.jboss.test.profileservice.profiles.p0.beans.JCAMgr";
+      DeploymentBeanImpl<BeanMetaData> jca = new DeploymentBeanImpl<BeanMetaData>(jcaName, jcaType);
+      AbstractBeanMetaData jcaMetaData = new AbstractBeanMetaData(jcaName, jcaType);
+      HashSet<DemandMetaData> jcaDemands = new HashSet<DemandMetaData>();
+      jcaDemands.add(new AbstractDemandMetaData(nsName));
+      jcaDemands.add(new AbstractDemandMetaData(txName));
+      jcaMetaData.setDemands(jcaDemands);
+      jca.setBeanMetaData(jcaMetaData);
+      beans.add(jca);
+      */
+      /* TODO deployments.put("CoreServices", p0); */
+   }
+
+   public String getVersion()
+   {
+      return "1.0.0";
+   }
+
+   public DeploymentTemplate getTemplate(String name)
+   {
+      return null;
+   }
+
+   public void addDeployment(DeploymentContext d)
+   {
+      throw new UnsupportedOperationException("simple1 is read-only");
+   }
+
+   public void removeDeployment(String name)
+   {
+      throw new UnsupportedOperationException("simple1 is read-only");
+   }
+
+   public Collection<DeploymentContext> getDeployments()
+   {
+      return Collections.unmodifiableCollection(deployments.values());
+   }
+
+   public Map<String, Object> getConfig()
+   {
+      return null;
+   }
+
+   public DeploymentContext getDeployment(String name)
+      throws NoSuchDeploymentException
+   {
+      DeploymentContext d = deployments.get(name);
+      if( d == null )
+         throw new NoSuchDeploymentException(name);
+      return d;
+   }
+
+   public void addBootstrap(DeploymentContext d)
+   {
+      // @todo addBootstrap
+      throw new org.jboss.util.NotImplementedException("addBootstrap");
+   }
+
+   public void addDeployer(DeploymentContext d)
+   {
+      // @todo addDeployer
+      throw new org.jboss.util.NotImplementedException("addDeployer");
+   }
+
+   public DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException
+   {
+      // @todo getBootstrap
+      throw new org.jboss.util.NotImplementedException("getBootstrap");
+   }
+
+   public Collection<DeploymentContext> getBootstraps()
+   {
+      // @todo getBootstraps
+      throw new org.jboss.util.NotImplementedException("getBootstraps");
+   }
+
+   public DeploymentContext getDeployer(String name) throws NoSuchDeploymentException
+   {
+      // @todo getDeployer
+      throw new org.jboss.util.NotImplementedException("getDeployer");
+   }
+
+   public Collection<DeploymentContext> getDeployers()
+   {
+      // @todo getDeployers
+      throw new org.jboss.util.NotImplementedException("getDeployers");
+   }
+
+   public void removeBootstrap(String name)
+   {
+      // @todo removeBootstrap
+      throw new org.jboss.util.NotImplementedException("removeBootstrap");
+   }
+
+   public void removeDeployer(String name)
+   {
+      // @todo removeDeployer
+      throw new org.jboss.util.NotImplementedException("removeDeployer");
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,317 @@
+package org.jboss.test.profileservice.simple1;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.spi.management.ManagedObject;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.DeploymentTemplate;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.PropertyInfo;
+import org.jboss.profileservice.spi.SimpleType;
+
+/**
+ * A test profile for deploying pretend Datasources
+ *
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class ProfileImpl2
+   implements Profile
+{
+   private HashMap<String, DeploymentContext> deployments;
+
+   public ProfileImpl2() throws IOException
+   {
+      deployments = new HashMap<String, DeploymentContext>();
+      String deployDir = SecurityActions.getSystemProperty("jbosstest.deploy.dir");
+      URL libURL;
+      if( deployDir == null )
+      {
+         // Used codesource + ../lib
+         URL classes = getClass().getProtectionDomain().getCodeSource().getLocation();
+         libURL = new URL(classes, "../lib-not-found/");
+      }
+      else
+      {
+         libURL = new URL(deployDir);
+      }
+
+      DeploymentImpl p0 = new DeploymentImpl();
+      p0.setName("DefaultDS");
+      p0.setRootURL(libURL);
+      String[] files = {"p0-not-here.jar"};
+      p0.setFiles(files);
+      /*
+      ArrayList<DeploymentBean> beans = new ArrayList<DeploymentBean>();
+
+      // DefaultDS datasource
+      // ignoring dependencies on TxMgr for right now
+      String defaultConnFacName = "name=DefaultDS,service=ManagedConnectionFactory";
+      DeploymentBeanImpl<BeanMetaData> defaultConnFac = new DeploymentBeanImpl<BeanMetaData>(defaultConnFacName,
+               "org.jboss.test.profileservice.profiles.p0.beans.RARDeployment");
+      AbstractBeanMetaData amd1 = new AbstractBeanMetaData(defaultConnFacName,
+         "org.jboss.test.profileservice.profiles.p0.beans.RARDeployment");
+      defaultConnFac.setBeanMetaData(amd1);
+      beans.add(defaultConnFac);
+
+      String defaultLocalTxCMName = "name=DefaultDS,service=LocalTxCM";
+      DeploymentBeanImpl<BeanMetaData> defaultLocalTxCM = new DeploymentBeanImpl<BeanMetaData>(defaultLocalTxCMName,
+              "org.jboss.test.profileservice.profiles.p0.beans.TxConnectionManager");
+      AbstractBeanMetaData amd2 = new AbstractBeanMetaData(defaultLocalTxCMName,
+         "org.jboss.test.profileservice.profiles.p0.beans.TxConnectionManager");
+      defaultLocalTxCM.setBeanMetaData(amd2);
+      beans.add(defaultLocalTxCM);
+
+      String defaultConnPoolName = "name=DefaultDS,service=ManagedConnectionPool";
+      DeploymentBeanImpl<BeanMetaData> defaultConnPool = new DeploymentBeanImpl<BeanMetaData>(defaultConnPoolName,
+              "org.jboss.test.profileservice.profiles.p0.beans.JBossManagedConnectionPool");
+      AbstractBeanMetaData amd3 = new AbstractBeanMetaData(defaultConnPoolName,
+         "org.jboss.test.profileservice.profiles.p0.beans.JBossManagedConnectionPool");
+      defaultConnPool.setBeanMetaData(amd3);
+      beans.add(defaultConnPool);
+
+      DeploymentBean[] tmp = new DeploymentBean[beans.size()];
+      p0.setBeans(beans.toArray(tmp));
+
+      // eventually this should get populated by examining the annotations on the beans described by the
+      // deploymentBeans above
+
+      // We will have to use something like ManagedPropertyRef in order to perform round trip operations,
+      // since the PropertyInfoImpl objects don't have any knowledge of the beans used to populate them
+      ManagedObject localDataSource = new ManagedObject();
+     // localDataSource.addPropertyRef(new PropertyInfoImpl("Connection Factory Property 1", "a property passed to the connection factory"));  // connectionFactoryProperty1
+     // localDataSource.addPropertyRef(new PropertyInfoImpl("Track Connection By Tx", "whether to track conns by txn or not"));   // trackConnectionByTx
+
+
+     // localDataSource.addPropertyRef(new PropertyInfoImpl("Blocking Timeout Millis", "how long to block for"));   // blockingTimeoutMillis
+      // how do we specify using PropertyInfo that this is a read-only field?
+     // localDataSource.addPropertyRef(new PropertyInfoImpl("Connection Created Count", "STAT: # of conn's created"));   // connectionCreatedCount
+
+      // how do we deal with wanting to have another ManagedObject representing the Pool separate from the one
+      // representing the DataSource, since there is a one-to-one mapping between ManagedObject's and Deployment's
+      p0.setManagedObject(localDataSource);
+
+      deployments.put(p0.getName(), p0);
+      */
+
+      DeploymentImpl p1 = new DeploymentImpl();
+      p1.setName("notxDS");
+      p1.setRootURL(libURL);
+      String[] files2 = {"p1-not-here.jar"};
+      p1.setFiles(files);
+/*
+      ArrayList<DeploymentBean> beans2 = new ArrayList<DeploymentBean>();
+      // NoTx datasource
+      // ignoring dependencies on TxMgr for right now
+      String notxConnFacName = "name=notxDS,service=ManagedConnectionFactory";
+      DeploymentBeanImpl<BeanMetaData> notxConnFac = new DeploymentBeanImpl<BeanMetaData>(notxConnFacName,
+         "org.jboss.test.profileservice.profiles.p0.beans.RARDeployment");
+      AbstractBeanMetaData amd4 = new AbstractBeanMetaData(notxConnFacName,
+         "org.jboss.test.profileservice.profiles.p0.beans.RARDeployment");
+      notxConnFac.setBeanMetaData(amd4);
+      beans2.add(notxConnFac);
+
+      // specify the correct ConnMgr for this DataSource
+      String notxNoTxCMName = "name=notxDS,service=NoTxCM";
+      DeploymentBeanImpl<BeanMetaData> notxNoTxCM = new DeploymentBeanImpl<BeanMetaData>(notxNoTxCMName,
+         "org.jboss.test.profileservice.profiles.p0.beans.NoTxConnectionManager");
+      AbstractBeanMetaData amd41 = new AbstractBeanMetaData(notxNoTxCMName,
+         "org.jboss.test.profileservice.profiles.p0.beans.NoTxConnectionManager");
+      notxNoTxCM.setBeanMetaData(amd41);
+      beans2.add(notxNoTxCM);
+
+      String notxConnPoolName = "name=notxDS,service=ManagedConnectionPool";
+      DeploymentBeanImpl<BeanMetaData> notxConnPool = new DeploymentBeanImpl<BeanMetaData>(notxConnPoolName,
+         "org.jboss.test.profileservice.profiles.p0.beans.JBossManagedConnectionPool");
+      AbstractBeanMetaData amd5 = new AbstractBeanMetaData(notxConnPoolName,
+         "org.jboss.test.profileservice.profiles.p0.beans.JBossManagedConnectionPool");
+      notxConnPool.setBeanMetaData(amd5);
+      beans2.add(notxConnPool);
+
+      DeploymentBean[] tmp2 = new DeploymentBean[beans2.size()];
+      p1.setBeans(beans2.toArray(tmp2));
+*/
+      ManagedObject notxDataSource = new ManagedObject();
+      PropertyInfo jndiNameProperty = new PropertyInfoImpl("jndiName", SimpleType.STRING);
+      jndiNameProperty.setFields(new String[] {
+        //"defaultValue",
+        //"descriptionResourceBundleBaseName",
+        //"descriptionResourceKey",
+        //"legalValues",
+        //"maxValue",
+        //"metricValue",
+        //"minValue",
+        //"openType",
+        //"units",
+        "org.jboss.profileservice.description",
+        "org.jboss.profileservice.label",
+        //"org.jboss.profileservice.labelResourceBundleBaseName",
+        //"org.jboss.profileservice.labelResourceKey",
+        "org.jboss.profileservice.requiredNotEmpty",
+        "org.jboss.profileservice.typicalLength"
+        },
+        new Object[] {
+        //"defaultValue",
+        //"descriptionResourceBundleBaseName",
+        //"descriptionResourceKey",
+        //"legalValues",
+        //"maxValue",
+        //"metricValue",
+        //"minValue",
+        //"openType",
+        //"units",
+        "The name the Datasource will be registered under in JNDI",
+        "JNDI Name",
+        //"org.jboss.profileservice.labelResourceBundleBaseName",
+        //"org.jboss.profileservice.labelResourceKey",
+        Boolean.TRUE,
+        new Integer (30)
+        });
+
+      notxDataSource.addPropertyRef(jndiNameProperty);
+
+      PropertyInfo useJavaContextProperty = new PropertyInfoImpl("useJavaContext", SimpleType.BOOLEAN);
+      useJavaContextProperty.setFields(new String[] {
+        "defaultValue",
+        //"descriptionResourceBundleBaseName",
+        //"descriptionResourceKey",
+        //"legalValues",
+        //"maxValue",
+        //"metricValue",
+        //"minValue",
+        //"openType",
+        //"units",
+        "org.jboss.profileservice.description",
+        "org.jboss.profileservice.label",
+        //"org.jboss.profileservice.labelResourceBundleBaseName",
+        //"org.jboss.profileservice.labelResourceKey",
+        "org.jboss.profileservice.requiredNotEmpty",
+        //"org.jboss.profileservice.typicalLength"
+        },
+        new Object[] {
+        Boolean.TRUE,
+        //"descriptionResourceBundleBaseName",
+        //"descriptionResourceKey",
+        //"legalValues",
+        //"maxValue",
+        //"metricValue",
+        //"minValue",
+        //"openType",
+        //"units",
+        "Whether the Datasource should be registered under java: in JNDI",
+        "Use java: context",
+        //"org.jboss.profileservice.labelResourceBundleBaseName",
+        //"org.jboss.profileservice.labelResourceKey",
+        Boolean.TRUE,
+        //"org.jboss.profileservice.typicalLength"
+        });
+      notxDataSource.addPropertyRef(useJavaContextProperty);
+
+
+      //notxDataSource.addPropertyRef(new PropertyInfoImpl("Connection Factory Property 1", "a property passed to the connection factory"));  // connectionFactoryProperty1
+      // pick a property which is actually on the NoTxConnectionManager bean
+      //notxDataSource.addPropertyRef(new PropertyInfoImpl("Security Domain Jndi Name", "security domain"));   // securityDomainJndiName
+      //notxDataSource.addPropertyRef(new PropertyInfoImpl("Blocking Timeout Millis", "how long to block for"));   // blockingTimeoutMillis
+      //notxDataSource.addPropertyRef(new PropertyInfoImpl("Connection Created Count", "STAT: # of conn's created"));   // connectionCreatedCount
+
+      // how can we differentiate between the ManagedObject create above, for a LocalTxDataSource,
+      // and the one in use now, for a NoTxDataSource?
+      /* TODO
+      p1.setManagedObject(notxDataSource);
+      deployments.put(p1.getName(), p1);
+      */
+   }
+
+   public String getVersion()
+   {
+      return "1.0.0";
+   }
+
+   public DeploymentTemplate getTemplate(String name)
+   {
+      return null;
+   }
+
+   public void addDeployment(DeploymentContext d)
+   {
+      throw new UnsupportedOperationException("simple1 is read-only");
+   }
+
+   public void removeDeployment(String name)
+   {
+      throw new UnsupportedOperationException("simple1 is read-only");
+   }
+
+   public Collection<DeploymentContext> getDeployments()
+   {
+      return Collections.unmodifiableCollection(deployments.values());
+   }
+
+   public Map<String, Object> getConfig()
+   {
+      return null;
+   }
+
+   public DeploymentContext getDeployment(String name)
+      throws NoSuchDeploymentException
+   {
+      DeploymentContext d = deployments.get(name);
+      if( d == null )
+         throw new NoSuchDeploymentException(name);
+      return d;
+   }
+
+   public void addBootstrap(DeploymentContext d)
+   {
+      // @todo addBootstrap
+      throw new org.jboss.util.NotImplementedException("addBootstrap");
+   }
+
+   public void addDeployer(DeploymentContext d)
+   {
+      // @todo addDeployer
+      throw new org.jboss.util.NotImplementedException("addDeployer");
+   }
+
+   public DeploymentContext getBootstrap(String name) throws NoSuchDeploymentException
+   {
+      // @todo getBootstrap
+      throw new org.jboss.util.NotImplementedException("getBootstrap");
+   }
+
+   public Collection<DeploymentContext> getBootstraps()
+   {
+      // @todo getBootstraps
+      throw new org.jboss.util.NotImplementedException("getBootstraps");
+   }
+
+   public DeploymentContext getDeployer(String name) throws NoSuchDeploymentException
+   {
+      // @todo getDeployer
+      throw new org.jboss.util.NotImplementedException("getDeployer");
+   }
+
+   public Collection<DeploymentContext> getDeployers()
+   {
+      // @todo getDeployers
+      throw new org.jboss.util.NotImplementedException("getDeployers");
+   }
+
+   public void removeBootstrap(String name)
+   {
+      // @todo removeBootstrap
+      throw new org.jboss.util.NotImplementedException("removeBootstrap");
+   }
+
+   public void removeDeployer(String name)
+   {
+      // @todo removeDeployer
+      throw new org.jboss.util.NotImplementedException("removeDeployer");
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.profileservice.simple1;
+
+import java.io.IOException;
+
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.deployers.spi.management.ManagementView;
+
+/**
+ * A simple read-only profile service for testing the basic kernel bootstrap
+ * and management view usecases.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ProfileServiceImpl
+   implements ProfileService
+{
+   protected Profile defatulImpl;
+   private ManagementViewImpl mgtView;
+
+   public ProfileServiceImpl() throws IOException
+   {
+      defatulImpl = new ProfileImpl();
+   }
+   public String[] getDomains()
+   {
+      String[] domains = {ProfileKey.DEFAULT};
+      return domains;
+   }
+
+   public ProfileKey[] getProfileKeys()
+   {
+      ProfileKey[] keys = {new ProfileKey(null)};
+      return keys;
+   }
+
+   /**
+    * Always returns the default profile.
+    */
+   public Profile getProfile(ProfileKey key)
+      throws NoSuchProfileException
+   {
+      return defatulImpl;
+   }
+
+   public String[] getProfileDeploymentNames(ProfileKey key)
+      throws NoSuchProfileException
+   {
+      String[] names = {"default"};
+      return names;
+   }
+
+   public ManagementView getViewManager()
+   {
+      return mgtView;
+   }
+
+   // Admin of profiles @todo could be an option plugin
+   public Profile newProfile(ProfileKey key)
+   {
+      return null;
+   }
+
+   public void removeProfile(ProfileKey key)
+      throws NoSuchProfileException
+   {
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl2.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl2.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/ProfileServiceImpl2.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,20 @@
+package org.jboss.test.profileservice.simple1;
+
+import java.io.IOException;
+
+/**
+ * A simple read-only profile service for testing the basic kernel bootstrap
+ * and management view usecases.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ProfileServiceImpl2
+   extends ProfileServiceImpl
+{
+   public ProfileServiceImpl2() throws IOException
+   {
+      defatulImpl = new ProfileImpl2();
+   }
+
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/PropertyInfoImpl.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/PropertyInfoImpl.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/PropertyInfoImpl.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,86 @@
+package org.jboss.test.profileservice.simple1;
+
+import org.jboss.profileservice.spi.PropertyInfo;
+import org.jboss.profileservice.spi.OpenType;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author ccrouch at jboss.org
+ * @version $Revision$
+ */
+public class PropertyInfoImpl implements PropertyInfo {
+
+    private String name;
+    private Object value;
+    private Map fields;
+
+
+    public PropertyInfoImpl(String name, OpenType type) {
+        fields = new HashMap();
+        this.name = name;
+        fields.put("openType", type);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getDescription() {
+        return (String) fields.get("org.jboss.profileservice.description");
+    }
+
+    public Set<?> getLegalValues() {
+         return (Set<?>) fields.get("legalValues");
+    }
+
+    public Comparable<?> getMinValue() {
+        return null;
+    }
+
+    public Comparable<?> getMaxValue() {
+        return null;
+    }
+
+    public boolean isValue(Object obj) {
+        return false;
+    }
+
+    public OpenType<?> getOpenType() {
+        return (OpenType<?>) fields.get("openType");
+    }
+
+   public Object getFieldValue(String fieldName)
+   {
+      return fields.get(fieldName);
+   }
+
+   public void setFields(String[] fieldNames, Object[] fieldValues)
+   {
+      if (fieldNames == null || fieldValues == null)
+      {
+         throw new IllegalArgumentException("Neither fieldNames array nor fieldValues array can be null");
+      }
+
+      if (fieldNames.length != fieldValues.length)
+      {
+         throw new IllegalArgumentException("size of fieldNames array must match size of fieldValues array");
+      }
+
+      for (int i=0; i<fieldNames.length; i++)
+      {
+         fields.put(fieldNames[i], fieldValues[i]);
+      }
+   }
+
+
+   public Object getValue() {
+       return value;
+   }
+
+    public void setValue(Object value) {
+        this.value = value;
+    }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/simple1/SecurityActions.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/simple1/SecurityActions.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/simple1/SecurityActions.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.simple1;
+
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+
+/**
+ * Package privileged actions.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+class SecurityActions
+{
+   static String getSystemProperty(final String name)
+   {
+      PrivilegedAction<String> action = new PrivilegedAction<String>()
+      {
+         public String run()
+         {
+            return System.getProperty(name);
+         }
+      };
+      return AccessController.doPrivileged(action);
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.support;
+
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+
+/**
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ProfileServiceBootstrap extends BasicBootstrap
+{
+   private String profileName;
+
+   public ProfileServiceBootstrap()
+   {
+      this("default");
+   }
+   public ProfileServiceBootstrap(String name)
+   {
+      this.profileName = name;
+   }
+
+   protected void bootstrap() throws Throwable
+   {
+      // Bootstrap the core kernel
+      super.bootstrap();
+      // Load the profile beans
+      loadProfile(profileName);
+   }
+
+   /**
+    * Load the beans associated with the named profile. Should be overriden
+    * to do something meaningful.
+    * @param name
+    * @throws Throwable
+    */
+   protected void loadProfile(String name) throws Throwable
+   {
+      
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceKernelConfig.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceKernelConfig.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/support/ProfileServiceKernelConfig.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,32 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software 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
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+package org.jboss.test.profileservice.support;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+
+public class ProfileServiceKernelConfig
+{
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/support/SecurityActions.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/support/SecurityActions.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/support/SecurityActions.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.support;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+
+/**
+ * Package priviledged actions
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+class SecurityActions
+{
+   interface ClassLoaderActions
+   {
+      ClassLoaderActions PRIVILEGED = new ClassLoaderActions()
+      {
+         public URLClassLoader newClassLoader(final URL[] urls)
+         {
+            PrivilegedAction action = new PrivilegedAction()
+            {
+               public Object run()
+               {
+                  return new URLClassLoader(urls);
+               }
+            };
+            return (URLClassLoader) AccessController.doPrivileged(action);
+         }
+      };
+
+      ClassLoaderActions NON_PRIVILEGED = new ClassLoaderActions()
+      {
+         public URLClassLoader newClassLoader(URL[] urls)
+         {
+            return new URLClassLoader(urls);
+         }
+      };
+
+      URLClassLoader newClassLoader(URL[] urls);
+   }
+
+   static URLClassLoader newClassLoader(URL[] urls)
+   {
+      if(System.getSecurityManager() == null)
+      {
+         return ClassLoaderActions.NON_PRIVILEGED.newClassLoader(urls);
+      }
+      else
+      {
+         return ClassLoaderActions.PRIVILEGED.newClassLoader(urls);
+      }
+   }
+
+   static String getSystemProperty(final String name)
+   {
+      PrivilegedAction action = new PrivilegedAction()
+      {
+         public Object run()
+         {
+            return System.getProperty(name);
+         }
+      };
+      return (String) AccessController.doPrivileged(action);
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.support;
+
+import java.io.IOException;
+
+import org.jboss.kernel.plugins.deployment.BasicKernelDeployer;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.test.profileservice.simple1.ProfileServiceImpl;
+
+public class Simple1PSBootstrap extends ProfileServiceBootstrap
+{
+   private BasicKernelDeployer deployer;
+   protected ProfileService profileService;
+
+   public Simple1PSBootstrap() throws IOException
+   {
+      this("default");
+   }
+
+   public Simple1PSBootstrap(String name) throws IOException
+   {
+      super(name);
+      profileService = new ProfileServiceImpl();
+   }
+
+
+   public ProfileService getProfileService()
+   {
+      return profileService;
+   }
+
+   /**
+    * Get the named profile from the profile service
+    * TODO: who owns the VFS configuration
+    */
+   protected void loadProfile(String name) throws Throwable
+   {
+      deployer = new BasicKernelDeployer(super.getKernel());
+
+      // Load the named profile
+      ProfileKey key = new ProfileKey(name);
+      Profile profile = profileService.getProfile(key);
+      /* TODO 
+      Deployment[] profileDeployments = profile.getDeployments();
+      for(Deployment d : profileDeployments)
+      {
+         log.debug("Deploying: "+d);
+         AbstractKernelDeployment kernelDeployment = new AbstractKernelDeployment();
+         kernelDeployment.setName(d.getName());
+
+         // Setup the class loader from the deployment root URL/files
+         URL rootURL = d.getRootURL();
+         VFSFactory factory = VFSFactoryLocator.getFactory(rootURL);
+         ReadOnlyVFS vfs = factory.getVFS(rootURL);
+         String[] searchCtxts = d.getFiles();
+         VFSClassLoader cl = new VFSClassLoader(searchCtxts, vfs);
+         AbstractClassLoaderMetaData clMD = new AbstractClassLoaderMetaData();
+         AbstractValueMetaData value = new AbstractValueMetaData(cl);
+         clMD.setClassLoader(value);
+         */
+         /*
+         DeploymentBean<BeanMetaData>[] beans = d.getBeans();
+         ArrayList<BeanMetaData> beanFactories = new ArrayList<BeanMetaData>();
+         for(DeploymentBean<BeanMetaData> db: beans)
+         {
+            log.debug("Adding bean: "+db);
+            String beanName = db.getName();
+            BeanMetaData kbean = db.getBeanMetaData();
+            // TODO: what other metdata settings need to be set at this level?
+            kbean.setClassLoader(clMD);
+            beanFactories.add(kbean);
+         }
+         kernelDeployment.setBeans(beanFactories); // TODO ????
+         */
+
+      /* TODO
+         deployer.deploy(kernelDeployment);
+      }
+      */
+
+   }
+
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/support/Simple2PSBootstrap.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/support/Simple2PSBootstrap.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/support/Simple2PSBootstrap.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,15 @@
+package org.jboss.test.profileservice.support;
+
+import org.jboss.test.profileservice.simple1.ProfileServiceImpl2;
+
+import java.io.IOException;
+
+public class Simple2PSBootstrap extends Simple1PSBootstrap
+{
+   public Simple2PSBootstrap(String name) throws IOException
+   {
+      super(name);
+      profileService = new ProfileServiceImpl2();
+   }
+
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/test/DataSourceTestCase.properties
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/test/DataSourceTestCase.properties	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/test/DataSourceTestCase.properties	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1 @@
+test.Permission.0=java.util.PropertyPermission, jbosstest.deploy.dir, read
\ No newline at end of file

Added: trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.profileservice.test;
+
+import java.util.Set;
+
+import org.jboss.test.BaseTestCase;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+
+/**
+ * Test of bootstrapping the kernel using a profile service
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class SimplePSTestCase extends BaseTestCase
+{
+   public SimplePSTestCase(String name)
+   {
+      super(name);
+   }
+
+   protected Kernel bootstrap() throws Throwable
+   {
+      /*
+      Simple1PSBootstrap bootstrap = new Simple1PSBootstrap(getName());
+      bootstrap.run();
+      //configureLoggingAfterBootstrap();
+      return bootstrap.getKernel();
+      */
+      return null;
+   }
+
+   public void testP0() throws Throwable
+   {
+      Kernel kernel = bootstrap();
+      KernelRegistry registry = kernel.getRegistry();
+      KernelRegistryEntry ns = registry.getEntry("TheNamingService");
+      assertNotNull("TheNamingService", ns);
+      DependencyInfo di = ns.getDependencyInfo();
+      Set dependsOnMe = di.getDependsOnMe(null);
+      assertEquals("NS:DependsOnMe.size == 2", 2, dependsOnMe.size());
+
+      KernelRegistryEntry txMgr = registry.getEntry("TheTxMgr");
+      assertNotNull("TheTxMgr", txMgr);
+      di = txMgr.getDependencyInfo();
+      dependsOnMe = di.getDependsOnMe(null);
+      assertEquals("TX:DependsOnMe.size == 1", 1, dependsOnMe.size());
+
+      KernelRegistryEntry jcaMgr = registry.getEntry("TheJCAMgr");
+      assertNotNull("TheJCAMgr", jcaMgr);
+   }
+   public void testP1() throws Throwable
+   {
+   }
+}

Added: trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.properties
===================================================================
--- trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.properties	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/profileservice/test/SimplePSTestCase.properties	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1 @@
+test.Permission.0=java.util.PropertyPermission, jbosstest.deploy.dir, read
\ No newline at end of file

Added: trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.server.profileservice;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
+import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.system.server.profileservice.ProfileServiceBootstrap;
+import org.jboss.test.BaseTestCase;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.Main;
+
+/**
+ * Test of the jboss main loading a configuration via the ProfileService.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class MainTestCase extends BaseTestCase
+{
+   public MainTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Public --------------------------------------------------------
+
+   /**
+    * Test creation of a default profile
+    * @throws Exception
+    */
+   public void testCreateDefaultProfile() throws Throwable
+   {
+      // Set the jboss.server.home.url property to the system/src/resources dir
+      URL bootstrapDir = super.getResource("/bootstrap");
+      log.info("bootstrapDir: "+bootstrapDir);
+      URL resourcesDir = new URL(bootstrapDir, "..");
+      log.info("resourcesDir: "+resourcesDir);
+      System.setProperty("jboss.server.home.url", resourcesDir.toString());
+
+      // 
+      ProfileServiceBootstrap psb = new ProfileServiceBootstrap();
+      psb.setDeployerBeansPrefix("bootstrap/default/");
+      psb.bootstrap();
+      ProfileService ps = psb.getProfileService();
+      ProfileKey defaultKey = new ProfileKey("default");
+      Profile profile = ps.getProfile(defaultKey);
+      DeploymentContext testBeans = profile.getDeployment("test-beans.xml");
+      if( testBeans == null )
+      {
+         if( profile == null )
+            profile = ps.newProfile(defaultKey);
+         MainDeployer deployer = psb.getMainDeployer();
+         VFS vfs = VFS.getVFS(resourcesDir);
+         VirtualFile file = vfs.findChildFromRoot("deploy/beans/test-beans.xml");
+         testBeans = new AbstractDeploymentContext(file);
+         deployer.addDeploymentContext(testBeans);
+         profile.addDeployment(testBeans);
+      }
+      // Validate the deployment
+      testBeans = profile.getDeployment("test-beans.xml");
+      assertNotNull(testBeans);
+      // TODO String type = testBeans.getType();
+      // assertEquals("Deployment type is beans", "beans", type);
+   }
+
+   /**
+    * Test the startup of the org.jboss.Main entry point using the "default"
+    * profile.
+    * @throws Exception
+    */
+   public void testDefaultStartup() throws Exception
+   {
+      // Set the jboss.server.home.url property to the system/src/resources dir
+      URL bootstrapDir = super.getResource("/bootstrap");
+      log.info("bootstrapDir: "+bootstrapDir);
+      URL resourcesDir = new URL(bootstrapDir, "..");
+      log.info("resourcesDir: "+resourcesDir);
+      System.setProperty("jboss.server.home.url", resourcesDir.toString());
+      // Set the jbosstest.support.dir to output/tests-support
+      File supportDir = new File("output/tests-support");
+      System.setProperty("jbosstest.support.dir", supportDir.toString());
+      // Correct the location of the deployer-beans.xml location
+      System.setProperty("jboss.server.deployerBeansPrefix", "bootstrap/default/");
+
+      ArrayList<String> args = new ArrayList<String>();
+      String[] tmp = {};
+      Main main = new Main();
+      main.boot(args.toArray(tmp));
+   }
+
+}

Added: trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2006-09-30 23:05:52 UTC (rev 57313)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2006-10-01 02:44:33 UTC (rev 57314)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.server.profileservice;
+
+import java.io.File;
+import java.security.CodeSource;
+
+import org.jboss.Main;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.system.server.Server;
+import org.jboss.system.server.profileservice.ServerImpl;
+import org.jboss.test.BaseTestCase;
+
+/**
+ * Test of the jboss main loading a bootstrap configuration via the ProfileService
+ * and additional service via a simple hot deployment service.
+ * 
+ * @see 
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 56797 $
+ */
+public class MainWithSimpleHotDeployTestCase extends BaseTestCase
+{
+   public MainWithSimpleHotDeployTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Public --------------------------------------------------------
+
+   /* (non-Javadoc)
+    * @see org.jboss.test.AbstractTestCase#configureLogging()
+    */
+   @Override
+   protected void configureLogging()
+   {
+      //enableTrace("org.jboss.kernel");
+   }
+
+   /**
+    * Test the startup of the org.jboss.Main entry point using the "default"
+    * profile and bootstrap deployer-beans.xml search logic.
+    * @throws Exception
+    */
+   public void testDefaultStartup() throws Exception
+   {
+      String deployPrefix = "";
+      // If jbosstest.deploy.dir is not defined fail
+      String deployDirEnv = System.getenv("jbosstest.deploy.dir");
+      String deployDirProp = System.getProperty("jbosstest.deploy.dir");
+      if( deployDirProp == null && deployDirEnv != null )
+      {
+         System.setProperty("jbosstest.deploy.dir", deployDirEnv);
+         deployDirProp = deployDirEnv;
+      }
+      String supportDirEnv = System.getenv("jbosstest.support.dir");
+      String supportDirProp = System.getProperty("jbosstest.support.dir");
+      if( supportDirProp == null && supportDirEnv != null )
+      {
+         System.setProperty("jbosstest.support.dir", supportDirEnv);
+         supportDirProp = supportDirEnv;
+      }
+
+      if( supportDirProp == null )
+      {
+         // If these have not been set, assume running inside eclipse from the system folder 
+         File resourcesDir = new File("output/eclipse-resources");
+         File classesDir = new File("output/eclipse-test-classes");
+         deployDirProp = resourcesDir.toURL().toExternalForm();
+         supportDirProp = classesDir.toURL().toExternalForm();
+         System.setProperty("jbosstest.deploy.dir", deployDirProp);
+         System.setProperty("jbosstest.support.dir", supportDirProp);
+         deployPrefix = "tests/bootstrap/defaulthotdeploy/";
+      }
+      assertNotNull("jbosstest.support.dir != null", supportDirProp);
+      assertNotNull("jbosstest.deploy.dir != null", deployDirProp);
+      // Set the deploy prefix 
+      
+
+      String[] args = {"-c", "defaulthotdeploy", "-Djboss.server.deployerBeansPrefix="+deployPrefix};
+      Main main = new Main();
+      main.boot(args);
+      Server server = main.getServer();
+      assertTrue("Server", server instanceof ServerImpl);
+      ServerImpl serverImpl = (ServerImpl) server;
+
+      // Validate that the expected deployment beans exist
+      Kernel kernel = serverImpl.getKernel();
+      assertInstalled(kernel, "ProfileService");
+      assertInstalled(kernel, "MainDeployer");
+      assertInstalled(kernel, "BeanDeployer");
+      assertInstalled(kernel, "VFSDeploymentScanner");
+      KernelRegistry registry = kernel.getRegistry();
+      KernelRegistryEntry entry = registry.getEntry("VFSDeploymentScanner");
+      /** TODO DeploymentScanner scanner = (DeploymentScanner) entry.getTarget();
+      synchronized( scanner )
+      {
+         while( scanner.getScanCount() <= 0 )
+            scanner.wait(10000);
+      }
+      log.info("Notified of scan: "+scanner.getScanCount());
+      */
+
+      // Expected hot deployments
+      assertInstalled(kernel, "VFSClassLoader");
+      assertInstalled(kernel, "TestBean");
+      assertInstalled(kernel, "VFSClassLoader-unpacked");
+      assertInstalled(kernel, "TestBean-unpacked");
+      entry = registry.getEntry("TestBean");
+      Object testBean = entry.getTarget();
+      CodeSource testBeanCS = testBean.getClass().getProtectionDomain().getCodeSource();
+      log.info("TestBean.CS: "+testBeanCS);
+      log.info("TestBean.ClassLoader: "+testBean.getClass().getClassLoader());
+      
+
+      // Shutdown
+      main.shutdown();
+   }
+
+   private void assertInstalled(Kernel kernel, String name)
+   {
+      KernelRegistry registry = kernel.getRegistry();
+      KernelRegistryEntry entry = registry.getEntry(name);
+      assertEquals(name+" Installed", ControllerState.INSTALLED, entry.getState());      
+   }
+}




More information about the jboss-cvs-commits mailing list