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

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


      assertNoClassLoader(contextA1);
   }
  
   public void testConflictingPackageNoImport() throws Exception
   {
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a2", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
View Full Code Here


   }
  
   public void testConflictingPackageNoExport() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1", "1.0.0");
      a1.setPaths(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a2", "2.0.0");
         a2.getRequirements().addRequirement(factory.createRequireModule("a1"));
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
View Full Code Here

   }
  
   public void testConflictingPackageUses() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a2", "2.0.0");
         a2.getRequirements().addRequirement(factory.createUsesPackage(A.class.getPackage().getName()));
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2, clA1);
View Full Code Here

   }
  
   public void testConflictingPackageRedeploy() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1", "1.0.0");
      a1.getRequirements().addRequirement(factory.createRequireModule("a2"));
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         assertNoClassLoader(contextA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a2", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
           
            uninstall(contextA1);

            a1 = new MockClassLoadingMetaData("a1", "1.0.0");
            a1.getRequirements().addRequirement(factory.createRequireModule("a2"));
            a1.setPathsAndPackageNames(B.class);
            contextA1 = install(a1);

            ClassLoader clA1 = assertClassLoader(contextA1);
View Full Code Here

      super(name);
   }
  
   public void testImportAll() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         assertLoadClass(A.class, clA);
         assertLoadClassFail(B.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.setImportAll(true);
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
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.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         assertLoadClass(A.class, clA);
         assertLoadClassFail(B.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
View Full Code Here

      assertNoClassLoader(contextA);
   }
  
   public void testImportPackageVersionCheck() 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(), "1.0.0"));
      a.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         assertLoadClass(A.class, clA);
         assertLoadClassFail(B.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName(), new VersionRange("1.0.0", "2.0.0")));
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
View Full Code Here

      assertNoClassLoader(contextA);
   }
  
   public void testImportPackageVersionCheckFailed() 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(), "3.0.0"));
      a.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         assertLoadClass(A.class, clA);
         assertLoadClassFail(B.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName(), new VersionRange("1.0.0", "2.0.0")));
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
View Full Code Here

   }
  
   public void testConflictingRequirement() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);
         assertLoadClassFail(C.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("2.0.0", "3.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA2);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("b"));
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  assertNoClassLoader(contextC1);
               }
View Full Code Here

   }
  
   public void testConflictingRequirementNoJoin() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);
         assertLoadClassFail(C.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("2.0.0", "3.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA2);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  ClassLoader clC1 = assertClassLoader(contextC1);
                  assertLoadClass(C.class, clC1);
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.