Package org.jboss.test.aop.classpool.jbosscl.support

Examples of org.jboss.test.aop.classpool.jbosscl.support.Result


   }
  
   public void testImportVersionCheckFailed() throws Exception
   {
      ClassPool clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A, "3.0.0");
         clA = createClassPool(rA, "A", builderA, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(clA, CLASS_B);
        
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createPackage(PACKAGE_B).
               createRequirePackage(PACKAGE_A, new VersionRange("1.0.0", "2.0.0"));
View Full Code Here


   public void testSeveralModulesWithSamePackagesDifferentVersions() throws Exception
   {
      ClassPool clA1 = null;
      ClassPool clA2 = null;
      ClassPool clA3 = null;
      Result rA1 = new Result();
      Result rA2 = new Result();
      Result rA3 = new Result();
      try
      {
         BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
            createModule("PackageA").
            createPackage(PACKAGE_A, "1.0.0");
         clA1 = createClassPool(rA1, "A1", builderA1, JAR_A_1);
        
         BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
            createModule("PackageA").
            createPackage(PACKAGE_A, "2.0.0");
         clA2 = createClassPool(rA2, "A2", builderA2, JAR_A_1);
        
         BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
         createModule("PackageA").
         createPackage(PACKAGE_A, "3.0.0");
         clA3 = createClassPool(rA3, "A3", builderA3, JAR_A_1);
                 
         CtClass classA1 = assertLoadCtClass(CLASS_A, clA1);
         CtClass classA2 = assertLoadCtClass(CLASS_A, clA2);
         CtClass classA3 = assertLoadCtClass(CLASS_A, clA3);
         assertCannotLoadCtClass(clA1, CLASS_B);
         assertCannotLoadCtClass(clA2, CLASS_B);
         assertCannotLoadCtClass(clA3, CLASS_B);
        
         ClassPool clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createPackage(PACKAGE_B).
               createRequirePackage(PACKAGE_A, new VersionRange("1.0.0", false, "2.0.0", true));
View Full Code Here

   }

   public void testUsesImport() throws Exception
   {
      ClassLoader clA1 = null;
      Result rA1 = new Result();
      try
      {
         BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
            createModule("a1").
            createPackage(PACKAGE_A);
         clA1 = createClassLoader(rA1, "A1", builderA1, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA1);

         ClassLoader clA2 = null;
         Result rA2 = new Result();
         try
         {
            BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
            createModule("a2").
            createUsesPackage(PACKAGE_A);
View Full Code Here

   }
  
   public void testUsesNoImport() throws Exception
   {
      ClassLoader clA1 = null;
      Result rA1 = new Result();
      try
      {
         BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
            createModule("a1").
            createUsesPackage(PACKAGE_A);
View Full Code Here

   }

   public void testImportNoVersionCheck() throws Exception
   {
      ClassLoader clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A);
         clA = createClassLoader(resultA, "A", builderA, JAR_A_1);
        
         Class<?> aFromA = assertLoadClass(CLASS_A, clA, clA);
         assertCannotLoadClass(clA, CLASS_B);
        
         ClassLoader clB = null;
         Result resultB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createModule("ModuleB").
               createRequireModule("ModuleA");
View Full Code Here

   }
  
   public void testImportVersionCheck() throws Exception
   {
      ClassLoader clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "1.0.0").
            createPackage(PACKAGE_A);
         clA = createClassLoader(resultA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(clA, CLASS_B);

         ClassLoader clB = null;
         Result resultB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createRequireModule("ModuleA", new VersionRange("1.0.0", "2.0.0")).
               createPackage(PACKAGE_B);
View Full Code Here

   }  

   public void testImportVersionCheckFailed() throws Exception
   {
      ClassLoader clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "3.0.0").
            createPackage(PACKAGE_A);
         clA = createClassLoader(resultA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(clA, CLASS_B);
         Result resultB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createRequireModule("ModuleA", new VersionRange("1.0.0", "2.0.0")).
               createPackage(PACKAGE_B);
View Full Code Here

   public void testSeveralModulesWithSamePackages() throws Exception
   {
      ClassLoader clAModuleX = null;
      ClassLoader clAModuleA = null;
      ClassLoader clAModuleY = null;
      Result rAX = new Result();
      Result rAA = new Result();
      Result rAY = new Result();
      try
      {
         BundleInfoBuilder builderAX = BundleInfoBuilder.getBuilder().
            createModule("ModuleX").
            createPackage(PACKAGE_A);
         clAModuleX = createClassLoader(rAX, "X", builderAX, JAR_A_1);
     
         BundleInfoBuilder builderAA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A);
         clAModuleA = createClassLoader(rAA, "A", builderAA, JAR_A_1);
        
         BundleInfoBuilder builderAY = BundleInfoBuilder.getBuilder().
            createModule("ModuleY").
            createPackage(PACKAGE_A);
         clAModuleY = createClassLoader(rAY, "Y", builderAY, JAR_A_1);
     
         Class<?> classAX = assertLoadClass(CLASS_A, clAModuleX);
         Class<?> classAA = assertLoadClass(CLASS_A, clAModuleA);
         Class<?> classAY = assertLoadClass(CLASS_A, clAModuleY);
         assertCannotLoadClass(clAModuleX, CLASS_B);
         assertCannotLoadClass(clAModuleA, CLASS_B);
         assertCannotLoadClass(clAModuleY, CLASS_B);
        
         ClassLoader clB = null;
         Result resultB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createRequireModule("ModuleA").
               createPackage(PACKAGE_B);
View Full Code Here

   public void testSeveralModulesWithSameNamesDifferentVersions() throws Exception
   {
      ClassLoader clAModuleA1 = null;
      ClassLoader clAModuleA2 = null;
      ClassLoader clAModuleA3 = null;
      Result rA1 = new Result();
      Result rA2 = new Result();
      Result rA3 = new Result();
      try
      {
         BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "1.0.0").
            createPackage(PACKAGE_A);
         clAModuleA1 = createClassLoader(rA1, "X", builderA1, JAR_A_1);
     
         BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "2.0.0").
            createPackage(PACKAGE_A);
         clAModuleA2 = createClassLoader(rA2, "A", builderA2, JAR_A_1);
        
         BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "3.0.0").
            createPackage(PACKAGE_A);
         clAModuleA3 = createClassLoader(rA3, "Y", builderA3, JAR_A_1);
     
         Class<?> classAX = assertLoadClass(CLASS_A, clAModuleA1);
         Class<?> classAA = assertLoadClass(CLASS_A, clAModuleA2);
         Class<?> classAY = assertLoadClass(CLASS_A, clAModuleA3);
         assertCannotLoadClass(clAModuleA1, CLASS_B);
         assertCannotLoadClass(clAModuleA2, CLASS_B);
         assertCannotLoadClass(clAModuleA3, CLASS_B);
        
         ClassLoader clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createRequireModule("ModuleA", new VersionRange("2.0.0", true, "3.0.0", false)).
               createPackage(PACKAGE_B);
View Full Code Here

   }

   public void testReExport() throws Exception
   {
      ClassLoader clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("a").
            createPackage(PACKAGE_A);
         clA = createClassLoader(rA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(clA, CLASS_B);
         assertCannotLoadClass(clA, CLASS_C);
        
         ClassLoader clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createModule("b").
               createPackage(PACKAGE_B).
               createReExportModule("a");
            clB = createClassLoader(rB, "B", builderB, JAR_B_1);
            Class<?> classA1 = assertLoadClass(CLASS_A, clA);
            assertSame(classA, classA1);
            assertCannotLoadClass(clA, CLASS_B);
            assertCannotLoadClass(clA, CLASS_C);
            assertLoadClass(CLASS_A, clB, clA);
            Class<?> classB = assertLoadClass(CLASS_B, clB);
            assertCannotLoadClass(clB, CLASS_C);
           
            ClassLoader clC = null;
            Result rC = new Result();
            try
            {
               BundleInfoBuilder builderC = BundleInfoBuilder.getBuilder().
                  createRequireModule("b");
               clC = createClassLoader(rC, "C", builderC, JAR_C_1);
View Full Code Here

TOP

Related Classes of org.jboss.test.aop.classpool.jbosscl.support.Result

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.