[jboss-cvs] JBossAS SVN: r101111 - in projects/profileservice/trunk/core/src/test: java/org/jboss/test/profileservice/resolver/dependency/support and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 18 08:49:47 EST 2010


Author: emuckenhuber
Date: 2010-02-18 08:49:47 -0500 (Thu, 18 Feb 2010)
New Revision: 101111

Added:
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralCapbility.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralRequirement.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/Property.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/ServiceRequirement.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestGroup.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfile.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/test/UserRequirementUnitTestCase.java
   projects/profileservice/trunk/core/src/test/resources/org/jboss/test/profileservice/resolver/test/capabilities.xml
Modified:
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfilesMetaData.java
Log:
additional requirement test.

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralCapbility.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralCapbility.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralCapbility.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.dependency.support;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.profileservice.spi.dependency.ProfileCapability;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(propOrder = {"name", "properties"})
+public class GeneralCapbility implements ProfileCapability
+{
+
+   private String name;
+   private Set<Property> properties;
+
+   @XmlAttribute(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlElement(name="property")
+   public Set<Property> getProperties()
+   {
+      return properties;
+   }
+   public void setProperties(Set<Property> xmlProps)
+   {
+      this.properties = xmlProps;
+   }
+   
+   public boolean resolves(ProfileRequirement r)
+   {
+      if(r != null && r instanceof GeneralRequirement)
+      {
+         GeneralRequirement requirement = GeneralRequirement.class.cast(r);
+         if(name.equals(requirement.getName()))
+         {
+            boolean resolved = true;
+            for(Property property : requirement.getProperties())
+            {
+               if(resolveProperty(property) == false)
+               {
+                  resolved = false;
+               }
+            }
+            if(resolved)
+            {
+               return true;
+            }
+         }
+      }
+      return false;
+   }
+
+   protected boolean resolveProperty(Property property)
+   {
+      boolean resolved = false;
+      for(Property myProperty : getProperties())
+      {
+         if(myProperty.getKey().equals(property.getKey())
+               && myProperty.getValue().equals(property.getValue()))
+         {
+            resolved = true;
+         }
+      }
+      return resolved;
+   }
+   
+   
+}
+

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralRequirement.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralRequirement.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/GeneralRequirement.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.dependency.support;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.profileservice.spi.dependency.DependencyMode;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(propOrder = {"name", "properties"})
+public class GeneralRequirement implements ProfileRequirement
+{
+
+   /** The requirement name. */
+   private String name;
+   
+   private List<Property> properties;
+   
+   @XmlAttribute
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @XmlElement(name = "property")
+   public List<Property> getProperties()
+   {
+      return properties;
+   }
+   
+   public void setProperties(List<Property> properties)
+   {
+      this.properties = properties;
+   }
+   
+   public DependencyMode getDependencyMode()
+   {
+      return DependencyMode.RESOLVE;
+   }
+
+   public boolean isConsistent(ProfileRequirement other)
+   {
+      if(other == this)
+         return true;
+      if(other != null && other instanceof GeneralRequirement)
+      {
+         GeneralRequirement requirement = GeneralRequirement.class.cast(other);
+         if(name.equals(requirement.name))
+         {
+            for(Property myProperty : properties)
+            {
+               for(Property otherProperty : requirement.properties)
+               {
+                  if(myProperty.getKey().equals(otherProperty.getKey()))
+                  {
+                     if(myProperty.getValue().equals(otherProperty.getValue()) == false)
+                     {
+                        // inconsistent
+                        return false;
+                     }
+                  }
+               }
+            }
+         }
+      }
+      return true;
+   }
+
+   public boolean isOptional()
+   {
+      return false;
+   }
+
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer(getClass().getSimpleName());
+      buffer.append("{name=").append(name);
+      buffer.append(", properties=").append(properties).append("}");
+      return buffer.toString();
+   }
+   
+   
+}
+

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/Property.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/Property.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/Property.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.dependency.support;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class Property
+{
+   private String key;
+   private String value;
+
+   public Property()
+   {
+      
+   }
+   
+   public Property(String key, String value)
+   {
+      this.key = key;
+      this.value = value;
+   }
+   
+   @XmlAttribute(name = "key")
+   public String getKey()
+   {
+      return key;
+   }
+   public void setKey(String key)
+   {
+      this.key = key;
+   }
+   @XmlAttribute(name = "value")
+   public String getValue()
+   {
+      return value;
+   }
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+   
+   @Override
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer();
+      buffer.append("{").append(key).append("=").append(value).append("}");
+      return buffer.toString();
+   }
+   
+}
+

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/ServiceRequirement.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/ServiceRequirement.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/dependency/support/ServiceRequirement.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.dependency.support;
+
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ServiceRequirement extends GeneralRequirement
+{
+   
+   public ServiceRequirement(String name)
+   {
+      setName("service");
+      setProperties(Collections.singletonList(new Property("name", name)));
+   }
+
+}
+

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestGroup.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestGroup.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestGroup.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.support;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.profileservice.profile.metadata.plugin.EmptyProfileMetaData.DependencyModeRequirement;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+import org.jboss.test.profileservice.resolver.dependency.support.GeneralRequirement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "test", propOrder = {"name", "capabilities", "requirements"})
+public class TestGroup extends TestProfile
+{
+
+   @XmlElements({
+      @XmlElement(name = "requirement", type = GeneralRequirement.class),
+      @XmlElement(name = "requires", type = DependencyModeRequirement.class)
+   })
+   public List<ProfileRequirement> getRequirements()
+   {
+      return super.getRequirements();
+   }
+   
+}
+

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfile.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfile.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfile.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,129 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.support;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.profileservice.metadata.helpers.AbstractProfileMetaData;
+import org.jboss.profileservice.spi.dependency.ProfileCapability;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+import org.jboss.profileservice.spi.metadata.ProfileDeploymentMetaData;
+import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitor;
+import org.jboss.profileservice.spi.metadata.ProfileSourceMetaData;
+import org.jboss.test.profileservice.resolver.dependency.support.GeneralCapbility;
+import org.jboss.test.profileservice.resolver.dependency.support.GeneralRequirement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlType(name = "test", propOrder = {"name", "capabilities", "requirements"})
+public class TestProfile extends AbstractProfileMetaData
+{
+
+   private List<ProfileRequirement> requirements;
+   private List<ProfileCapability> capabilities;
+   
+   
+   @XmlAttribute
+   public String getName()
+   {
+      return super.getName();
+   }
+   
+   public List<? extends ProfileDeploymentMetaData> getDeployments()
+   {
+      return null;
+   }
+
+   public ProfileSourceMetaData getSource()
+   {
+      return null;
+   }
+
+   /**
+    * Get the requirements.
+    * 
+    * @return the requirements.
+    */
+   @XmlElement(name = "requirement", type = GeneralRequirement.class)
+   public List<ProfileRequirement> getRequirements()
+   {
+      return requirements;
+   }
+
+   /**
+    * Set the requirements.
+    * 
+    * @param requirements The requirements to set.
+    */
+   public void setRequirements(List<ProfileRequirement> requirements)
+   {
+      this.requirements = requirements;
+   }
+
+   /**
+    * Get the capabilities.
+    * 
+    * @return the capabilities.
+    */
+   @XmlElement(name = "capability", type = GeneralCapbility.class)
+   public List<ProfileCapability> getCapabilities()
+   {
+      return capabilities;
+   }
+
+   /**
+    * Set the capabilities.
+    * 
+    * @param capabilities The capabilities to set.
+    */
+   public void setCapabilities(List<ProfileCapability> capabilities)
+   {
+      this.capabilities = capabilities;
+   }
+
+   public void visit(ProfileMetaDataVisitor visitor)
+   {
+      super.visit(visitor);
+      if(requirements != null && requirements.isEmpty() == false)
+      {
+         for(ProfileRequirement requirement : requirements)
+         {
+            visitor.addRequirement(requirement);
+         }         
+      }
+      if(capabilities != null && capabilities.isEmpty() == false)
+      {
+         for(ProfileCapability capability : capabilities)
+         {
+            visitor.addCapability(capability);
+         }
+      }
+   }
+   
+}
+

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfilesMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfilesMetaData.java	2010-02-18 13:47:17 UTC (rev 101110)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/support/TestProfilesMetaData.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
 import javax.xml.bind.annotation.XmlNsForm;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
@@ -48,7 +49,11 @@
 
    private List<ProfileMetaData> profiles;
    
-   @XmlElement(name = "profile", type = EmptyProfileMetaData.class)
+   @XmlElements({
+      @XmlElement(name = "profile", type = EmptyProfileMetaData.class),
+      @XmlElement(name = "test", type = TestProfile.class),
+      @XmlElement(name = "test-group", type = TestGroup.class)
+   })
    public List<ProfileMetaData> getProfiles()
    {
       return profiles;

Added: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/test/UserRequirementUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/test/UserRequirementUnitTestCase.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/resolver/test/UserRequirementUnitTestCase.java	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver.test;
+
+import java.util.List;
+
+import org.jboss.profileservice.dependency.ProfileDependencyContext;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+import org.jboss.test.profileservice.resolver.dependency.support.ServiceRequirement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserRequirementUnitTestCase extends AbstractResolverTest
+{
+
+   public UserRequirementUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   
+   public void testOne() throws Exception
+   {
+      List<String> resolved = resolveServices("capabilities.xml", "jboss-webservices", "ejb3");
+      assertTrue(resolved.contains("ejb3-webservices"));
+      assertTrue(resolved.contains("jboss-webservices"));
+   }
+   
+   public void testTwo() throws Exception
+   {
+      List<String> resolved = resolveServices("capabilities.xml", "apache-webservices", "ejb3");
+      assertTrue(resolved.contains("ejb3-webservices"));
+      assertTrue(resolved.contains("apache-webservices"));
+   }
+   
+   protected List<String> resolveServices(String file, String... services) throws Exception
+   {
+      parse(file);
+      ProfileMetaData testProfile = createTestProfileMetaData();
+      ProfileDependencyContext context = new ProfileDependencyContext(new ProfileKey(testProfile.getName()), testProfile, getRegistry());
+      for(String service : services)
+      {
+         context.addRequirement(new ServiceRequirement(service));
+      }
+      return resolveRequirements(context);
+   }
+   
+}
+

Added: projects/profileservice/trunk/core/src/test/resources/org/jboss/test/profileservice/resolver/test/capabilities.xml
===================================================================
--- projects/profileservice/trunk/core/src/test/resources/org/jboss/test/profileservice/resolver/test/capabilities.xml	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/resources/org/jboss/test/profileservice/resolver/test/capabilities.xml	2010-02-18 13:49:47 UTC (rev 101111)
@@ -0,0 +1,73 @@
+<profiles xmlns="urn:jboss:profileservice:profiles:1.0">
+
+
+	<test name="bootstrap">
+		<capability name="service">
+			<property key="name" value="MainDeployer" />
+		</capability>
+	</test>
+
+	<test name="common">
+		<capability name="service">
+			<property key="name" value="JNDI" />
+		</capability>
+		<requirement name="service">
+			<property key="name" value="MainDeployer" />
+		</requirement>
+	</test>
+
+	<test name="jboss-webservices">
+		<capability name="service">
+			<property key="name" value="webservices" />
+			<property key="implementation" value="jboss" />
+		</capability>
+		<capability name="service">
+			<property key="name" value="jboss-webservices" />
+		</capability>
+		<requirement name="service">
+			<property key="name" value="JNDI" />
+		</requirement>
+	</test>
+
+	<test name="apache-webservices">
+		<capability name="service">
+			<property key="name" value="webservices" />
+			<property key="implementation" value="apache" />
+		</capability>
+		<capability name="service">
+			<property key="name" value="apache-webservices" />
+		</capability>
+		<requirement name="service">
+			<property key="name" value="JNDI" />
+		</requirement>
+	</test>
+
+	<test-group name="ejb3-group">
+		<capability name="service">
+			<property key="name" value="ejb3" />
+		</capability>
+		<requires name="ejb3-webservices" mode="activation-callback" />		
+	</test-group>
+
+	<test name="ejb3">
+		<capability name="service">
+			<property key="name" value="ejb3-core" />
+		</capability>
+		<requirement name="service">
+			<property key="name" value="JNDI" />
+		</requirement>
+	</test>
+
+	<test name="ejb3-webservices">
+		<capability name="service">
+			<property key="name" value="ejb3-webservices" />
+		</capability>
+		<requirement name="service">
+			<property key="name" value="ejb3-core" />
+		</requirement>
+		<requirement name="service">
+			<property key="name" value="webservices" />
+		</requirement>
+	</test>
+
+</profiles>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list