Examples of DeploymentContext


Examples of org.apache.hadoop.gateway.deploy.DeploymentContext

    provider.setEnabled( true );
    topology.addProvider( provider );

    GatewayDescriptor descriptor = GatewayDescriptorFactory.create();

    DeploymentContext context = EasyMock.createNiceMock( DeploymentContext.class );
    EasyMock.expect( context.getWebArchive() ).andReturn( webArchive ).anyTimes();
    EasyMock.expect( context.getTopology() ).andReturn( topology ).anyTimes();
    EasyMock.expect( context.getGatewayDescriptor() ).andReturn( descriptor ).anyTimes();
    context.contributeFilter(
        EasyMock.<Service> isA( Service.class ),
        EasyMock.<ResourceDescriptor> isA( ResourceDescriptor.class ),
        EasyMock.<String> isA( String.class ),
        EasyMock.<String> isA( String.class ),
        EasyMock.<List> isA( List.class ) );
    EasyMock.expectLastCall().andDelegateTo(
        new MockDeploymentContext( context, providerContributor, provider ) ).anyTimes();

    EasyMock.replay( context );

    // Just make sure they don't blow up.
    providerContributor.initializeContribution( context );
    serviceContributor.initializeContribution( context );

    Service service = new Service();
    service.setRole( "test-service-role" );
    service.setName( "test-service-name" );
    service.setUrl( "http://test-service-host:777/test-service-path" );

    // This should end up calling providerContributor.contributeFilter
    serviceContributor.contributeService( context, service );
    ResourceDescriptor resource = context.getGatewayDescriptor().resources().get( 0 );

    // Just make sure they don't blow up.
    serviceContributor.finalizeContribution( context );
    providerContributor.finalizeContribution( context );

    /*
    GatewayDescriptorFactory.store( descriptor, "xml", new PrintWriter( System.out ) );
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <gateway>
      <resource>
        <role>test-service-role</role>
        <pattern>test-service/?**</pattern>
        <filter>
          <role>dispatch</role>
          <name>jersey</name>
          <class>org.glassfish.jersey.servlet.ServletContainer</class>
          <param>
            <name>jersey.config.server.provider.packages</name>
            <value>test-package-1;test-package-2</value>
          </param>
        </filter>
      </resource>
      <resource>
        <role>test-service-role</role>
        <pattern>test-service/**?**</pattern>
        <filter>
          <role>dispatch</role>
          <name>jersey</name>
          <class>org.glassfish.jersey.servlet.ServletContainer</class>
          <param>
            <name>jersey.config.server.provider.packages</name>
            <value>test-package-1;test-package-2</value>
          </param>
        </filter>
      </resource>
    </gateway>
    */
    List<ResourceDescriptor> resources = context.getGatewayDescriptor().resources();
    assertThat( resources.size(), is( 2 ) );

    resource = resources.get( 0 );
    assertThat( resource.role(), is( "test-service-role" ) );
    assertThat( resource.pattern(), is( "test-service/?**" ) );
View Full Code Here

Examples of org.apache.openejb.core.DeploymentContext

    private DeploymentIndex deploymentIndex;

    @Before
    public void setUp() throws SystemException {
        method = Method.class.getMethods()[0];
        dc = new DeploymentContext("aDeploymentId", null, null);
        deploymentInfo = new CoreDeploymentInfo(dc, DeploymentIndexTest.class, null, null, null, null, null, null, null, null, null);
        deploymentIndex = new DeploymentIndex(new DeploymentInfo[] { deploymentInfo, deploymentInfo });
    }
View Full Code Here

Examples of org.apache.tuscany.spi.deployer.DeploymentContext

    public <I extends Implementation<?>> Component deploy(CompositeComponent parent,
                                                             ComponentDefinition<I> componentDefinition)
        throws LoaderException {
        ScopeContainer moduleScope = new ModuleScopeContainer();
        DeploymentContext deploymentContext = new RootDeploymentContext(null, xmlFactory, moduleScope, null);
        try {
            load(parent, componentDefinition, deploymentContext);
        } catch (LoaderException e) {
            e.addContextName(componentDefinition.getName());
            throw e;
View Full Code Here

Examples of org.glassfish.api.deployment.DeploymentContext

            configureLoaderProperties(cloader, webXmlParser, base);
           
            configureContextXmlAttribute(cloader, base, context);
           
            try {
                final DeploymentContext dc = context;
                final ClassLoader cl = cloader;
               
                AccessController.doPrivileged(
                        new PermsArchiveDelegate.SetPermissionsAction(
                                SMGlobalPolicyUtil.CommponentType.war, dc, cl));
View Full Code Here

Examples of org.jboss.arquillian.container.spi.context.DeploymentContext

    *
    * Activate DeploymentContext on all Deployment Events
    */
   public void createDeploymentContext(@Observes EventContext<DeploymentEvent> context)
   {
      DeploymentContext deploymentContext = this.deploymentContext.get();
      try
      {
         DeploymentEvent event = context.getEvent();
         deploymentContext.activate(event.getDeployment());

         context.proceed();
      }
      finally
      {
         deploymentContext.deactivate();
      }
   }
View Full Code Here

Examples of org.jboss.arquillian.impl.core.spi.context.DeploymentContext

    *
    * Activate DeploymentContext on all Deployment Events
    */
   public void createDeploymentContext(@Observes EventContext<DeploymentEvent> context)
   {
      DeploymentContext deploymentContext = this.deploymentContext.get();
      try
      {
         DeploymentEvent event = context.getEvent();
         deploymentContext.activate(event.getDeployment());

         context.proceed();
      }
      finally
      {
         deploymentContext.deactivate();
      }
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentContext

   /**
    * Verifies leading zeros are ignored.
    */
   public void testLeadingZerosIgnored()
   {
      DeploymentContext first = new TestDeploymentContext("001test.ear");
      DeploymentContext second = new TestDeploymentContext("21test.ear");
      DeploymentContext third = new TestDeploymentContext("0132test.ear");
     
     
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentContext

   /**
    * Verifies straight-forward ordering.
    */
   public void testPrefixOrdering()
   {
      DeploymentContext first = new TestDeploymentContext("1test.ear");
      DeploymentContext second = new TestDeploymentContext("21test.ear");
      DeploymentContext third = new TestDeploymentContext("132test.ear");
     
      ValidateFirstSecondThird(first, second, third);
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentContext

   /**
    * Verifies that a prefix tie is ordered based on the suffix.
    */
   public void testSuffixFallback()
   {
      DeploymentContext first = new TestDeploymentContext("123test.sar");
      DeploymentContext second = new TestDeploymentContext("123test.ear");
     
      assertTrue("Second comes before first", comparator.compare(first, second) < 0);
      assertTrue("First comes after second", comparator.compare(second, first) > 0);
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentContext

      prefixComparator.setSuffixOrder(suffixOrder);
      prefixComparator.create();
     
      Comparator<DeploymentContext> changedSuffix = prefixComparator;
     
      DeploymentContext first = new TestDeploymentContext("test.ear");
      DeploymentContext second = new TestDeploymentContext("test.sar");
     
      assertTrue("Second comes before first", changedSuffix.compare(first, second) < 0);
      assertTrue("First comes after second", changedSuffix.compare(second, first) > 0);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.