public String name() { return module.name(); } }
@Override public String hello() { module.name(); return "Hello Polygene!"; } }
/** * Build a Metric name for the given Module, Method and optional fragments. * * @param module Module * @param method Method * @param fragments Name fragments * @return Metric name */ public static String nameFor( Module module, Method method, String... fragments ) { StringJoiner joiner = new StringJoiner( "." ) .add( module.layer().name() ) .add( module.name() ) .add( className( method.getDeclaringClass() ) ) .add( method.getName() ); for( String fragment : fragments ) { joiner.add( fragment ); } return joiner.toString(); }
/** * Build a Metric name for the given Module, Method and optional fragments. * * @param module Module * @param method Method * @param fragments Name fragments * @return Metric name */ public static String nameFor( Module module, Method method, String... fragments ) { StringJoiner joiner = new StringJoiner( "." ) .add( module.layer().name() ) .add( module.name() ) .add( className( method.getDeclaringClass() ) ) .add( method.getName() ); for( String fragment : fragments ) { joiner.add( fragment ); } return joiner.toString(); }
/** * Build a Metric name for the given Module, Type and optional fragments. * * @param module Module * @param type Type * @param fragments Name fragments * @return Metric name */ public static String nameFor( Module module, Class<?> type, String... fragments ) { StringJoiner joiner = new StringJoiner( "." ) .add( module.layer().name() ) .add( module.name() ) .add( className( type ) ); for( String fragment : fragments ) { joiner.add( fragment ); } return joiner.toString(); }
/** * Build a Metric name for the given Module, Type and optional fragments. * * @param module Module * @param type Type * @param fragments Name fragments * @return Metric name */ public static String nameFor( Module module, Class<?> type, String... fragments ) { StringJoiner joiner = new StringJoiner( "." ) .add( module.layer().name() ) .add( module.name() ) .add( className( type ) ); for( String fragment : fragments ) { joiner.add( fragment ); } return joiner.toString(); }
@Test public void givenFixture1WhenGetNameThenConfiguredNameIsReturned() throws AssemblyException { Application app = givenFixture1(); Module module = app.findModule( "Layer 1", "Module 1" ).newTransient( TestComposite1.class ).getModule(); assertThat( "module name is correct", module.name(), equalTo( "Module 1" ) ); }
public String hello( @MaxLength( 5 ) String name ) { try { String from = data.foo().get(); if( from.length() == 0 ) { from = module.name(); } return "Hello " + name + " from " + from; } finally { data.foo().set( name ); } }
@Test public void testBindings() { DomainType domain = transientBuilderFactory.newTransient( DomainType.class ); Object _this = domain.whatIsThis(); assertThat( _this, instanceOf(DomainType.class)); assertThat( _this, instanceOf(TransientComposite.class ) ); StateHolder state = domain.whatIsState( ); assertThat( state.properties(), notNullValue()); Application app = domain.whatIsApplication( ); assertThat( app.name(), equalTo("Script Test")); Layer layer = domain.whatIsLayer(); assertThat( layer.name(), equalTo("Layer 1")); Module module = domain.whatIsModule(); assertThat( module.name(), equalTo("Module 1")); ObjectFactory of = domain.whatIsObjectFactory( ); assertThat( of, notNullValue()); UnitOfWorkFactory uowf = domain.whatIsUnitOfWorkFactory( ); assertThat( uowf, notNullValue()); ValueBuilderFactory vbf = domain.whatIsValueBuilderFactory( ); assertThat( vbf, notNullValue()); TransientBuilderFactory tbf = domain.whatIsTransientBuilderFactory( ); assertThat( tbf, notNullValue()); ServiceFinder finder = domain.whatIsServiceFinder( ); assertThat( finder, notNullValue()); TypeLookup lookup = domain.whatIsTypeLookup( ); assertThat( lookup, notNullValue()); }