You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Srinath Perera <he...@gmail.com> on 2004/11/19 09:45:55 UTC

How to start a plan from the Code

I am trying to bring up few Gbeans from plan; I am trying to use
following code.

        ReadOnlyRepository repository = new ReadOnlyRepository(new
File("temp"));
        ServiceConfigBuilder scb = new ServiceConfigBuilder(null,repository);
        
        File plan = new File("plan1.xml");
        ConfigurationDocument configurationDoc =
ConfigurationDocument.Factory.parse(plan.toURL());
        File temp = new File("new");
        
        ConfigurationType conf = configurationDoc.getConfiguration();
        List confs = scb.buildConfiguration(conf,null,temp);
        URI uri = new URI(conf.getConfigId());       
----------------------> Point A

        kernel.startConfiguration(temp.toURI());
        kernel.stopConfiguration(temp.toURI());

1) when I run the code the kernel not seem to know about the
configuration I created at point A, Is there something missing and any
way to improve this code?

2) Actually I need to get up J2EE continer, OpenEJB and Jetty
Contianers up using plans from the code. I think there are plans
created already (I think it is in assembly) what are the plans I
should load to get that three contianers up and in what order.
Thanks
Srinath

p.s. my plan

<?xml version="1.0" encoding="UTF-8"?>
<configuration
    xmlns="http://geronimo.apache.org/xml/ns/deployment"
    configId="test/plan1">
     <!-- Use the default deployer -->
    <gbean name="test:axis=gb1" class="GBean1">
        <attribute name="attribute1">Hi</attribute>
        <attribute name="attribute2"
type="java.lang.String">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
    </gbean>
</configuration>

Re: How to start a plan from the Code

Posted by Srinath Perera <he...@gmail.com>.
hi All; 
follow up from the itest module for axis, I look in to the itest
modules and have finds some patterns. I have few questions and need to
verify what I see is correct!

Q1)How to run  the itest from the maven build .. is there something
like m:itests ...

Q2) itests have itest and java dirs what does they mean ..please check
my hypothesis
 java - have the application (e.g. web services )
 itest - test cases 
what happen when the modules runs 
a) compile and create web services using the files in java dir and
package them to a module
b) itest:setup start the geronimo and axis and deployed the modules created 
c) test cases in the itests run automatically
d) itest:shutdown shut down the server

Q3) What is the format I should be given in the module at
/geronimo-itests-axis-${pom.currentVersion}.jar"
<deploy:distribute         
uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
            username="system"
            password="manager"           
module="${basedir}/target/geronimo-itests-axis-${pom.currentVersion}.jar"
            />

Thanks
Srinath

On Fri, 3 Dec 2004 07:40:27 -0500, Davanum Srinivas <da...@gmail.com> wrote:
> Srinath,
> 
> Any progress on this?
> 
> Thanks,
> dims
> 
> 
> 
> 
> On Sat, 20 Nov 2004 09:25:43 +0600, Srinath Perera <he...@gmail.com> wrote:
> > > I think what you want to do is use the itest plugin together with the
> > > geronimo maven deploy plugin.  You will have to add a new module to do
> > > this: I suggest itests/webservices.  The good example of how to use
> > > this is openejb itests.  These tests will run only after assembly;
> > > however if you are starting jetty and openejb, what you have is
> > > definitely not a unit test but an integration test.
> >
> > Thanks Daivd; yap it is more like integeration :), .
> >
> > what I want is to start system plan , j2ee-server plan, (with jetty
> > and openejb)  some axis configuration plan and then send SOAP calls.
> > (there is long way to go it seems.)  will look at the plugin!
> > Thanks
> > Srinath
> >
> > > On Nov 19, 2004, at 12:45 AM, Srinath Perera wrote:
> > >
> > > > I am trying to bring up few Gbeans from plan; I am trying to use
> > > > following code.
> > > >
> > > >         ReadOnlyRepository repository = new ReadOnlyRepository(new
> > > > File("temp"));
> > > >         ServiceConfigBuilder scb = new
> > > > ServiceConfigBuilder(null,repository);
> > > >
> > > >         File plan = new File("plan1.xml");
> > > >         ConfigurationDocument configurationDoc =
> > > > ConfigurationDocument.Factory.parse(plan.toURL());
> > > >         File temp = new File("new");
> > > >
> > > >         ConfigurationType conf = configurationDoc.getConfiguration();
> > > >         List confs = scb.buildConfiguration(conf,null,temp);
> > > >         URI uri = new URI(conf.getConfigId());
> > > > ----------------------> Point A
> > > >
> > > >         kernel.startConfiguration(temp.toURI());
> > > >         kernel.stopConfiguration(temp.toURI());
> > > >
> > > > 1) when I run the code the kernel not seem to know about the
> > > > configuration I created at point A, Is there something missing and any
> > > > way to improve this code?
> > > >
> > > > 2) Actually I need to get up J2EE continer, OpenEJB and Jetty
> > > > Contianers up using plans from the code. I think there are plans
> > > > created already (I think it is in assembly) what are the plans I
> > > > should load to get that three contianers up and in what order.
> > > > Thanks
> > > > Srinath
> > > >
> > > > p.s. my plan
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <configuration
> > > >     xmlns="http://geronimo.apache.org/xml/ns/deployment"
> > > >     configId="test/plan1">
> > > >      <!-- Use the default deployer -->
> > > >     <gbean name="test:axis=gb1" class="GBean1">
> > > >         <attribute name="attribute1">Hi</attribute>
> > > >         <attribute name="attribute2"
> > > > type="java.lang.String">geronimo.server:
> > > > j2eeType=J2EEServer,name=geronimo</attribute>
> > > >     </gbean>
> > > > </configuration>
> > > >
> > >
> > >
> >
> 
> 
> --
> Davanum Srinivas - http://webservices.apache.org/~dims/
>

Re: How to start a plan from the Code

Posted by Srinath Perera <he...@gmail.com>.
I do not did anything concreate yet .. will have a try at the next
week and get back
Thanks
Srinath 


On Fri, 3 Dec 2004 07:40:27 -0500, Davanum Srinivas <da...@gmail.com> wrote:
> Srinath,
> 
> Any progress on this?
> 
> Thanks,
> dims
> 
> 
> 
> 
> On Sat, 20 Nov 2004 09:25:43 +0600, Srinath Perera <he...@gmail.com> wrote:
> > > I think what you want to do is use the itest plugin together with the
> > > geronimo maven deploy plugin.  You will have to add a new module to do
> > > this: I suggest itests/webservices.  The good example of how to use
> > > this is openejb itests.  These tests will run only after assembly;
> > > however if you are starting jetty and openejb, what you have is
> > > definitely not a unit test but an integration test.
> >
> > Thanks Daivd; yap it is more like integeration :), .
> >
> > what I want is to start system plan , j2ee-server plan, (with jetty
> > and openejb)  some axis configuration plan and then send SOAP calls.
> > (there is long way to go it seems.)  will look at the plugin!
> > Thanks
> > Srinath
> >
> > > On Nov 19, 2004, at 12:45 AM, Srinath Perera wrote:
> > >
> > > > I am trying to bring up few Gbeans from plan; I am trying to use
> > > > following code.
> > > >
> > > >         ReadOnlyRepository repository = new ReadOnlyRepository(new
> > > > File("temp"));
> > > >         ServiceConfigBuilder scb = new
> > > > ServiceConfigBuilder(null,repository);
> > > >
> > > >         File plan = new File("plan1.xml");
> > > >         ConfigurationDocument configurationDoc =
> > > > ConfigurationDocument.Factory.parse(plan.toURL());
> > > >         File temp = new File("new");
> > > >
> > > >         ConfigurationType conf = configurationDoc.getConfiguration();
> > > >         List confs = scb.buildConfiguration(conf,null,temp);
> > > >         URI uri = new URI(conf.getConfigId());
> > > > ----------------------> Point A
> > > >
> > > >         kernel.startConfiguration(temp.toURI());
> > > >         kernel.stopConfiguration(temp.toURI());
> > > >
> > > > 1) when I run the code the kernel not seem to know about the
> > > > configuration I created at point A, Is there something missing and any
> > > > way to improve this code?
> > > >
> > > > 2) Actually I need to get up J2EE continer, OpenEJB and Jetty
> > > > Contianers up using plans from the code. I think there are plans
> > > > created already (I think it is in assembly) what are the plans I
> > > > should load to get that three contianers up and in what order.
> > > > Thanks
> > > > Srinath
> > > >
> > > > p.s. my plan
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <configuration
> > > >     xmlns="http://geronimo.apache.org/xml/ns/deployment"
> > > >     configId="test/plan1">
> > > >      <!-- Use the default deployer -->
> > > >     <gbean name="test:axis=gb1" class="GBean1">
> > > >         <attribute name="attribute1">Hi</attribute>
> > > >         <attribute name="attribute2"
> > > > type="java.lang.String">geronimo.server:
> > > > j2eeType=J2EEServer,name=geronimo</attribute>
> > > >     </gbean>
> > > > </configuration>
> > > >
> > >
> > >
> >
> 
> 
> --
> Davanum Srinivas - http://webservices.apache.org/~dims/
>

Re: How to start a plan from the Code

Posted by Davanum Srinivas <da...@gmail.com>.
Srinath,

Any progress on this? 

Thanks,
dims


On Sat, 20 Nov 2004 09:25:43 +0600, Srinath Perera <he...@gmail.com> wrote:
> > I think what you want to do is use the itest plugin together with the
> > geronimo maven deploy plugin.  You will have to add a new module to do
> > this: I suggest itests/webservices.  The good example of how to use
> > this is openejb itests.  These tests will run only after assembly;
> > however if you are starting jetty and openejb, what you have is
> > definitely not a unit test but an integration test.
> 
> Thanks Daivd; yap it is more like integeration :), .
> 
> what I want is to start system plan , j2ee-server plan, (with jetty
> and openejb)  some axis configuration plan and then send SOAP calls.
> (there is long way to go it seems.)  will look at the plugin!
> Thanks
> Srinath
> 
> > On Nov 19, 2004, at 12:45 AM, Srinath Perera wrote:
> >
> > > I am trying to bring up few Gbeans from plan; I am trying to use
> > > following code.
> > >
> > >         ReadOnlyRepository repository = new ReadOnlyRepository(new
> > > File("temp"));
> > >         ServiceConfigBuilder scb = new
> > > ServiceConfigBuilder(null,repository);
> > >
> > >         File plan = new File("plan1.xml");
> > >         ConfigurationDocument configurationDoc =
> > > ConfigurationDocument.Factory.parse(plan.toURL());
> > >         File temp = new File("new");
> > >
> > >         ConfigurationType conf = configurationDoc.getConfiguration();
> > >         List confs = scb.buildConfiguration(conf,null,temp);
> > >         URI uri = new URI(conf.getConfigId());
> > > ----------------------> Point A
> > >
> > >         kernel.startConfiguration(temp.toURI());
> > >         kernel.stopConfiguration(temp.toURI());
> > >
> > > 1) when I run the code the kernel not seem to know about the
> > > configuration I created at point A, Is there something missing and any
> > > way to improve this code?
> > >
> > > 2) Actually I need to get up J2EE continer, OpenEJB and Jetty
> > > Contianers up using plans from the code. I think there are plans
> > > created already (I think it is in assembly) what are the plans I
> > > should load to get that three contianers up and in what order.
> > > Thanks
> > > Srinath
> > >
> > > p.s. my plan
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <configuration
> > >     xmlns="http://geronimo.apache.org/xml/ns/deployment"
> > >     configId="test/plan1">
> > >      <!-- Use the default deployer -->
> > >     <gbean name="test:axis=gb1" class="GBean1">
> > >         <attribute name="attribute1">Hi</attribute>
> > >         <attribute name="attribute2"
> > > type="java.lang.String">geronimo.server:
> > > j2eeType=J2EEServer,name=geronimo</attribute>
> > >     </gbean>
> > > </configuration>
> > >
> >
> >
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: How to start a plan from the Code

Posted by Srinath Perera <he...@gmail.com>.
> I think what you want to do is use the itest plugin together with the
> geronimo maven deploy plugin.  You will have to add a new module to do
> this: I suggest itests/webservices.  The good example of how to use
> this is openejb itests.  These tests will run only after assembly;
> however if you are starting jetty and openejb, what you have is
> definitely not a unit test but an integration test.

Thanks Daivd; yap it is more like integeration :), .

what I want is to start system plan , j2ee-server plan, (with jetty
and openejb)  some axis configuration plan and then send SOAP calls.
(there is long way to go it seems.)  will look at the plugin!
Thanks
Srinath

> On Nov 19, 2004, at 12:45 AM, Srinath Perera wrote:
> 
> > I am trying to bring up few Gbeans from plan; I am trying to use
> > following code.
> >
> >         ReadOnlyRepository repository = new ReadOnlyRepository(new
> > File("temp"));
> >         ServiceConfigBuilder scb = new
> > ServiceConfigBuilder(null,repository);
> >
> >         File plan = new File("plan1.xml");
> >         ConfigurationDocument configurationDoc =
> > ConfigurationDocument.Factory.parse(plan.toURL());
> >         File temp = new File("new");
> >
> >         ConfigurationType conf = configurationDoc.getConfiguration();
> >         List confs = scb.buildConfiguration(conf,null,temp);
> >         URI uri = new URI(conf.getConfigId());
> > ----------------------> Point A
> >
> >         kernel.startConfiguration(temp.toURI());
> >         kernel.stopConfiguration(temp.toURI());
> >
> > 1) when I run the code the kernel not seem to know about the
> > configuration I created at point A, Is there something missing and any
> > way to improve this code?
> >
> > 2) Actually I need to get up J2EE continer, OpenEJB and Jetty
> > Contianers up using plans from the code. I think there are plans
> > created already (I think it is in assembly) what are the plans I
> > should load to get that three contianers up and in what order.
> > Thanks
> > Srinath
> >
> > p.s. my plan
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <configuration
> >     xmlns="http://geronimo.apache.org/xml/ns/deployment"
> >     configId="test/plan1">
> >      <!-- Use the default deployer -->
> >     <gbean name="test:axis=gb1" class="GBean1">
> >         <attribute name="attribute1">Hi</attribute>
> >         <attribute name="attribute2"
> > type="java.lang.String">geronimo.server:
> > j2eeType=J2EEServer,name=geronimo</attribute>
> >     </gbean>
> > </configuration>
> >
> 
>

Re: How to start a plan from the Code

Posted by David Jencks <dj...@gluecode.com>.
I think what you want to do is use the itest plugin together with the  
geronimo maven deploy plugin.  You will have to add a new module to do  
this: I suggest itests/webservices.  The good example of how to use  
this is openejb itests.  These tests will run only after assembly;  
however if you are starting jetty and openejb, what you have is  
definitely not a unit test but an integration test.

thanks
david jencks

On Nov 19, 2004, at 12:45 AM, Srinath Perera wrote:

> I am trying to bring up few Gbeans from plan; I am trying to use
> following code.
>
>         ReadOnlyRepository repository = new ReadOnlyRepository(new
> File("temp"));
>         ServiceConfigBuilder scb = new  
> ServiceConfigBuilder(null,repository);
>
>         File plan = new File("plan1.xml");
>         ConfigurationDocument configurationDoc =
> ConfigurationDocument.Factory.parse(plan.toURL());
>         File temp = new File("new");
>
>         ConfigurationType conf = configurationDoc.getConfiguration();
>         List confs = scb.buildConfiguration(conf,null,temp);
>         URI uri = new URI(conf.getConfigId());
> ----------------------> Point A
>
>         kernel.startConfiguration(temp.toURI());
>         kernel.stopConfiguration(temp.toURI());
>
> 1) when I run the code the kernel not seem to know about the
> configuration I created at point A, Is there something missing and any
> way to improve this code?
>
> 2) Actually I need to get up J2EE continer, OpenEJB and Jetty
> Contianers up using plans from the code. I think there are plans
> created already (I think it is in assembly) what are the plans I
> should load to get that three contianers up and in what order.
> Thanks
> Srinath
>
> p.s. my plan
>
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration
>     xmlns="http://geronimo.apache.org/xml/ns/deployment"
>     configId="test/plan1">
>      <!-- Use the default deployer -->
>     <gbean name="test:axis=gb1" class="GBean1">
>         <attribute name="attribute1">Hi</attribute>
>         <attribute name="attribute2"
> type="java.lang.String">geronimo.server: 
> j2eeType=J2EEServer,name=geronimo</attribute>
>     </gbean>
> </configuration>
>