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

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


   }
  
   public void testConflictingRequirementNoJoin() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);
         assertLoadClassFail(C.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("2.0.0", "3.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA2);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  ClassLoader clC1 = assertClassLoader(contextC1);
                  assertLoadClass(C.class, clC1);
View Full Code Here


   }
  
   public void testRequirementIsConsistent() throws Exception
   {
      ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
      MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a", "1.0.0");
      a1.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA1 = install(a1);
      try
      {
         ClassLoader clA1 = assertClassLoader(contextA1);
         assertLoadClass(A.class, clA1);
         assertLoadClassFail(B.class, clA1);
         assertLoadClassFail(C.class, clA1);

         MockClassLoadingMetaData a2 = new MockClassLoadingMetaData("a", "2.0.0");
         a2.setPathsAndPackageNames(A.class);
         KernelControllerContext contextA2 = install(a2);
         try
         {
            ClassLoader clA2 = assertClassLoader(contextA2);
            assertLoadClass(A.class, clA2);
            assertLoadClassFail(B.class, clA2);
            assertLoadClassFail(C.class, clA2);

            MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
            b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
            b1.setPathsAndPackageNames(B.class);
            KernelControllerContext contextB1 = install(b1);
            try
            {
               ClassLoader clB1 = assertClassLoader(contextB1);
               assertLoadClass(B.class, clB1);
               assertLoadClass(A.class, clB1, clA1);
               assertLoadClassFail(C.class, clB1);

               MockClassLoadingMetaData c1 = new MockClassLoadingMetaData("c", "1.0.0");
               c1.getRequirements().addRequirement(factory.createRequireModule("b"));
               c1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
               c1.setPathsAndPackageNames(C.class);
               KernelControllerContext contextC1 = install(c1);
               try
               {
                  ClassLoader clC1 = assertClassLoader(contextC1);
                  assertLoadClass(C.class, clC1);
View Full Code Here

    *
    * @throws Exception for any error
    */
   public void testDependencyRemoval() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setPathsAndPackageNames(A.class);
      KernelControllerContext contextA = install(a);
      try
      {
         DependencyInfo infoA = contextA.getDependencyInfo();

         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
         {
            Set<DependencyItem> items = infoA.getDependsOnMe(null);
View Full Code Here

      super(name);
   }
  
   public void testName() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals("a", module.getName());
View Full Code Here

   }
  
   public void testVersion() throws Exception
   {
      Version version = Version.parseVersion("1.0.0");
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a", version);
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals(version, module.getVersion());
View Full Code Here

      assertNoModule(contextA);
   }
  
   public void testDomainName() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setDomain("DomainName");
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals("DomainName", module.getDomainName());
View Full Code Here

      assertNoModule(contextA);
   }
  
   public void testParentDomainName() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setDomain("DomainName");
      a.setParentDomain(ClassLoaderSystem.DEFAULT_DOMAIN_NAME);
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME, module.getParentDomainName());
View Full Code Here

      assertNoModule(contextA);
   }
  
   public void testExportAll() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setExportAll(ExportAll.ALL);
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals(ExportAll.ALL, module.getExportAll());
View Full Code Here

      assertNoModule(contextA);
   }
  
   public void testIncluded() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setIncluded(ClassFilterUtils.JAVA_ONLY);
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals(ClassFilterUtils.JAVA_ONLY, module.getIncluded());
View Full Code Here

      assertNoModule(contextA);
   }
  
   public void testExcluded() throws Exception
   {
      MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
      a.setExcluded(ClassFilterUtils.JAVA_ONLY);
      KernelControllerContext contextA = install(a);
      try
      {
         MockClassLoaderPolicyModule module = assertModule(contextA);
         assertEquals(ClassFilterUtils.JAVA_ONLY, module.getExcluded());
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.