public final PolygeneAPI runtime() { return polygene.spi(); }
public final PolygeneAPI runtime() { return polygene.spi(); }
/** * This method is called from the <code>initialize</code> method to instantiate the Polygene application from the * application model. * * <p> * The default implementation simply calls; * </p> * <pre><code> * application = model.newInstance( polygene.spi() ); * </code></pre> * * @param polygene The Polygene runtime engine. * @param model The application model descriptor. */ protected void instantiateApplication( Energy4Java polygene, ApplicationDescriptor model ) { application = model.newInstance( polygene.spi() ); }
/** * This method is called from the <code>initialize</code> method to instantiate the Polygene application from the * application model. * * <p> * The default implementation simply calls; * </p> * <pre><code> * application = model.newInstance( polygene.spi() ); * </code></pre> * * @param polygene The Polygene runtime engine. * @param model The application model descriptor. */ protected void instantiateApplication( Energy4Java polygene, ApplicationDescriptor model ) { application = model.newInstance( polygene.spi() ); }
@BeforeClass public static void setUp() throws Exception { polygene = new Energy4Java(); applicationModel = newApplication(); if( applicationModel == null ) { // An AssemblyException has occurred that the Test wants to check for. return; } application = applicationModel.newInstance( polygene.spi() ); initApplication( application ); api = spi = polygene.spi(); application.activate(); // Assume only one module module = application.findModule( "Layer 1", "Module 1" ); uowf = module.unitOfWorkFactory(); }
@BeforeClass public static void setUp() throws Exception { polygene = new Energy4Java(); applicationModel = newApplication(); if( applicationModel == null ) { // An AssemblyException has occurred that the Test wants to check for. return; } application = applicationModel.newInstance( polygene.spi() ); initApplication( application ); api = spi = polygene.spi(); application.activate(); // Assume only one module module = application.findModule( "Layer 1", "Module 1" ); uowf = module.unitOfWorkFactory(); }
@Test public void givenValuesOfSameTypesAndDifferentStateWhenTestingValueStateEqualityExpectNotEquals() { Some some = buildSomeValue( valueBuilderFactory ); AssociationStateHolder someState = polygene.spi().stateOf( (ValueComposite) some ); Some some2 = buildSomeValueWithDifferentState( valueBuilderFactory ); AssociationStateHolder some2State = polygene.spi().stateOf( (ValueComposite) some2 ); assertThat( "ValueStates not equal", someState, not( equalTo( some2State ) ) ); assertThat( "ValueStates hashcode not equal", someState.hashCode(), not( equalTo( some2State.hashCode() ) ) ); }
@Test public void givenValuesOfDifferentTypesAndDifferentStateWhenTestingValueStateEqualityExpectNotEquals() { Some some = buildSomeValue( valueBuilderFactory ); AssociationStateHolder someState = polygene.spi().stateOf( (ValueComposite) some ); AnotherSome anotherSome = buildAnotherSomeValueWithDifferentState( valueBuilderFactory ); AssociationStateHolder anotherSomeState = polygene.spi().stateOf( (ValueComposite) anotherSome ); assertThat( "ValueStates not equal", someState, not( equalTo( anotherSomeState ) ) ); assertThat( "ValueStates hashcode not equal", someState.hashCode(), not( equalTo( anotherSomeState.hashCode() ) ) ); }
@Test public void givenValuesOfSameTypesAndSameStateWhenTestingValueStateEqualityExpectEquals() { Some some = buildSomeValue( valueBuilderFactory ); AssociationStateHolder someState = polygene.spi().stateOf( (ValueComposite) some ); Some some2 = buildSomeValue( valueBuilderFactory ); AssociationStateHolder some2State = polygene.spi().stateOf( (ValueComposite) some2 ); assertThat( "ValueStates equal", someState, equalTo( some2State ) ); assertThat( "ValueStates hashcode equal", someState.hashCode(), equalTo( some2State.hashCode() ) ); }
@Test public void givenValuesOfDifferentTypesAndSameStateWhenTestingValueStateEqualityExpectEquals() { Some some = buildSomeValue( valueBuilderFactory ); AssociationStateHolder someState = polygene.spi().stateOf( (ValueComposite) some ); AnotherSome anotherSome = buildAnotherSomeValue( valueBuilderFactory ); AssociationStateHolder anotherSomeState = polygene.spi().stateOf( (ValueComposite) anotherSome ); assertThat( "ValueStates equal", someState, equalTo( anotherSomeState ) ); assertThat( "ValueStates hashcode equal", someState.hashCode(), equalTo( anotherSomeState.hashCode() ) ); }
@Before public void setUp() throws Exception { polygene = new Energy4Java(); applicationModel = newApplicationModel(); if( applicationModel == null ) { // An AssemblyException has occurred that the Test wants to check for. return; } application = newApplicationInstance( applicationModel ); initApplication( application ); api = spi = polygene.spi(); application.activate(); }
@Before public void setUp() throws Exception { polygene = new Energy4Java(); applicationModel = newApplicationModel(); if( applicationModel == null ) { // An AssemblyException has occurred that the Test wants to check for. return; } application = newApplicationInstance( applicationModel ); initApplication( application ); api = spi = polygene.spi(); application.activate(); }
public static void main( String[] args ) throws Exception { polygene = new Energy4Java(); ApplicationDescriptor model = polygene.newApplicationModel( factory -> createAssembly( factory ) ); Application application = model.newInstance( polygene.spi() ); }
Application runtime = model.newInstance( polygene.spi() ); runtime.activate();
model.newInstance( polygene.spi() );