Discussion:
How to reference Parameter.ZERO with Ruby Builder?
Michael Rimov
2008-11-01 06:13:33 UTC
Permalink
Hi All,

I've never really played with the Ruby language or builder, but since
I've had compilation performance problems with Groovy, I've been
writing a scripting language comparison test case to get an idea of
where all the different builders stood with each other
performance-wise.

However, I've been unable to figure out how to reference
Pararameter.ZERO from Ruby. Currently my test case looks like this:
@Test
public void testParameterZero() {
Reader script = new StringReader("" +
"import org.picocontainer.Parametern" +
"n" +
"container{n" +
" component(:class => java.util.ArrayList,
:parameters => Parameter::ZERO)n" +
" component(:class => java.util.HashSet,
:parameters => Parameter::ZERO)n" +
"}n"
);
PicoContainer pico = buildContainer(script, null,
ASSEMBLY_SCOPE);
assertNotNull(pico.getComponent(ArrayList.class));

assertNotNull(pico.getComponent(HashSet.class));
}
However, I get a CyclicDependencyException much as if I hadn't
specified Parameter.ZERO in the first place. Any clues?

Thanks :)
-Mike (R)
Paul Hammant
2008-11-01 18:28:44 UTC
Permalink
Well the Ruby capability is not as advanced as the Groovy one. Dave
Astels has me on a promise to do some pairing one lunch time to work
through it and make it more idiomatically correct. How's your Ruby
Mike ?

If you're running the same builder script over and over, the JRuby one
should me progressively more preferment.


Regards,

- Paul
Post by Michael Rimov
Hi All,
I've never really played with the Ruby language or builder, but
since I've had compilation performance problems with Groovy, I've
been writing a scripting language comparison test case to get an
idea of where all the different builders stood with each other
performance-wise.
However, I've been unable to figure out how to reference
@Test
public void testParameterZero() {
Reader script = new StringReader("" +
"import org.picocontainer.Parameter\n" +
"\n" +
"container{\n" +
" component(:class =>
java.util.ArrayList, :parameters => Parameter::ZERO)\n" +
" component(:class =>
java.util.HashSet, :parameters => Parameter::ZERO)\n" +
"}\n"
);
PicoContainer pico = buildContainer(script, null,
ASSEMBLY_SCOPE);
assertNotNull(pico.getComponent(ArrayList.class));
assertNotNull(pico.getComponent(HashSet.class));
}
However, I get a CyclicDependencyException much as if I hadn't
specified Parameter.ZERO in the first place. Any clues?
Thanks :)
-Mike (R)
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...