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

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


   }
  
   public void testNoReExport() 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);
            classA1 = assertLoadClass(CLASS_A, clB, clA);
            assertSame(classA, classA1);
            Class<?> classB = assertLoadClass(CLASS_B, clB);
            assertCannotLoadClass(clB, CLASS_C);
           
            ClassLoader clC = null;
            Result rC = new Result();
            try
            {
               BundleInfoBuilder builderC = BundleInfoBuilder.getBuilder().
                  createRequirePackage(PACKAGE_B);
               clC = createClassLoader(rC, "C", builderC, JAR_C_1);
View Full Code Here


   }

   public void testUsesImport() throws Exception
   {
      ClassPool clA1 = null;
      Result rA1 = new Result();
      try
      {
         BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
            createModule("a1").
            createPackage(PACKAGE_A);
         clA1 = createClassPool(rA1, "A1", builderA1, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA1);

         ClassPool 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
   {
      ClassPool 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
   {
      ClassPool clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A);
         clA = createClassPool(resultA, "A", builderA, JAR_A_1);
        
         CtClass aFromA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(clA, CLASS_B);
        
         ClassPool clB = null;
         Result resultB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createModule("ModuleB").
               createRequireModule("ModuleA");
View Full Code Here

   }
  
   public void testImportVersionCheck() throws Exception
   {
      ClassPool clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "1.0.0").
            createPackage(PACKAGE_A);
         clA = createClassPool(resultA, "A", builderA, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(clA, CLASS_B);

         ClassPool 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
   {
      ClassPool clA = null;
      Result resultA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "3.0.0").
            createPackage(PACKAGE_A);
         clA = createClassPool(resultA, "A", builderA, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(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
   {
      ClassPool clAModuleX = null;
      ClassPool clAModuleA = null;
      ClassPool 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 = createClassPool(rAX, "X", builderAX, JAR_A_1);
     
         BundleInfoBuilder builderAA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A);
         clAModuleA = createClassPool(rAA, "A", builderAA, JAR_A_1);
        
         BundleInfoBuilder builderAY = BundleInfoBuilder.getBuilder().
            createModule("ModuleY").
            createPackage(PACKAGE_A);
         clAModuleY = createClassPool(rAY, "Y", builderAY, JAR_A_1);
     
         CtClass classAX = assertLoadCtClass(CLASS_A, clAModuleX);
         CtClass classAA = assertLoadCtClass(CLASS_A, clAModuleA);
         CtClass classAY = assertLoadCtClass(CLASS_A, clAModuleY);
         assertCannotLoadCtClass(clAModuleX, CLASS_B);
         assertCannotLoadCtClass(clAModuleA, CLASS_B);
         assertCannotLoadCtClass(clAModuleY, CLASS_B);
        
         ClassPool clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createRequireModule("ModuleA").
               createPackage(PACKAGE_B);
View Full Code Here

   public void testSeveralModulesWithSameNamesDifferentVersions() throws Exception
   {
      ClassPool clAModuleA1 = null;
      ClassPool clAModuleA2 = null;
      ClassPool 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 = createClassPool(rA1, "X", builderA1, JAR_A_1);
     
         BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "2.0.0").
            createPackage(PACKAGE_A);
         clAModuleA2 = createClassPool(rA2, "A", builderA2, JAR_A_1);
        
         BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
            createModule("ModuleA", "3.0.0").
            createPackage(PACKAGE_A);
         clAModuleA3 = createClassPool(rA3, "Y", builderA3, JAR_A_1);
     
         CtClass classAX = assertLoadCtClass(CLASS_A, clAModuleA1);
         CtClass classAA = assertLoadCtClass(CLASS_A, clAModuleA2);
         CtClass classAY = assertLoadCtClass(CLASS_A, clAModuleA3);
         assertCannotLoadCtClass(clAModuleA1, CLASS_B);
         assertCannotLoadCtClass(clAModuleA2, CLASS_B);
         assertCannotLoadCtClass(clAModuleA3, CLASS_B);
        
         ClassPool 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

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.