Package org.jboss.classloading.spi.dependency.policy.mock

Examples of org.jboss.classloading.spi.dependency.policy.mock.MockClassLoadingMetaData


      assertNoClassLoader(contextAB);
   }

   private MockClassLoadingMetaData getModuleAB(SplitPackagePolicy policy)
   {
      MockClassLoadingMetaData ab = new MockClassLoadingMetaData("ab");
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      ab.getCapabilities().addCapability(factory.createModule("ModuleAB"));
      ab.getCapabilities().addCapability(createPackageCapability(A.class.getPackage().getName(), policy));
      ab.getCapabilities().addCapability(factory.createPackage(B.class.getPackage().getName()));
      ab.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      ab.setPathsAndPackageNames(A.class, B.class);
      return ab;
   }
View Full Code Here


      return ab;
   }

   private MockClassLoadingMetaData getModuleAC(SplitPackagePolicy policy)
   {
      MockClassLoadingMetaData ac = new MockClassLoadingMetaData("ac");
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      ac.getCapabilities().addCapability(factory.createModule("ModuleAC"));
      ac.getCapabilities().addCapability(createPackageCapability(A.class.getPackage().getName(), policy));
      ac.getCapabilities().addCapability(factory.createPackage(C.class.getPackage().getName()));
      ac.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      ac.setPathsAndPackageNames(A.class, C.class);
      return ac;
   }
View Full Code Here

      super(name);
   }
  
   public void testImportPackageNoVersionCheck() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      a.getCapabilities().addCapability(factory.createModule("ModuleA"));
      a.getCapabilities().addCapability(factory.createPackage(A.class.getPackage().getName()));
      a.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      a.setPathsAndPackageNames(A.class);
     
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
View Full Code Here

   }
  
   public void testParentFirst() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
      aParent.setPathsAndPackageNames(A.class);
      KernelControllerContext contextParentA = install(aParent);
      try
      {
         ClassLoader clParentA = assertClassLoader(contextParentA);
         assertLoadClass(A.class, clParentA);
         assertLoadClassFail(B.class, clParentA);

         MockClassLoadingMetaData aChild = new MockClassLoadingMetaData("aChild");
         aChild.setDomain("ChildDomain");
         aChild.setJ2seClassLoadingCompliance(true);
         aChild.setPathsAndPackageNames(A.class);
         KernelControllerContext contextChildA = install(aChild);
         try
         {
            ClassLoader clChildA = assertClassLoader(contextChildA);
            assertLoadClass(A.class, clParentA);
            assertLoadClassFail(B.class, clChildA);

            MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
            b.setDomain("ChildDomain");
            b.setJ2seClassLoadingCompliance(true);
            b.setPathsAndPackageNames(B.class);
            b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
            KernelControllerContext contextB = install(b);
            try
            {
               ClassLoader clB = assertClassLoader(contextB);
               assertLoadClass(A.class, clParentA);
View Full Code Here

   }
  
   public void testParentLast() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
      aParent.setPathsAndPackageNames(A.class);
      KernelControllerContext contextParentA = install(aParent);
      try
      {
         ClassLoader clParentA = assertClassLoader(contextParentA);
         assertLoadClass(A.class, clParentA);
         assertLoadClassFail(B.class, clParentA);

         MockClassLoadingMetaData aChild = new MockClassLoadingMetaData("aChild");
         aChild.setDomain("ChildDomain");
         aChild.setJ2seClassLoadingCompliance(false);
         aChild.setPathsAndPackageNames(A.class);
         KernelControllerContext contextChildA = install(aChild);
         try
         {
            ClassLoader clChildA = assertClassLoader(contextChildA);
            assertLoadClass(A.class, clChildA);
            assertLoadClassFail(B.class, clChildA);

            MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
            b.setDomain("ChildDomain");
            b.setJ2seClassLoadingCompliance(false);
            b.setPathsAndPackageNames(B.class);
            b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
            KernelControllerContext contextB = install(b);
            try
            {
               ClassLoader clB = assertClassLoader(contextB);
               assertLoadClass(A.class, clChildA);
View Full Code Here

   }
  
   public void testParentLastNotInChild() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
      aParent.setPathsAndPackageNames(A.class);
      KernelControllerContext contextParentA = install(aParent);
      try
      {
         ClassLoader clParentA = assertClassLoader(contextParentA);
         assertLoadClass(A.class, clParentA);
         assertLoadClassFail(B.class, clParentA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.setDomain("ChildDomain");
         b.setJ2seClassLoadingCompliance(false);
         b.setPathsAndPackageNames(B.class);
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
         KernelControllerContext contextB = install(b);
         try
         {
            ClassLoader clB = assertClassLoader(contextB);
            assertLoadClass(A.class, clParentA);
View Full Code Here

   }
  
   public void testParentFirstWrongWayAround() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
      b.setDomain("ChildDomain");
      b.setJ2seClassLoadingCompliance(true);
      b.setPathsAndPackageNames(B.class);
      b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      KernelControllerContext contextB = install(b);
      try
      {
         assertNoClassLoader(contextB);

         MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
         aParent.setPathsAndPackageNames(A.class);
         KernelControllerContext contextParentA = install(aParent);
         try
         {
            ClassLoader clParentA = assertClassLoader(contextParentA);
            assertLoadClass(A.class, clParentA);
View Full Code Here

   }
  
   public void testParentLastWrongWayAround() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
      b.setDomain("ChildDomain");
      b.setJ2seClassLoadingCompliance(false);
      b.setPathsAndPackageNames(B.class);
      b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      KernelControllerContext contextB = install(b);
      try
      {
         assertNoClassLoader(contextB);

         MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
         aParent.setPathsAndPackageNames(A.class);
         KernelControllerContext contextParentA = install(aParent);
         try
         {
            ClassLoader clParentA = assertClassLoader(contextParentA);
            assertLoadClass(A.class, clParentA);
View Full Code Here

   }
  
   public void testParentRedeploy() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
      b.setDomain("ChildDomain");
      b.setJ2seClassLoadingCompliance(true);
      b.setPathsAndPackageNames(B.class);
      b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
      KernelControllerContext contextB = install(b);
      try
      {
         assertNoClassLoader(contextB);

         MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
         aParent.setPathsAndPackageNames(A.class);
         KernelControllerContext contextParentA = install(aParent);
         try
         {
            ClassLoader clParentA = assertClassLoader(contextParentA);
            assertLoadClass(A.class, clParentA);
View Full Code Here

   }
  
   public void testParentOtherDomain() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
      aParent.setPathsAndPackageNames(A.class);
      aParent.setDomain("ParentDomain");
      KernelControllerContext contextParentA = install(aParent);
      try
      {
         ClassLoader clParentA = assertClassLoader(contextParentA);
         assertLoadClass(A.class, clParentA);
         assertLoadClassFail(B.class, clParentA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.setDomain("ChildDomain");
         b.setParentDomain("ParentDomain");
         b.setJ2seClassLoadingCompliance(true);
         b.setPathsAndPackageNames(B.class);
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
         KernelControllerContext contextB = install(b);
         try
         {
               ClassLoader clB = assertClassLoader(contextB);
               assertLoadClass(A.class, clParentA);
View Full Code Here

TOP

Related Classes of org.jboss.classloading.spi.dependency.policy.mock.MockClassLoadingMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.