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

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


   }

   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).
               createReExportPackage(PACKAGE_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().
                  createRequireModule("b");
               clC = createClassLoader(rC, "C", builderC, JAR_C_1);
View Full Code Here


   }
  
   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);
            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 testImportNoVersionCheck() throws Exception
   {
      ClassLoader clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A);
         clA = createClassLoader(rA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(clA, CLASS_B);
        
         ClassLoader clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createPackage(PACKAGE_B).
               createRequirePackage(PACKAGE_A);
View Full Code Here

   }
  
   public void testImportVersionCheck() throws Exception
   {
      ClassLoader clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A, "1.0.0");
         clA = createClassLoader(rA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(clA, CLASS_B);
        
         ClassLoader clB = null;
         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 testImportVersionCheckFailed() throws Exception
   {
      ClassLoader clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("ModuleA").
            createPackage(PACKAGE_A, "3.0.0");
         clA = createClassLoader(rA, "A", builderA, JAR_A_1);
         Class<?> classA = assertLoadClass(CLASS_A, clA);
         assertCannotLoadClass(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
   {
      ClassLoader clA1 = null;
      ClassLoader clA2 = null;
      ClassLoader 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 = createClassLoader(rA1, "A1", builderA1, JAR_A_1);
        
         BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
            createModule("PackageA").
            createPackage(PACKAGE_A, "2.0.0");
         clA2 = createClassLoader(rA2, "A2", builderA2, JAR_A_1);
        
         BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
         createModule("PackageA").
         createPackage(PACKAGE_A, "3.0.0");
         clA3 = createClassLoader(rA3, "A3", builderA3, JAR_A_1);
                 
         Class<?> classA1 = assertLoadClass(CLASS_A, clA1);
         Class<?> classA2 = assertLoadClass(CLASS_A, clA2);
         Class<?> classA3 = assertLoadClass(CLASS_A, clA3);
         assertCannotLoadClass(clA1, CLASS_B);
         assertCannotLoadClass(clA2, CLASS_B);
         assertCannotLoadClass(clA3, CLASS_B);
        
         ClassLoader 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 testReExport() throws Exception
   {
      ClassPool clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("a").
            createPackage(PACKAGE_A);
         clA = createClassPool(rA, "A", builderA, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(clA, CLASS_B);
         assertCannotLoadCtClass(clA, CLASS_C);
        
         ClassPool clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createModule("b").
               createPackage(PACKAGE_B).
               createReExportPackage(PACKAGE_A);
           
            clB = createClassPool(rB, "B", builderB, JAR_B_1);
            CtClass classA1 = assertLoadCtClass(CLASS_A, clA);
            assertSame(classA, classA1);
            assertCannotLoadCtClass(clA, CLASS_B);
            assertCannotLoadCtClass(clA, CLASS_C);
            classA1 = assertLoadCtClass(CLASS_A, clB, clA);
            assertSame(classA, classA1);
            CtClass classB = assertLoadCtClass(CLASS_B, clB);
            assertCannotLoadCtClass(clB, CLASS_C);
           
            ClassPool clC = null;
            Result rC = new Result();
            try
            {
               BundleInfoBuilder builderC = BundleInfoBuilder.getBuilder().
                  createRequireModule("b");
               clC = createClassPool(rC, "C", builderC, JAR_C_1);
View Full Code Here

   }
  
   public void testNoReExport() throws Exception
   {
      ClassPool clA = null;
      Result rA = new Result();
      try
      {
         BundleInfoBuilder builderA = BundleInfoBuilder.getBuilder().
            createModule("a").
            createPackage(PACKAGE_A);
         clA = createClassPool(rA, "A", builderA, JAR_A_1);
         CtClass classA = assertLoadCtClass(CLASS_A, clA);
         assertCannotLoadCtClass(clA, CLASS_B);
         assertCannotLoadCtClass(clA, CLASS_C);
        
         ClassPool clB = null;
         Result rB = new Result();
         try
         {
            BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
               createModule("b").
               createPackage(PACKAGE_B).
               createReExportModule("a");
            clB = createClassPool(rB, "B", builderB, JAR_B_1);
            CtClass classA1 = assertLoadCtClass(CLASS_A, clA);
            assertSame(classA, classA1);
            assertCannotLoadCtClass(clA, CLASS_B);
            assertCannotLoadCtClass(clA, CLASS_C);
            classA1 = assertLoadCtClass(CLASS_A, clB, clA);
            assertSame(classA, classA1);
            CtClass classB = assertLoadCtClass(CLASS_B, clB);
            assertCannotLoadCtClass(clB, CLASS_C);
           
            ClassPool clC = null;
            Result rC = new Result();
            try
            {
               BundleInfoBuilder builderC = BundleInfoBuilder.getBuilder().
                  createRequirePackage(PACKAGE_B);
               clC = createClassPool(rC, "C", builderC, JAR_C_1);
View Full Code Here

   }
  
   public void testParentFirst() throws Exception
   {
      ClassLoader clParentA = null;
      Result resultParentA = new Result();
      try
      {
         clParentA = createClassLoader(resultParentA, "aParent", true, JAR_A_1);
         assertLoadClass(CLASS_A, clParentA);
         assertCannotLoadClass(CLASS_B, clParentA);
        
         ClassLoader clChildA = null;
         Result resultChildA = new Result();
         final String childDomainName = "ChildDomain";
         try
         {
            clChildA = createChildDomainParentFirstClassLoader(resultChildA, "aChild", childDomainName, true, JAR_A_2);
            assertLoadClass(CLASS_A, clParentA);
            assertLoadClass(CLASS_A, clChildA, clParentA);
            assertCannotLoadClass(CLASS_B, clChildA);
           
            ClassLoader clB = null;
            Result resultB = new Result();
            try
            {
               BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
                  createRequirePackage(PACKAGE_A);
               clB = createChildDomainParentFirstClassLoader(resultB, "b", childDomainName, builderB, JAR_B_1);
View Full Code Here

   }
  
   public void testParentLast() throws Exception
   {
      ClassLoader clParentA = null;
      Result resultParentA = new Result();
      try
      {
         clParentA = createClassLoader(resultParentA, "aParent", true, JAR_A_1);
         assertLoadClass(CLASS_A, clParentA);
         assertCannotLoadClass(CLASS_B, clParentA);
        
         ClassLoader clChildA = null;
         Result resultChildA = new Result();
         final String childDomainName = "ChildDomain";
         try
         {
            clChildA = createChildDomainParentLastClassLoader(resultChildA, "aChild", childDomainName, true, JAR_A_2);
            assertLoadClass(CLASS_A, clParentA);
            assertLoadClass(CLASS_A, clChildA);
            assertCannotLoadClass(CLASS_B, clChildA);
           
            ClassLoader clB = null;
            Result resultB = new Result();
            try
            {
               BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
                  createRequirePackage(PACKAGE_A);
               clB = createChildDomainParentLastClassLoader(resultB, "b", childDomainName, builderB, JAR_B_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.