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

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


   }
  
   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

   }
  
   public void testParentOtherDomainLazy() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      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
      {
         assertNoClassLoader(contextB);

         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);
View Full Code Here

   }

   public void testParentRedeployOtherDomain() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      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
      {
         assertNoClassLoader(contextB);

         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);
View Full Code Here

  
   public void testReExport() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
     
      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);
         assertLoadClassFail(C.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.getRequirements().addRequirement(factory.createReExportModule("a"));
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
            assertLoadClassFail(C.class, clA);
            ClassLoader clB = assertClassLoader(contextB);
            assertLoadClass(A.class, clB, clA);
            assertLoadClass(B.class, clB);
            assertLoadClassFail(C.class, clB);

            MockClassLoadingMetaData c = new MockClassLoadingMetaData("c");
            c.getRequirements().addRequirement(factory.createRequireModule("b"));
            c.setPathsAndPackageNames(C.class);
            KernelControllerContext contextC = install(c);
            try
            {
               assertLoadClass(A.class, clA);
               assertLoadClassFail(B.class, clA);
View Full Code Here

  
   public void testNoReExport() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
     
      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);
         assertLoadClassFail(C.class, clA);

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.getRequirements().addRequirement(factory.createReExportModule("a"));
         b.setPathsAndPackageNames(B.class);
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
            assertLoadClassFail(C.class, clA);
            ClassLoader clB = assertClassLoader(contextB);
            assertLoadClass(A.class, clB, clA);
            assertLoadClass(B.class, clB);
            assertLoadClassFail(C.class, clB);

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

  
   public void testUsesNoImport() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
     
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1");
      a1.getRequirements().addRequirement(factory.createUsesPackage(A.class.getPackage().getName()));
      a1.setPaths(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
View Full Code Here

  
   public void testDynamicPackage() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
     
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a1");
      a1.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName(), null, false, false, true));
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClassFail(A.class, clA1);

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

   }
  
   public void testConflictingPackage() 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.createRequireModule("a1"));
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            assertNoClassLoader(contextA2);
         }
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.