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

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


      testMockClassLoadingMetaData(a, new MockFederatedResourceVisitor(new ResourceVisitor[]{fa, fb}, null, null));
   }

   public void testFederatedWithRecurse() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setExcluded(new PackageClassFilter(new String[]{ResourcesAdapter.class.getPackage().getName()}));
      a.setPaths(ResourcesAdapter.class);
      MockFilteredResourceVisitor fa = new MockFilteredResourceVisitor("A\\.class");
      MockFilteredResourceVisitor fb = new MockFilteredResourceVisitor("B\\.class");
      ResourceFilter recurseFilter = new ResourceFilter()
      {
         public boolean accepts(ResourceContext resource)
View Full Code Here


      testMockClassLoadingMetaData(a, federatedRV, federatedRV.getFilter(), federatedRV.getRecurseFilter(), resources);
   }

   public void testFederatedWithRecurseMixed() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setExcluded(new PackageClassFilter(new String[]{ResourcesAdapter.class.getPackage().getName()}));
      a.setPaths(ResourcesAdapter.class);
      MockFilteredResourceVisitor fa = new MockFilteredResourceVisitor("A\\.class|C\\.class");
      MockFilteredResourceVisitor fb = new MockFilteredResourceVisitor("B\\.class");
      ResourceFilter recurseFilter = new ResourceFilter()
      {
         public boolean accepts(ResourceContext resource)
View Full Code Here

      super(name);
   }
  
   public void testSmoke() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         ClassLoader clA = assertClassLoader(contextA);
         assertLoadClass(A.class, clA);
View Full Code Here

      assertNoClassLoader(contextA);
   }
  
   public void testBDependsACorrectWay() 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.setPathsAndPackageNames(B.class);
         ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
         Requirement requirement = factory.createRequirePackage(A.class.getPackage().getName());
         b.setRequirements(Collections.singletonList(requirement));
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
View Full Code Here

      assertNoClassLoader(contextA);
   }
  
   public void testBDependsAWrongWay() throws Exception
   {
      MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
      b.setPathsAndPackageNames(B.class);
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      Requirement requirement = factory.createRequirePackage(A.class.getPackage().getName());
      b.setRequirements(Collections.singletonList(requirement));
      KernelControllerContext contextB = install(b);
      try
      {
         assertNoClassLoader(contextB);

         MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
         a.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA = install(a);
         try
         {
            ClassLoader clA = assertClassLoader(contextA);
            assertLoadClass(A.class, clA);
View Full Code Here

      assertNoClassLoader(contextB);
   }
  
   public void testBDependsARedeployA() 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.setPathsAndPackageNames(B.class);
         ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
         Requirement requirement = factory.createRequirePackage(A.class.getPackage().getName());
         b.setRequirements(Collections.singletonList(requirement));
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
View Full Code Here

      assertNoClassLoader(contextA);
   }
  
   public void testBDependsARedeployB() 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.setPathsAndPackageNames(B.class);
         ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
         Requirement requirement = factory.createRequirePackage(A.class.getPackage().getName());
         b.setRequirements(Collections.singletonList(requirement));
         KernelControllerContext contextB = install(b);
         try
         {
            assertLoadClass(A.class, clA);
            assertLoadClassFail(B.class, clA);
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

   }

   protected void testExplicitRequirementsInDomain(String domain, boolean failC, boolean failD) throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData c = new MockClassLoadingMetaData("c");
      c.setPathsAndPackageNames(C.class, D.class);
      c.setImportAll(true);
      c.setExportAll(ExportAll.NON_EMPTY);
      KernelControllerContext contextC = install(c);
      try
      {
         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.setDomain(domain);
         b.setPathsAndPackageNames(B.class);
         b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
         KernelControllerContext contextB = install(b);
         try
         {
            assertNoClassLoader(contextB);

            MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
            a.setDomain(domain);
            a.setPathsAndPackageNames(A.class);
            a.getCapabilities().addCapability(factory.createPackage(A.class.getPackage().getName()));
            KernelControllerContext contextA = install(a);
            try
            {
               ClassLoader clA = assertClassLoader(contextA);
               assertLoadClass(A.class, clA);
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.