Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit ca66f7e

Browse files
committed
Changed Assembler.assemble() to allow Exception to be thrown (instead of only AssemblyException), so one doesn't need to capture all kind of exceptions in one's Assembler just to re-throw as AssemblyException.
1 parent db99803 commit ca66f7e

79 files changed

Lines changed: 246 additions & 132 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/api/src/main/java/org/apache/polygene/api/common/MetaInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* </p>
5151
* <pre><code>
5252
* public void assemble( ModuleAssembly module )
53-
* throws AssemblyException
53+
* throws Exception
5454
* {
5555
* Map&lt;String,String&gt; properties = ...;
5656
* module.services( MyService.class ).setMetaInfo( properties );

core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public void testSingleModuleSingleService()
7575
{
7676
@Override
7777
public void assemble( ModuleAssembly module )
78-
throws AssemblyException
7978
{
8079
module.services( TestServiceComposite.class ).instantiateOnStartup();
8180
}
@@ -124,7 +123,6 @@ public void testSingleModuleSingleImportedService()
124123
{
125124
@Override
126125
public void assemble( ModuleAssembly module )
127-
throws AssemblyException
128126
{
129127
module.importedServices( TestService.class ).
130128
setMetaInfo( new TestServiceInstance() ).
@@ -176,7 +174,6 @@ public void testSingleModuleSingleLazyService()
176174

177175
@Override
178176
public void assemble( ModuleAssembly module )
179-
throws AssemblyException
180177
{
181178
module.services( TestServiceComposite.class );
182179
}

core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testMultiplePassivationException()
7979

8080
@Test
8181
public void testPassivationExceptionsAccrossStructure()
82-
throws AssemblyException, ActivationException
82+
throws ActivationException
8383
{
8484
ApplicationBuilder appBuilder = new ApplicationBuilder( "TestApplication" );
8585
appBuilder.withLayer( "Layer 1" ).withModule( "Module A" ).withAssembler(

core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class ConfigurationTest extends AbstractPolygeneTest
3838

3939
@Override
4040
public void assemble( ModuleAssembly module )
41-
throws AssemblyException
4241
{
4342
module.services( MyService.class ).instantiateOnStartup();
4443
module.entities( MyConfig.class );

core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public static interface FooConfigurationComposite
6565
}
6666

6767
public void assemble( ModuleAssembly module )
68-
throws AssemblyException
6968
{
7069
module.services( FooServiceComposite.class ).identifiedBy( "bazar" );
7170
module.entities( FooConfigurationComposite.class );

core/api/src/test/java/org/apache/polygene/api/docsupport/ApplicationDocs.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ private static class DummyAssembler implements Assembler
9090
{
9191
@Override
9292
public void assemble( ModuleAssembly module )
93-
throws AssemblyException
9493
{
9594

9695
}
@@ -108,7 +107,6 @@ public static void main( String[] args )
108107
}
109108

110109
private static ApplicationAssembly createAssembly( ApplicationAssemblyFactory factory )
111-
throws AssemblyException
112110
{
113111
String applicationName = "Example Application";
114112
ApplicationAssembly app = factory.newApplicationAssembly();
@@ -142,9 +140,7 @@ private static LayerAssembly createDomainLayer(
142140
return layer;
143141
}
144142

145-
private static LayerAssembly createInfrastructureLayer(
146-
ApplicationAssembly application
147-
)
143+
private static LayerAssembly createInfrastructureLayer( ApplicationAssembly application )
148144
throws AssemblyException
149145
{
150146
LayerAssembly layer = application.layer( "Infrastructure Layer" );
@@ -230,7 +226,6 @@ public JettyAssembler( int port )
230226

231227
@Override
232228
public void assemble( ModuleAssembly module )
233-
throws AssemblyException
234229
{
235230
}
236231
}
@@ -244,7 +239,6 @@ public NeoAssembler( String s )
244239

245240
@Override
246241
public void assemble( ModuleAssembly module )
247-
throws AssemblyException
248242
{
249243
}
250244
}

core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public class StateFieldTest
4545
extends AbstractPolygeneTest
4646
{
4747
public void assemble( ModuleAssembly module )
48-
throws AssemblyException
4948
{
5049
new EntityTestAssembler().assemble( module );
5150
module.entities( PersonEntity.class );

core/api/src/test/java/org/apache/polygene/api/metrics/DocumentationSupport.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ public class MyAssembler implements Assembler
147147
// START SNIPPET: capture
148148
@Override
149149
public void assemble( ModuleAssembly module )
150-
throws AssemblyException
151150
{
152151
module.addServices( Router.class ).identifiedBy( "router1" ).withMixins( RouterAlgorithm1.class );
153152
module.addServices( Router.class ).identifiedBy( "router2" ).withMixins( RouterAlgorithm2.class );

core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class DecoratorMixinTest extends AbstractPolygeneTest
3535
// START SNIPPET: assembly
3636
@Override
3737
public void assemble( ModuleAssembly module )
38-
throws AssemblyException
3938
{
4039
module.transients( View1.class );
4140
module.transients( View2.class );

core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class ObjectBuilderTest
3636
extends AbstractPolygeneTest
3737
{
3838
public void assemble( ModuleAssembly module )
39-
throws AssemblyException
4039
{
4140
module.objects( A.class, B.class, C.class, D.class );
4241
}

0 commit comments

Comments
 (0)