Migrating to JUnit5. Intermediary build where all tests of phase 1 compiles, but not necessarily succeeds.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/6ae17138 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/6ae17138 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/6ae17138 Branch: refs/heads/develop Commit: 6ae17138f62295ea4d6d38e58924d8d444373371 Parents: e647b59 Author: Niclas Hedhman <nic...@hedhman.org> Authored: Sun Apr 15 13:53:48 2018 +0800 Committer: Niclas Hedhman <nic...@hedhman.org> Committed: Sun Apr 15 13:53:58 2018 +0800 ---------------------------------------------------------------------- .../fonts/Asap-FontZillion/Fonts/asap-bold.ttf | Bin 30352 -> 0 bytes .../Asap-FontZillion/Fonts/asap-bolditalic.ttf | Bin 32220 -> 0 bytes .../Asap-FontZillion/Fonts/asap-italic.ttf | Bin 32032 -> 0 bytes .../Asap-FontZillion/Fonts/asap-regular.ttf | Bin 30740 -> 0 bytes .../org/apache/polygene/api/OperatorsTest.java | 12 +- .../api/activation/ActivationEventsTest.java | 19 +- .../activation/PassivationExceptionTest.java | 6 +- .../polygene/api/annotation/MixinsTest.java | 13 +- .../polygene/api/annotation/ModifiedByTest.java | 13 +- .../api/annotation/scope/ModifiesTest.java | 13 +- .../polygene/api/common/AppliesToTest.java | 13 +- .../polygene/api/common/QualifiedNameTest.java | 45 ++- .../api/composite/PropertyMapperTest.java | 141 +++---- .../api/configuration/ConfigurationTest.java | 4 +- .../DeclareConfigurationDefaultsTest.java | 20 +- .../api/injection/scope/StateFieldTest.java | 17 +- .../polygene/api/injection/scope/ThisTest.java | 13 +- .../decoratorMixin/DecoratorMixinTest.java | 6 +- .../polygene/api/object/ObjectBuilderTest.java | 13 +- .../api/property/PropertyErrorTest.java | 31 +- .../api/type/HasTypesCollectorsTest.java | 15 +- .../api/type/HasTypesPredicatesTest.java | 48 +-- .../polygene/api/type/ValueTypeFactoryTest.java | 8 +- .../polygene/api/unitofwork/RemovalTest.java | 2 +- .../api/unitofwork/ToEntityConversionTest.java | 4 +- .../api/unitofwork/ToValueConversionTest.java | 4 +- .../api/unitofwork/UnitOfWorkTemplateTest.java | 4 +- .../apache/polygene/api/util/ClassesTest.java | 4 +- .../polygene/api/util/CollectorsTest.java | 11 +- .../api/value/DocumentationSupport.java | 4 +- .../api/value/ValueBuilderTemplateTest.java | 2 +- .../polygene/api/value/ValueCompositeTest.java | 75 ++-- .../bootstrap/AssemblySpecificationTest.java | 4 +- .../polygene/bootstrap/ClassScannerTest.java | 9 +- .../LayeredApplicationAssemblerTest.java | 4 +- .../builder/ApplicationBuilderTest.java | 4 +- .../polygene/api/common/OptionalTest.java | 49 +-- .../polygene/api/common/PropertyErrorTest.java | 30 +- .../polygene/api/common/PropertyTypeTest.java | 5 +- .../apache/polygene/api/common/RemovalTest.java | 2 +- .../polygene/api/common/ValueCompositeTest.java | 52 +-- .../bootstrap/ApplicationAssemblerTest.java | 13 +- .../polygene/bootstrap/ErrorReportingTest.java | 4 +- .../polygene/bootstrap/RuntimeMixinsTest.java | 4 +- .../polygene/bootstrap/ServiceAssemblyTest.java | 4 +- .../constraints/PropertyConstraintTest.java | 20 +- .../constraints/ValueConstraintTest.java | 12 +- .../regression/qi230/Qi230IssueTest.java | 13 +- ...faceCollisionWithRelatedReturnTypesTest.java | 10 +- .../polygene/regression/qi377/IssueTest.java | 4 +- .../qi377/SetAssociationInSideEffectTest.java | 4 +- ...alueCollisionWithRelatedReturnTypesTest.java | 2 +- .../polygene/regression/qi382/Qi382Test.java | 4 +- .../polygene/regression/qi383/Qi383Test.java | 22 +- .../polygene/regression/qi53/IssueTest.java | 11 +- .../polygene/regression/qi55/IssueTest.java | 7 +- .../polygene/regression/qi59/IssueTest.java | 6 +- .../polygene/regression/qi65/IssueTest.java | 12 +- .../polygene/regression/qi74/IssueTest.java | 7 +- .../polygene/regression/qi78/IssueTest.java | 8 +- .../polygene/regression/qi94/IssueTest.java | 17 +- .../polygene/runtime/PolygeneAPITest.java | 2 +- .../polygene/runtime/PolygeneSPITest.java | 6 +- .../activation/ApplicationActivationTest.java | 16 +- .../ImportedServiceActivationTest.java | 90 ++--- .../IntraMixinActivationOrderTest.java | 11 +- .../runtime/activation/LayerActivationTest.java | 16 +- .../activation/ModuleActivationTest.java | 10 +- .../activation/ServiceActivationTest.java | 60 +-- .../activation/ServiceActivatorOrderTest.java | 17 +- .../activation/StructureActivatorOrderTest.java | 148 ++++---- .../runtime/appliesto/AppliesToFilterTest.java | 14 +- .../AppliesToOrConditionQI241Test.java | 11 +- .../runtime/appliesto/AppliesToTest.java | 16 +- .../appliesto/FragmentAppliesToTest.java | 15 +- .../association/AssociationAssignmentTest.java | 4 +- .../association/AssociationEqualityTest.java | 6 +- .../DereferenceForBootstrappedConcernsTest.java | 13 +- .../runtime/composite/AbstractMixinTest.java | 10 +- .../composite/CompositeFactoryImplTest.java | 18 +- .../composite/CompositeModelResolverTest.java | 8 +- .../runtime/composite/FunctionalListTest.java | 4 +- .../composite/InterfaceDefaultMethodsTest.java | 8 +- .../composite/InterfaceStaticMethodsTest.java | 4 +- .../runtime/composite/MapOverrideTest.java | 35 +- .../polygene/runtime/composite/QI247Test1.java | 20 +- .../polygene/runtime/composite/QI247Test2.java | 22 +- .../polygene/runtime/composite/QI256Test.java | 147 +++++--- .../runtime/composite/TransientAsClassTest.java | 6 +- .../runtime/composite/UsageGraphTest.java | 262 ++++++------- .../runtime/composite/UseCompositeTest.java | 4 +- .../runtime/concerns/GenericConcernTest.java | 2 +- .../runtime/concerns/MethodConcernsTest.java | 4 +- .../runtime/concerns/ModuleConcernTest.java | 4 +- .../concerns/PropertyInheritanceTest.java | 4 +- .../runtime/constraints/ConstraintsTest.java | 19 +- .../runtime/defaults/UseDefaultsTest.java | 26 +- .../polygene/runtime/entity/AggregatedTest.java | 6 +- .../entity/EntityBuilderWithStateTest.java | 2 +- .../entity/EntityCompositeEqualityTest.java | 14 +- .../entity/EntityCompositeToStringTest.java | 4 +- .../runtime/entity/EntityCreationTest.java | 2 +- .../polygene/runtime/entity/EntityTypeTest.java | 2 +- .../runtime/entity/EntityVisibilityTest.java | 360 ++++++++++-------- .../polygene/runtime/entity/LifecycleTest.java | 4 +- .../polygene/runtime/entity/QI273Test.java | 8 +- .../entity/associations/AssociationTest.java | 19 +- .../associations/ImmutableAssociationTest.java | 91 ++--- .../injection/ActivatorInjectionTest.java | 4 +- .../ConstructorInjectionOfThisTest.java | 7 +- .../IllegalUnitOfWorkInjectionTest.java | 6 +- .../injection/InvocationInjectionTest.java | 37 +- .../runtime/injection/ServiceInjectionTest.java | 30 +- .../injection/StateDescriptorInjectionTest.java | 4 +- .../runtime/injection/StateInjectionTest.java | 4 +- .../injection/StateParameterInjectionTest.java | 4 +- .../injection/StructureInjectionTest.java | 4 +- .../runtime/injection/ThisInjectionTest.java | 25 +- .../injection/UnitOfWorkInjectionTest.java | 9 +- .../runtime/injection/UsesGenericClassTest.java | 6 +- .../runtime/injection/UsesGenericListTest.java | 2 +- .../runtime/injection/UsesGraphTest.java | 14 +- .../runtime/injection/UsesInjectionTest.java | 4 +- .../ConfigurationInstantiationTest.java | 4 +- .../EagerServiceInstantiationTest.java | 7 +- .../ServiceInstantiationTests.java | 10 +- .../TransientInstantiationTests.java | 8 +- .../instantiation/ValueInstantiationTests.java | 9 +- .../runtime/methods/AccessibleTest.java | 6 +- .../runtime/mixin/AssemblyMixinTest.java | 4 +- .../runtime/mixin/AssemblyRoleTest.java | 4 +- .../runtime/mixin/DefaultMethodsTest.java | 8 +- .../runtime/mixin/InitializableTest.java | 15 +- .../InvokeServiceFromModuleAssemblyTest.java | 6 +- .../polygene/runtime/mixin/JDKMixinTest.java | 8 +- .../mixin/MethodInterceptionMixinTest.java | 11 +- .../runtime/mixin/MixinPrecedenceTest.java | 7 +- .../mixin/MixinsOnThisInjectionTest.java | 4 +- .../runtime/mixin/PrivateMixinTest.java | 6 +- .../polygene/runtime/mixin/Qi228Test.java | 4 +- .../objects/ObjectBuilderFactoryTest.java | 38 +- .../runtime/objects/ObjectConcernTest.java | 2 +- .../runtime/objects/ObjectVisibilityTest.java | 364 ++++++++++-------- .../runtime/property/ImmutablePropertyTest.java | 31 +- .../runtime/property/PropertyEqualityTest.java | 4 +- .../property/PropertyStringArrayTest.java | 6 +- .../polygene/runtime/property/PropertyTest.java | 11 +- .../property/ValueNestedBuilderTest.java | 2 +- .../runtime/query/IterableQuerySourceTest.java | 17 +- .../runtime/query/NonQueryableTest.java | 8 +- .../query/QueryBuilderFactoryImplTest.java | 17 +- .../runtime/service/ActivatableServiceTest.java | 27 +- .../runtime/service/AvailableServiceTest.java | 4 +- .../runtime/service/ComplexActivatableTest.java | 24 +- .../service/ConfigurationConstraintTest.java | 33 +- .../runtime/service/ConfigurationTest.java | 4 +- .../service/LazyActivatedServiceTest.java | 17 +- .../runtime/service/PassivationTest.java | 63 ++-- .../runtime/service/ServiceFinderTest.java | 6 +- .../runtime/service/ServiceIdSelectorTest.java | 4 +- .../runtime/service/ServiceVisibilityTest.java | 374 +++++++++++-------- .../sideeffects/GenericSideEffectTest.java | 6 +- .../sideeffects/ModuleSideEffectTest.java | 9 +- .../sideeffects/SampleTransientTest.java | 6 +- .../sideeffects/SpecificSideEffectTest.java | 4 +- .../runtime/structure/ApplicationModeTest.java | 20 +- .../structure/CompositeDescriptorTest.java | 25 +- .../runtime/structure/MixinVisibilityTest.java | 232 ++++++------ .../polygene/runtime/structure/ModuleTest.java | 4 +- .../NoSuchEntityTypeExceptionTest.java | 7 +- .../PrivateCompositeVisibilityTest.java | 40 +- .../runtime/structure/StructureTest.java | 2 +- .../structure/TypeToCompositeLookupTest.java | 83 ++-- .../runtime/threaded/ContextCompositeTest.java | 13 +- .../transients/TransientBuilderFactoryTest.java | 89 +++-- .../transients/TransientVisibilityTest.java | 360 ++++++++++-------- .../unitofwork/AutoCloseableUoWTest.java | 25 +- .../unitofwork/PrivateEntityUnitOfWorkTest.java | 4 +- .../runtime/unitofwork/RemovalTest.java | 11 +- .../unitofwork/UnitOfWorkFactoryTest.java | 9 +- .../polygene/runtime/util/AnnotationsTest.java | 13 +- .../runtime/value/AssociationToValueTest.java | 4 +- .../runtime/value/NestedValueBuilderTest.java | 4 +- .../runtime/value/ValueComposite2Test.java | 25 +- .../runtime/value/ValueCompositeBasicsTest.java | 17 +- .../runtime/value/ValueEqualityTest.java | 8 +- .../ValueInjectionDeserializationTest.java | 15 +- .../value/ValueSerializationRegressionTest.java | 2 +- .../runtime/value/ValueVisibilityTest.java | 360 ++++++++++-------- .../runtime/value/ValueWithAssociationTest.java | 4 +- .../visibility/VisibilityInUnitOfWorkTest.java | 2 +- .../service/importer/InstanceImporterTest.java | 4 +- .../service/importer/NewObjectImporterTest.java | 11 +- .../importer/ServiceInstanceImporterTest.java | 9 +- .../importer/ServiceSelectorImporterTest.java | 6 +- .../java/org/apache/polygene/test/ASMTest.java | 55 ++- .../test/composite/CleanStackTraceTest.java | 14 +- .../spi/entitystore/Polygene142Test.java | 2 +- .../helpers/JSONManyAssociationStateTest.java | 10 +- .../helpers/JsonNamedAssociationStateTest.java | 4 +- .../spi/metrics/DefaultMetricsTest.java | 9 +- .../spi/property/DefaultValuesTest.java | 4 +- .../polygene/test/AbstractPolygeneBaseTest.java | 13 +- .../test/AbstractPolygeneScenarioTest.java | 8 +- .../polygene/test/AbstractPolygeneTest.java | 8 +- .../polygene/test/PolygeneUnitExtension.java | 2 - .../test/cache/AbstractCachePoolTest.java | 29 +- .../cache/AbstractEntityStoreWithCacheTest.java | 4 +- ...bstractConfigurationDeserializationTest.java | 4 +- .../test/entity/AbstractEntityStoreTest.java | 10 +- ...stractPolygeneMultiLayeredTestWithModel.java | 17 - .../test/entity/model/EntityStoreTestSuite.java | 86 +++-- .../test/indexing/AbstractComplexQueryTest.java | 4 +- .../test/indexing/AbstractEntityFinderTest.java | 15 +- .../test/indexing/AbstractNamedQueryTest.java | 10 +- .../test/indexing/AbstractQueryTest.java | 49 ++- .../polygene/test/indexing/NameableAssert.java | 4 +- .../AbstractMultiLayeredIndexingTest.java | 6 +- .../test/indexing/layered/Suite1Case1.java | 2 +- .../test/indexing/layered/Suite1Case2.java | 2 +- .../metrics/AbstractPolygeneMetricsTest.java | 4 +- .../test/metrics/AbstractTimingCaptureTest.java | 4 +- .../AbstractCollectionSerializationTest.java | 39 +- .../AbstractConvertersSerializationTest.java | 4 +- .../AbstractPlainValueSerializationTest.java | 6 +- ...AbstractValueCompositeSerializationTest.java | 29 +- .../org/apache/polygene/test/util/Assume.java | 21 +- .../apache/polygene/test/util/JmxFixture.java | 14 +- .../polygene/test/util/NotYetImplemented.java | 80 ++-- .../apache/polygene/test/util/RepeatRule.java | 62 --- .../apache/polygene/test/util/RetryRule.java | 72 ---- .../polygene/test/cache/RetryRuleTest.java | 39 -- .../apache/polygene/test/junit5/Junit5Test.java | 7 +- dependencies.gradle | 334 ++++++++--------- etc/codestyle-idea.jar | Bin 1753 -> 0 bytes extensions/cache-ehcache/build.gradle | 1 + extensions/entitystore-berkeleydb/build.gradle | 1 + extensions/entitystore-file/build.gradle | 1 + .../hazelcast/HazelcastEntityStoreTest.java | 6 +- .../HazelcastEntityStoreTestSuite.java | 4 +- extensions/entitystore-jclouds/build.gradle | 1 + extensions/entitystore-jdbm/build.gradle | 1 + extensions/entitystore-leveldb/build.gradle | 1 + extensions/entitystore-preferences/build.gradle | 1 + extensions/entitystore-sql/build.gradle | 3 +- extensions/entitystore-sqlkv/build.gradle | 2 +- extensions/indexing-elasticsearch/build.gradle | 2 +- .../elasticsearch/ElasticSearchQueryTest.java | 2 +- .../index/elasticsearch/ElasticSearchTest.java | 33 +- .../index/elasticsearch/ImmenseTermTest.java | 4 +- extensions/indexing-rdf/build.gradle | 1 + .../polygene/index/rdf/ContainsAllTest.java | 24 +- .../apache/polygene/index/rdf/ContainsTest.java | 41 +- .../polygene/index/rdf/RDFPerformanceTest.java | 2 +- .../apache/polygene/index/rdf/RdfQueryTest.java | 2 +- .../index/rdf/qi173/Qi173IssueTest.java | 32 +- .../withPropagationMandatory/IssueTest.java | 37 +- .../qi64/withPropagationRequired/IssueTest.java | 23 +- .../withPropagationRequiresNew/IssueTest.java | 23 +- .../polygene/index/rdf/qi66/Qi66IssueTest.java | 9 +- .../polygene/index/rdf/qi95/Qi95IssueTest.java | 20 +- extensions/indexing-solr/build.gradle | 1 + .../index/solr/SolrQueryServiceTest.java | 18 +- .../postgresql/PostgreSQLDBIntegrityTest.java | 2 +- .../sql/postgresql/PostgreSQLQueryTest.java | 2 +- .../metrics/codahale/CodahaleMetricsTest.java | 6 +- .../polygene/migration/MigrationTest.java | 4 +- extensions/reindexer/build.gradle | 1 + .../polygene/index/reindexer/ReindexerTest.java | 9 +- .../javaxjson/CustomJsonAdapterTest.java | 4 +- .../javaxjson/HandCraftedJsonTest.java | 4 +- .../JavaxJsonCollectionSerializationTest.java | 6 +- ...avaxJsonValueCompositeSerializationTest.java | 4 +- .../javaxxml/HandCraftedXmlTest.java | 4 +- .../javaxxml/JavaxXmlAdaptersTest.java | 4 +- ...JavaxXmlValueCompositeSerializationTest.java | 4 +- internals/testsupport-internal/build.gradle | 3 +- .../library/alarm/AlarmHistoryImplTest.java | 100 ++--- .../library/alarm/AlarmPointImplTest.java | 41 +- .../polygene/library/alarm/AlarmProxyTest.java | 4 +- .../library/alarm/AlarmServiceTest.java | 38 +- .../library/alarm/ExtendedAlarmModelTest.java | 266 ++++++------- .../library/alarm/SimpleAlarmModelTest.java | 76 ++-- .../library/alarm/StandardAlarmModelTest.java | 121 +++--- .../library/appbrowser/AppBrowserTest.java | 2 +- .../BreaksCircuitOnThrowableTest.java | 46 ++- .../circuitbreaker/CircuitBreakerTest.java | 8 +- .../library/constraints/ConstraintTest.java | 149 ++++---- .../constraints/HostPortConstraintTest.java | 20 +- .../constraints/HostPortListConstraintTest.java | 36 +- .../library/constraints/qi70/IssueTest.java | 12 +- libraries/fileconfig/build.gradle | 1 + .../fileconfig/FileConfigurationTest.java | 26 +- libraries/http/build.gradle | 1 + .../library/http/AbstractJettyTest.java | 14 +- .../library/http/JettyJMXStatisticsTest.java | 6 +- .../polygene/library/http/JettyServiceTest.java | 21 +- .../http/MutualSecureJettyServiceTest.java | 11 +- .../library/http/SecureJettyServiceTest.java | 11 +- .../http/VirtualHostJettyServiceTest.java | 17 +- .../apache/polygene/library/jmx/JMXTest.java | 2 +- .../polygene/library/locking/LockingTest.java | 9 +- .../polygene/library/logging/DebuggingTest.java | 11 +- .../polygene/library/logging/TracingTest.java | 57 +-- .../polygene/library/osgi/OSGiServiceTest.java | 9 +- libraries/rdf/build.gradle | 1 + .../library/rdf/ApplicationXmlTest.java | 2 +- .../polygene/library/rdf/Model2XMLTest.java | 2 +- .../rdf/entity/EntitySerializerTest.java | 2 +- .../rdf/entity/EntityTypeSerializerTest.java | 2 +- .../rdf/repository/MemoryRepositoryTest.java | 13 +- .../rdf/repository/NativeRepositoryTest.java | 9 +- .../ContextResourceClientFactoryTest.java | 42 +-- .../rest/client/ContinuousIntegrationTest.java | 16 +- .../library/rest/client/RssReaderTest.java | 6 +- .../rest/client/docsupport/RestPrimerDocs.java | 6 +- .../polygene/library/rest/admin/RestTest.java | 52 +-- .../polygene/library/restlet/FormField.java | 105 ------ .../library/restlet/PolygeneEntityRestlet.java | 310 --------------- .../restlet/PolygeneRestApplication.java | 226 ----------- .../polygene/library/restlet/RestForm.java | 48 --- .../restlet/crud/EntityListResource.java | 118 ------ .../library/restlet/crud/EntityResource.java | 221 ----------- .../restlet/repository/CrudRepository.java | 51 --- .../repository/SmallCrudRepositoryMixin.java | 122 ------ .../restlet/resource/CreationParameterized.java | 33 -- .../restlet/resource/CreationResource.java | 118 ------ .../restlet/resource/EntryPointResource.java | 97 ----- .../restlet/resource/ResourceBuilder.java | 178 --------- .../library/scripting/HelloSpeakerTest.java | 4 +- .../library/scripting/ScriptMixinTest.java | 4 +- .../polygene/library/servlet/ServletTest.java | 31 +- .../library/shiro/PasswordDomainTest.java | 22 +- .../library/shiro/PermissionsDomainTest.java | 22 +- .../library/shiro/RealmServiceTest.java | 25 +- .../library/shiro/StandaloneShiroTest.java | 29 +- .../library/shiro/web/WebHttpShiroTest.java | 4 +- .../library/shiro/web/WebRealmServiceTest.java | 18 +- .../library/shiro/web/WebServletShiroTest.java | 9 +- libraries/spring/build.gradle | 1 + .../bootstrap/PolygeneExportServiceTest.java | 19 +- .../importer/PolygeneImportServiceTest.java | 4 +- .../generator/AbstractDataDefinitionTest.java | 2 +- .../sql/generator/AbstractModificationTest.java | 2 +- .../sql/generator/AbstractQueryTest.java | 2 +- .../sql/generator/AbstractSQLSyntaxTest.java | 19 +- .../library/sql/generator/MySQLQueryTest.java | 2 +- .../generator/PostgreSQLModificationTest.java | 2 +- .../sql/generator/PostgreSQLQueryTest.java | 2 +- .../sql/liquibase/LiquibaseServiceTest.java | 7 +- .../sql/datasource/ExternalDataSourceTest.java | 2 +- ...taSourceConfigurationManagerServiceTest.java | 2 +- .../uid/sequence/PersistingSequencingTest.java | 23 +- .../uid/sequence/TransientSequencingTest.java | 27 +- .../library/uid/uuid/UuidServiceTest.java | 25 +- libraries/uowfile/build.gradle | 1 + .../library/uowfile/HasUoWFileTest.java | 17 +- .../library/uowfile/HasUoWFilesTest.java | 17 +- .../moneytransfer/test/TransferMoneyTest.java | 55 +-- .../moneytransfer/test/TransferMoneyTest2.java | 55 +-- .../AbstractEntityStorePerformanceTest.java | 6 +- .../PostgreSQLEntityStorePerformanceTest.java | 4 +- .../indexing/rdf/QueryPerformanceTest.java | 16 +- .../CompositeCreationPerformanceTest.java | 2 +- .../composite/InvocationPerformanceTest.java | 2 +- .../PropertyMixinInvocationPerformanceTest.java | 2 +- .../object/ObjectCreationPerformanceTest.java | 2 +- .../ServiceInvocationPerformanceTest.java | 5 +- .../test/regression/ConcernsOnPropertyTest.java | 7 +- .../envisage/sample/EnvisageSample.java | 8 +- .../RestAPIApplication/bootstrap-test.tmpl | 2 +- .../tools/model/DocumentationSupport.java | 4 +- .../tools/model/VisitableDetailTest.java | 10 +- .../tutorials/cargo/step1/Step1TestCase.java | 28 +- .../cargo/step2/SequencingConcernTest.java | 10 +- .../tutorials/cargo/step2/Step2TestCase.java | 23 +- .../composites/tutorial1/HelloWorldTest.java | 10 +- .../composites/tutorial10/HelloWorldTest.java | 10 +- .../composites/tutorial2/HelloWorldTest.java | 10 +- .../composites/tutorial3/HelloWorldTest.java | 10 +- .../composites/tutorial4/HelloWorldTest.java | 10 +- .../composites/tutorial5/HelloWorldTest.java | 10 +- .../composites/tutorial6/HelloWorldTest.java | 10 +- .../composites/tutorial7/HelloWorldTest.java | 10 +- .../composites/tutorial8/HelloWorldTest.java | 10 +- .../composites/tutorial9/HelloWorldTest.java | 10 +- .../polygene/tutorials/hello/HelloTest.java | 6 +- .../polygene/tutorials/hello/HelloTest2.java | 4 +- .../polygene/tutorials/hello/HelloTest3.java | 4 +- .../polygene/tutorials/hello/HelloTest4.java | 4 +- .../tutorials/services/step1/LibraryTest.java | 2 +- .../tutorials/services/step2/LibraryTest.java | 4 +- .../tutorials/services/step3/LibraryTest.java | 4 +- .../tutorials/services/step4/LibraryTest.java | 4 +- .../tutorials/services/step5/LibraryTest.java | 2 +- .../tutorials/services/step6/LibraryTest.java | 4 +- 396 files changed, 4554 insertions(+), 5750 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/artwork/fonts/Asap-FontZillion/Fonts/asap-bold.ttf ---------------------------------------------------------------------- diff --git a/artwork/fonts/Asap-FontZillion/Fonts/asap-bold.ttf b/artwork/fonts/Asap-FontZillion/Fonts/asap-bold.ttf deleted file mode 100644 index 6386c6b..0000000 Binary files a/artwork/fonts/Asap-FontZillion/Fonts/asap-bold.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/artwork/fonts/Asap-FontZillion/Fonts/asap-bolditalic.ttf ---------------------------------------------------------------------- diff --git a/artwork/fonts/Asap-FontZillion/Fonts/asap-bolditalic.ttf b/artwork/fonts/Asap-FontZillion/Fonts/asap-bolditalic.ttf deleted file mode 100644 index 0b482d4..0000000 Binary files a/artwork/fonts/Asap-FontZillion/Fonts/asap-bolditalic.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/artwork/fonts/Asap-FontZillion/Fonts/asap-italic.ttf ---------------------------------------------------------------------- diff --git a/artwork/fonts/Asap-FontZillion/Fonts/asap-italic.ttf b/artwork/fonts/Asap-FontZillion/Fonts/asap-italic.ttf deleted file mode 100644 index e140cee..0000000 Binary files a/artwork/fonts/Asap-FontZillion/Fonts/asap-italic.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/artwork/fonts/Asap-FontZillion/Fonts/asap-regular.ttf ---------------------------------------------------------------------- diff --git a/artwork/fonts/Asap-FontZillion/Fonts/asap-regular.ttf b/artwork/fonts/Asap-FontZillion/Fonts/asap-regular.ttf deleted file mode 100644 index df5d822..0000000 Binary files a/artwork/fonts/Asap-FontZillion/Fonts/asap-regular.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java b/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java index 9f3be8e..f8393a3 100644 --- a/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java @@ -35,8 +35,10 @@ import org.apache.polygene.api.unitofwork.UnitOfWorkFactory; import org.apache.polygene.api.value.ValueComposite; import org.apache.polygene.bootstrap.SingletonAssembler; import org.apache.polygene.test.EntityTestAssembler; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; /** * TODO @@ -77,7 +79,7 @@ public class OperatorsTest { Predicate<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class ) .foo(), "Bar" ); - Assert.assertTrue( where.test( testEntity ) ); + assertThat( where.test( testEntity ), is( true ) ); System.out.println( where ); } { @@ -85,10 +87,10 @@ public class OperatorsTest .value() .get() .bar(), "Xyz" ); - Assert.assertTrue( where.test( testEntity ) ); + assertThat( where.test( testEntity ), is( true ) ); System.out.println( where ); - Assert.assertTrue( builder.where( where ).newQuery( entities ).find().equals( testEntity ) ); + assertThat( builder.where( where ).newQuery( entities ).find().equals( testEntity ), is( true ) ); } } finally http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java b/core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java index b5c09f7..c9137b9 100644 --- a/core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/activation/ActivationEventsTest.java @@ -22,7 +22,6 @@ package org.apache.polygene.api.activation; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.junit.Test; import org.apache.polygene.api.activation.ActivationEvent.EventType; import org.apache.polygene.api.mixin.Mixins; import org.apache.polygene.api.service.ServiceComposite; @@ -31,9 +30,15 @@ import org.apache.polygene.api.structure.Module; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.bootstrap.SingletonAssembler; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; -import static org.apache.polygene.api.activation.ActivationEvent.EventType.*; +import static org.apache.polygene.api.activation.ActivationEvent.EventType.ACTIVATED; +import static org.apache.polygene.api.activation.ActivationEvent.EventType.ACTIVATING; +import static org.apache.polygene.api.activation.ActivationEvent.EventType.PASSIVATED; +import static org.apache.polygene.api.activation.ActivationEvent.EventType.PASSIVATING; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.jupiter.api.Assertions.fail; public class ActivationEventsTest { @@ -106,7 +111,7 @@ public class ActivationEventsTest assertEvent( it.next(), PASSIVATED, "Layer" ); assertEvent( it.next(), PASSIVATED, "Application" ); - assertFalse( it.hasNext() ); + assertThat( it.hasNext(), is( false ) ); } @Test @@ -157,7 +162,7 @@ public class ActivationEventsTest assertEvent( it.next(), PASSIVATED, "Layer" ); assertEvent( it.next(), PASSIVATED, "Application" ); - assertFalse( it.hasNext() ); + assertThat( it.hasNext(), is( false ) ); } @Test @@ -206,7 +211,7 @@ public class ActivationEventsTest assertEvent( it.next(), PASSIVATED, "Layer" ); assertEvent( it.next(), PASSIVATED, "Application" ); - assertFalse( it.hasNext() ); + assertThat( it.hasNext(), is( false ) ); events.clear(); application.activate(); @@ -242,7 +247,7 @@ public class ActivationEventsTest assertEvent( it.next(), PASSIVATED, "Layer" ); assertEvent( it.next(), PASSIVATED, "Application" ); - assertFalse( it.hasNext() ); + assertThat( it.hasNext(), is( false ) ); } private static class EventsRecorder http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java b/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java index 3637fb9..ddd4d80 100644 --- a/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java @@ -30,14 +30,14 @@ import org.apache.polygene.api.structure.Layer; import org.apache.polygene.api.structure.Module; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.builder.ApplicationBuilder; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.StringContains.containsString; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; public class PassivationExceptionTest { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/annotation/MixinsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/annotation/MixinsTest.java b/core/api/src/test/java/org/apache/polygene/api/annotation/MixinsTest.java index ffffffb..60cea16 100644 --- a/core/api/src/test/java/org/apache/polygene/api/annotation/MixinsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/annotation/MixinsTest.java @@ -20,11 +20,12 @@ package org.apache.polygene.api.annotation; import java.lang.annotation.Annotation; -import org.junit.Test; import org.apache.polygene.api.mixin.Mixins; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; /** * Tests public api exposed by Mixins annotation. @@ -37,9 +38,9 @@ public class MixinsTest public void retention() { Annotation[] annotations = Annotated.class.getDeclaredAnnotations(); - assertNotNull( "annotations should not be null", annotations ); - assertEquals( "number of annotations", 1, annotations.length ); - assertEquals( "annotation type", Mixins.class, annotations[ 0 ].annotationType() ); + assertThat( "annotations should not be null", annotations, notNullValue() ); + assertThat( "number of annotations", annotations.length, equalTo( 1 ) ); + assertThat( "annotation type", annotations[ 0 ].annotationType(), equalTo( Mixins.class ) ); } @Mixins( Object.class ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/annotation/ModifiedByTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/annotation/ModifiedByTest.java b/core/api/src/test/java/org/apache/polygene/api/annotation/ModifiedByTest.java index 8c8064d..3b887e7 100644 --- a/core/api/src/test/java/org/apache/polygene/api/annotation/ModifiedByTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/annotation/ModifiedByTest.java @@ -20,11 +20,12 @@ package org.apache.polygene.api.annotation; import java.lang.annotation.Annotation; -import org.junit.Test; import org.apache.polygene.api.concern.Concerns; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; /** * Tests public api exposed by Concerns annotation. @@ -37,9 +38,9 @@ public class ModifiedByTest public void retention() { Annotation[] annotations = Annotated.class.getDeclaredAnnotations(); - assertNotNull( "annotations should not be null", annotations ); - assertEquals( "number of annotations", 1, annotations.length ); - assertEquals( "annotation type", Concerns.class, annotations[ 0 ].annotationType() ); + assertThat( "annotations should not be null", annotations, notNullValue() ); + assertThat( "number of annotations", annotations.length, equalTo( 1 ) ); + assertThat( "annotation type", annotations[ 0 ].annotationType(), equalTo( Concerns.class ) ); } @Concerns( Object.class ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/annotation/scope/ModifiesTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/annotation/scope/ModifiesTest.java b/core/api/src/test/java/org/apache/polygene/api/annotation/scope/ModifiesTest.java index a1d037e..d5672b0 100644 --- a/core/api/src/test/java/org/apache/polygene/api/annotation/scope/ModifiesTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/annotation/scope/ModifiesTest.java @@ -20,11 +20,12 @@ package org.apache.polygene.api.annotation.scope; import java.lang.annotation.Annotation; -import org.junit.Test; import org.apache.polygene.api.concern.internal.ConcernFor; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; /** * Tests public api exposed by Modified annotation. @@ -38,9 +39,9 @@ public class ModifiesTest throws NoSuchFieldException { Annotation[] annotations = Annotated.class.getDeclaredField( "modified" ).getDeclaredAnnotations(); - assertNotNull( "annotations should not be null", annotations ); - assertEquals( "number of annotations", 1, annotations.length ); - assertEquals( "annotation type", ConcernFor.class, annotations[ 0 ].annotationType() ); + assertThat( "annotations should not be null", annotations, notNullValue() ); + assertThat( "number of annotations", annotations.length, equalTo( 1 ) ); + assertThat( "annotation type", annotations[ 0 ].annotationType(), equalTo( ConcernFor.class ) ); } private static class Annotated http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/common/AppliesToTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/common/AppliesToTest.java b/core/api/src/test/java/org/apache/polygene/api/common/AppliesToTest.java index 500544c..9f31f08 100644 --- a/core/api/src/test/java/org/apache/polygene/api/common/AppliesToTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/common/AppliesToTest.java @@ -20,10 +20,11 @@ package org.apache.polygene.api.common; import java.lang.annotation.Annotation; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; /** * Tests public api exposed by AppliesTo annotation. @@ -36,9 +37,9 @@ public class AppliesToTest public void retention() { Annotation[] annotations = Annotated.class.getDeclaredAnnotations(); - assertNotNull( "annotations should not be null", annotations ); - assertEquals( "number of annotations", 1, annotations.length ); - assertEquals( "annotation type", AppliesTo.class, annotations[ 0 ].annotationType() ); + assertThat( "annotations should not be null", annotations, notNullValue() ); + assertThat( "number of annotations", annotations.length, equalTo( 1 ) ); + assertThat( "annotation type", annotations[ 0 ].annotationType(), equalTo( AppliesTo.class ) ); } @AppliesTo( Object.class ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/common/QualifiedNameTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/common/QualifiedNameTest.java b/core/api/src/test/java/org/apache/polygene/api/common/QualifiedNameTest.java index d1f9086..f2f615b 100644 --- a/core/api/src/test/java/org/apache/polygene/api/common/QualifiedNameTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/common/QualifiedNameTest.java @@ -19,65 +19,70 @@ */ package org.apache.polygene.api.common; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.junit.jupiter.api.Assertions.assertThrows; public class QualifiedNameTest { @Test public void testQualifiedNameWithDollar() { - assertEquals( "Name containing dollar is modified", "Test-Test", - new QualifiedName( TypeName.nameOf( "Test$Test" ), "satisfiedBy" ).type() ); + assertThat( "Name containing dollar is modified", + new QualifiedName( TypeName.nameOf( "Test$Test" ), "satisfiedBy" ).type(), + equalTo( "Test-Test" ) + ); } @Test public void testQualifiedNameFromQNWithDollar() { - assertEquals( "Name containing dollar is cleaned up", "Test-Test", - QualifiedName.fromFQN( "Test$Test:satisfiedBy" ).type() ); + assertThat( "Name containing dollar is cleaned up", + QualifiedName.fromFQN( "Test$Test:satisfiedBy" ).type(), + equalTo( "Test-Test" ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments1() { - new QualifiedName( TypeName.nameOf( "Test" ), null ); + assertThrows( NullPointerException.class, () -> new QualifiedName( TypeName.nameOf( "Test" ), null ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments2() { - new QualifiedName( null, "satisfiedBy" ); + assertThrows( NullPointerException.class, () -> new QualifiedName( null, "satisfiedBy" ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments3() { - new QualifiedName( null, null ); + assertThrows( NullPointerException.class, () -> new QualifiedName( null, null ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments4() { - QualifiedName.fromFQN( null ); + assertThrows( NullPointerException.class, () -> QualifiedName.fromFQN( null ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments5() { - QualifiedName.fromAccessor( null ); + assertThrows( NullPointerException.class, () -> QualifiedName.fromAccessor( null ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments6() { - QualifiedName.fromClass( null, "satisfiedBy" ); + assertThrows( NullPointerException.class, () -> QualifiedName.fromClass( null, "satisfiedBy" ) ); } - @Test( expected = NullPointerException.class ) + @Test public void nonNullArguments7() { - QualifiedName.fromClass( null, null ); + assertThrows( NullPointerException.class, () -> QualifiedName.fromClass( null, null ) ); } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/composite/PropertyMapperTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/composite/PropertyMapperTest.java b/core/api/src/test/java/org/apache/polygene/api/composite/PropertyMapperTest.java index c2b6ccb..5db87aa 100644 --- a/core/api/src/test/java/org/apache/polygene/api/composite/PropertyMapperTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/composite/PropertyMapperTest.java @@ -28,11 +28,12 @@ import java.math.BigInteger; import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.apache.polygene.api.util.AccessibleObjects.accessible; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsEqual.equalTo; public class PropertyMapperTest { @@ -54,72 +55,72 @@ public class PropertyMapperTest public void testMappingOfInteger() throws Exception { - assertEquals( 5, mapToType( null, Integer.class, "5" ) ); - assertEquals( -5, mapToType( null, Integer.class, "-5" ) ); - assertEquals( Integer.class, mapToType( null, Integer.class, "5" ).getClass() ); + assertThat( mapToType( null, Integer.class, "5" ), equalTo( 5 ) ); + assertThat( mapToType( null, Integer.class, "-5" ), equalTo( -5 ) ); + assertThat( mapToType( null, Integer.class, "5" ).getClass(), equalTo( Integer.class ) ); } @Test public void testMappingOfLong() throws Exception { - assertEquals( 5L, mapToType( null, Long.class, "5" ) ); - assertEquals( 5876328476238746238L, mapToType( null, Long.class, "5876328476238746238" ) ); - assertEquals( Long.class, mapToType( null, Long.class, "5" ).getClass() ); + assertThat( mapToType( null, Long.class, "5" ), equalTo( 5L ) ); + assertThat( mapToType( null, Long.class, "5876328476238746238" ), equalTo( 5876328476238746238L ) ); + assertThat( mapToType( null, Long.class, "5" ).getClass(), equalTo( Long.class ) ); } @Test public void testMappingOfBoolean() throws Exception { - assertEquals( false, mapToType( null, Boolean.class, "false" ) ); - assertEquals( true, mapToType( null, Boolean.class, "true" ) ); - assertEquals( Boolean.class, mapToType( null, Boolean.class, "false" ).getClass() ); + assertThat( mapToType( null, Boolean.class, "false" ), is( false ) ); + assertThat( mapToType( null, Boolean.class, "true" ), is( true ) ); + assertThat( mapToType( null, Boolean.class, "false" ).getClass(), equalTo( Boolean.class ) ); } @Test public void testMappingOfFloat() throws Exception { - assertEquals( 5.1234f, mapToType( null, Float.class, "5.1234" ) ); - assertEquals( 5876328476.6238f, mapToType( null, Float.class, "5876328476.6238" ) ); - assertEquals( Float.class, mapToType( null, Float.class, "5" ).getClass() ); + assertThat( mapToType( null, Float.class, "5.1234" ), equalTo( 5.1234f ) ); + assertThat( mapToType( null, Float.class, "5876328476.6238" ), equalTo( 5876328476.6238f ) ); + assertThat( mapToType( null, Float.class, "5" ).getClass(), equalTo( Float.class ) ); } @Test public void testMappingOfDouble() throws Exception { - assertEquals( 5.1234, mapToType( null, Double.class, "5.1234" ) ); - assertEquals( 5876328476.623823, mapToType( null, Double.class, "5876328476.623823" ) ); - assertEquals( Double.class, mapToType( null, Double.class, "5" ).getClass() ); + assertThat( mapToType( null, Double.class, "5.1234" ), equalTo( 5.1234 ) ); + assertThat( mapToType( null, Double.class, "5876328476.623823" ), equalTo( 5876328476.623823 ) ); + assertThat( mapToType( null, Double.class, "5" ).getClass(), equalTo( Double.class ) ); } @Test public void testMappingOfBigDecimal() throws Exception { - assertEquals( new BigDecimal( 3 ), mapToType( null, BigDecimal.class, "3" ) ); - assertEquals( new BigDecimal( "12345.67891011" ), mapToType( null, BigDecimal.class, "12345.67891011" ) ); - assertEquals( BigDecimal.class, mapToType( null, BigDecimal.class, "5" ).getClass() ); + assertThat( mapToType( null, BigDecimal.class, "3" ), equalTo( new BigDecimal( 3 ) ) ); + assertThat( mapToType( null, BigDecimal.class, "12345.67891011" ), equalTo( new BigDecimal( "12345.67891011" ) ) ); + assertThat( mapToType( null, BigDecimal.class, "5" ).getClass(), equalTo( BigDecimal.class ) ); } @Test public void testMappingOfBigInteger() throws Exception { - assertEquals( new BigInteger( "20", 16 ), mapToType( null, BigInteger.class, "32" ) ); - assertEquals( new BigInteger( "1234567891011" ), mapToType( null, BigInteger.class, "1234567891011" ) ); - assertEquals( BigInteger.class, mapToType( null, BigInteger.class, "5" ).getClass() ); + assertThat( mapToType( null, BigInteger.class, "32" ), equalTo( new BigInteger( "20", 16 ) ) ); + assertThat( mapToType( null, BigInteger.class, "1234567891011" ), equalTo( new BigInteger( "1234567891011" ) ) ); + assertThat( mapToType( null, BigInteger.class, "5" ).getClass(), equalTo( BigInteger.class ) ); } @Test public void testMappingOfEnum() throws Exception { - assertEquals( TestEnum.FIRST, mapToType( null, TestEnum.class, "FIRST" ) ); - assertEquals( TestEnum.SECOND, mapToType( null, TestEnum.class, "SECOND" ) ); - assertEquals( TestEnum.class, mapToType( null, TestEnum.class, "SECOND" ).getClass() ); + assertThat( mapToType( null, TestEnum.class, "FIRST" ), is( TestEnum.FIRST ) ); + assertThat( mapToType( null, TestEnum.class, "SECOND" ), is( TestEnum.SECOND ) ); + assertThat( mapToType( null, TestEnum.class, "SECOND" ).getClass(), equalTo( TestEnum.class ) ); } @Test @@ -127,12 +128,12 @@ public class PropertyMapperTest throws Exception { Object[] value = (Object[]) mapToType( null, Integer[].class, "5,4 , 3 ,2,1" ); - assertEquals( 5, value.length ); - assertEquals( 5, value[ 0 ] ); - assertEquals( 4, value[ 1 ] ); - assertEquals( 3, value[ 2 ] ); - assertEquals( 2, value[ 3 ] ); - assertEquals( 1, value[ 4 ] ); + assertThat( value.length, equalTo( 5 ) ); + assertThat( value[ 0 ], equalTo( 5 ) ); + assertThat( value[ 1 ], equalTo( 4 ) ); + assertThat( value[ 2 ], equalTo( 3 ) ); + assertThat( value[ 3 ], equalTo( 2 ) ); + assertThat( value[ 4 ], equalTo( 1 ) ); } @Test @@ -141,21 +142,21 @@ public class PropertyMapperTest { { Object[] value = (Object[]) mapToType( null, String[].class, "5,4 , 3 ,2,1" ); - assertEquals( 5, value.length ); - assertEquals( "5", value[ 0 ] ); - assertEquals( "4 ", value[ 1 ] ); - assertEquals( " 3 ", value[ 2 ] ); - assertEquals( "2", value[ 3 ] ); - assertEquals( "1", value[ 4 ] ); + assertThat( value.length, equalTo( 5 ) ); + assertThat( value[ 0 ], equalTo( "5" ) ); + assertThat( value[ 1 ], equalTo( "4 " ) ); + assertThat( value[ 2 ], equalTo( " 3 " ) ); + assertThat( value[ 3 ], equalTo( "2" ) ); + assertThat( value[ 4 ], equalTo( "1" ) ); } { Object[] value = (Object[]) mapToType( null, String[].class, "5,4 ,\" 3, \", \" 2\" ,1" ); - assertEquals( "5", value[ 0 ] ); - assertEquals( "4 ", value[ 1 ] ); - assertEquals( " 3, ", value[ 2 ] ); - assertEquals( " 2", value[ 3 ] ); - assertEquals( "1", value[ 4 ] ); - assertEquals( 5, value.length ); + assertThat( value[ 0 ], equalTo( "5" ) ); + assertThat( value[ 1 ], equalTo( "4 " ) ); + assertThat( value[ 2 ], equalTo( " 3, " ) ); + assertThat( value[ 3 ], equalTo( " 2" ) ); + assertThat( value[ 4 ], equalTo( "1" ) ); + assertThat( value.length, equalTo( 5 ) ); } } @@ -164,13 +165,13 @@ public class PropertyMapperTest throws Exception { Object[] value = (Object[]) mapToType( null, Boolean[].class, " true,false, false, true ,true,false" ); - assertEquals( true, value[ 0 ] ); - assertEquals( false, value[ 1 ] ); - assertEquals( false, value[ 2 ] ); - assertEquals( true, value[ 3 ] ); - assertEquals( true, value[ 4 ] ); - assertEquals( false, value[ 5 ] ); - assertEquals( 6, value.length ); + assertThat( value[ 0 ], equalTo( true ) ); + assertThat( value[ 1 ], equalTo( false ) ); + assertThat( value[ 2 ], equalTo( false ) ); + assertThat( value[ 3 ], equalTo( true ) ); + assertThat( value[ 4 ], equalTo( true ) ); + assertThat( value[ 5 ], equalTo( false ) ); + assertThat( value.length, equalTo( 6 ) ); } @Test @@ -179,12 +180,12 @@ public class PropertyMapperTest { Type type = Testing.class.getDeclaredMethod( "list" ).getGenericReturnType(); List<String> value = (List<String>) mapToType( null, type, "5,4 ,\" 3, \", \" 2\" ,1" ); - assertEquals( "5", value.get( 0 ) ); - assertEquals( "4 ", value.get( 1 ) ); - assertEquals( " 3, ", value.get( 2 ) ); - assertEquals( " 2", value.get( 3 ) ); - assertEquals( "1", value.get( 4 ) ); - assertEquals( 5, value.size() ); + assertThat( value.get( 0 ), equalTo( "5" ) ); + assertThat( value.get( 1 ), equalTo( "4 " ) ); + assertThat( value.get( 2 ), equalTo( " 3, " ) ); + assertThat( value.get( 3 ), equalTo( " 2" ) ); + assertThat( value.get( 4 ), equalTo( "1" ) ); + assertThat( value.size(), equalTo( 5 ) ); } @Test @@ -193,12 +194,12 @@ public class PropertyMapperTest { Type type = Testing.class.getDeclaredMethod( "set" ).getGenericReturnType(); Set<String> value = (Set<String>) mapToType( null, type, "5,4 ,\" 3, \", \" 2\" ,1" ); - assertTrue( value.contains( "5" ) ); - assertTrue( value.contains( "4 " ) ); - assertTrue( value.contains( " 3, " ) ); - assertTrue( value.contains( " 2" ) ); - assertTrue( value.contains( "1" ) ); - assertEquals( 5, value.size() ); + assertThat( value.contains( "5" ), is( true ) ); + assertThat( value.contains( "4 " ), is( true ) ); + assertThat( value.contains( " 3, " ), is( true ) ); + assertThat( value.contains( " 2" ), is( true ) ); + assertThat( value.contains( "1" ), is( true ) ); + assertThat( value.size(), equalTo( 5 ) ); } @Test @@ -207,12 +208,12 @@ public class PropertyMapperTest { Type type = Testing.class.getDeclaredMethod( "map" ).getGenericReturnType(); Map<String, String> value = (Map<String, String>) mapToType( null, type, "first:5,second:4 , third:\" 3, \", fourth: \" 2\" ,fifth : 1" ); - assertEquals( "5", value.get( "first" ) ); - assertEquals( "4 ", value.get( "second" ) ); - assertEquals( " 3, ", value.get( " third" ) ); - assertEquals( " 2", value.get( " fourth" ) ); - assertEquals( " 1", value.get( "fifth " ) ); - assertEquals( 5, value.size() ); + assertThat( value.get( "first" ), equalTo( "5" ) ); + assertThat( value.get( "second" ), equalTo( "4 " ) ); + assertThat( value.get( " third" ), equalTo( " 3, " ) ); + assertThat( value.get( " fourth" ), equalTo( " 2" ) ); + assertThat( value.get( "fifth " ), equalTo( " 1" ) ); + assertThat( value.size(), equalTo( 5 ) ); } private Object mapToType( Composite composite, Type propertyType, Object value ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java b/core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java index 81cdc14..186153d 100644 --- a/core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/configuration/ConfigurationTest.java @@ -19,7 +19,6 @@ */ package org.apache.polygene.api.configuration; -import org.junit.Test; import org.apache.polygene.api.injection.scope.This; import org.apache.polygene.api.mixin.Mixins; import org.apache.polygene.api.property.Property; @@ -29,9 +28,10 @@ import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class ConfigurationTest extends AbstractPolygeneTest { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java b/core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java index d0384a8..3d0ea17 100644 --- a/core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/configuration/DeclareConfigurationDefaultsTest.java @@ -19,8 +19,6 @@ */ package org.apache.polygene.api.configuration; -import org.junit.Assert; -import org.junit.Test; import org.apache.polygene.api.injection.scope.This; import org.apache.polygene.api.mixin.Mixins; import org.apache.polygene.api.property.Property; @@ -29,6 +27,10 @@ import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; public class DeclareConfigurationDefaultsTest extends AbstractPolygeneTest @@ -36,15 +38,14 @@ public class DeclareConfigurationDefaultsTest @Mixins( FooServiceMixin.class ) public static interface FooServiceComposite - extends ServiceComposite + extends ServiceComposite { String configuredFoo(); - } public static abstract class FooServiceMixin - implements FooServiceComposite + implements FooServiceComposite { @This @@ -54,19 +55,17 @@ public class DeclareConfigurationDefaultsTest { return config.get().foo().get(); } - } public static interface FooConfigurationComposite - extends ConfigurationComposite + extends ConfigurationComposite { Property<String> foo(); - } public void assemble( ModuleAssembly module ) - throws AssemblyException + throws AssemblyException { module.services( FooServiceComposite.class ).identifiedBy( "bazar" ); module.entities( FooConfigurationComposite.class ); @@ -79,7 +78,6 @@ public class DeclareConfigurationDefaultsTest public void testConfigurationDefaults() { FooServiceComposite fooService = serviceFinder.findService( FooServiceComposite.class ).get(); - Assert.assertEquals( "bar", fooService.configuredFoo() ); + assertThat( fooService.configuredFoo(), equalTo( "bar" ) ); } - } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java b/core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java index a4b8b30..7e1c7eb 100644 --- a/core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/injection/scope/StateFieldTest.java @@ -20,9 +20,6 @@ package org.apache.polygene.api.injection.scope; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Assert; -import org.junit.Test; import org.apache.polygene.api.association.Association; import org.apache.polygene.api.association.ManyAssociation; import org.apache.polygene.api.common.Optional; @@ -33,7 +30,13 @@ import org.apache.polygene.api.property.Property; import org.apache.polygene.api.unitofwork.UnitOfWork; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsEqual.equalTo; /** * Define a field to be a Property @@ -57,15 +60,15 @@ public class StateFieldTest { PersonEntity charles = unitOfWork.newEntity( PersonEntity.class ); charles.changeName( "Charles" ); - Assert.assertEquals( charles.getName(), "Charles" ); + assertThat( "Charles", equalTo( charles.getName() ) ); PersonEntity daniel = unitOfWork.newEntity( PersonEntity.class ); daniel.changeName( "Daniel" ); - Assert.assertEquals( daniel.getName(), "Daniel" ); + assertThat( "Daniel", equalTo( daniel.getName() ) ); PersonEntity lisa = unitOfWork.newEntity( PersonEntity.class ); lisa.changeName( "Lisa" ); - Assert.assertEquals( lisa.getName(), "Lisa" ); + assertThat( "Lisa", equalTo( lisa.getName() ) ); charles.befriend( daniel ); charles.befriend( lisa ); @@ -77,7 +80,7 @@ public class StateFieldTest charles = unitOfWork.get( charles ); daniel = unitOfWork.get( daniel ); - Assert.assertTrue( charles.isFriend( daniel ) ); + assertThat( charles.isFriend( daniel ), is( true ) ); unitOfWork.complete(); } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/injection/scope/ThisTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/injection/scope/ThisTest.java b/core/api/src/test/java/org/apache/polygene/api/injection/scope/ThisTest.java index a26d434..a0bd925 100644 --- a/core/api/src/test/java/org/apache/polygene/api/injection/scope/ThisTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/injection/scope/ThisTest.java @@ -20,11 +20,12 @@ package org.apache.polygene.api.injection.scope; import java.lang.annotation.Annotation; -import org.junit.Test; import org.apache.polygene.api.common.Optional; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; /** * Tests public api exposed by This annotation. @@ -38,9 +39,9 @@ public class ThisTest throws NoSuchFieldException { Annotation[] annotations = Annotated.class.getDeclaredField( "uses" ).getDeclaredAnnotations(); - assertNotNull( "annotations should not be null", annotations ); - assertEquals( "number of annotations", 1, annotations.length ); - assertEquals( "annotation type", This.class, annotations[ 0 ].annotationType() ); + assertThat( "annotations should not be null", annotations, notNullValue() ); + assertThat( "number of annotations", annotations.length, equalTo( 1 ) ); + assertThat( "annotation type", annotations[ 0 ].annotationType(), equalTo( This.class ) ); } private static class Annotated http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java b/core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java index 40f59d3..a3276f4 100644 --- a/core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/mixin/decoratorMixin/DecoratorMixinTest.java @@ -21,14 +21,14 @@ package org.apache.polygene.api.mixin.decoratorMixin; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; import org.apache.polygene.api.composite.TransientBuilder; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.test.AbstractPolygeneTest; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; -import static org.junit.Assert.assertThat; public class DecoratorMixinTest extends AbstractPolygeneTest { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java b/core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java index 265d086..2b943fb 100644 --- a/core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/object/ObjectBuilderTest.java @@ -20,13 +20,14 @@ package org.apache.polygene.api.object; -import org.junit.Test; import org.apache.polygene.api.injection.scope.Uses; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNotNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsNull.notNullValue; /** * JAVADOC @@ -44,10 +45,10 @@ public class ObjectBuilderTest public void testNotProvidedUses() { A a = objectFactory.newObject( A.class ); - assertNotNull( a ); - assertNotNull( a.b ); - assertNotNull( a.b.c ); - assertNotNull( a.b.c.d ); + assertThat( a, notNullValue() ); + assertThat( a.b, notNullValue() ); + assertThat( a.b.c, notNullValue() ); + assertThat( a.b.c.d, notNullValue() ); } public static class A http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/property/PropertyErrorTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/property/PropertyErrorTest.java b/core/api/src/test/java/org/apache/polygene/api/property/PropertyErrorTest.java index c299300..59f8685 100644 --- a/core/api/src/test/java/org/apache/polygene/api/property/PropertyErrorTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/property/PropertyErrorTest.java @@ -20,14 +20,16 @@ package org.apache.polygene.api.property; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; import org.apache.polygene.api.constraint.ConstraintViolationException; import org.apache.polygene.api.entity.EntityComposite; import org.apache.polygene.api.unitofwork.UnitOfWork; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; /** * Error messages for Properties @@ -42,21 +44,22 @@ public class PropertyErrorTest module.entities( PersonEntity.class ); } - @Test( expected = ConstraintViolationException.class ) + @Test public void givenEntityWithNonOptionPropertyWhenInstantiatedThenException() throws Exception { - UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork(); - try - { - PersonEntity person = unitOfWork.newEntity( PersonEntity.class ); - - unitOfWork.complete(); - } - finally - { - unitOfWork.discard(); - } + assertThrows( ConstraintViolationException.class, () -> { + UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork(); + try + { + PersonEntity person = unitOfWork.newEntity( PersonEntity.class ); + unitOfWork.complete(); + } + finally + { + unitOfWork.discard(); + } + } ); } interface PersonEntity http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/type/HasTypesCollectorsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/type/HasTypesCollectorsTest.java b/core/api/src/test/java/org/apache/polygene/api/type/HasTypesCollectorsTest.java index b5f3381..ac43b15 100644 --- a/core/api/src/test/java/org/apache/polygene/api/type/HasTypesCollectorsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/type/HasTypesCollectorsTest.java @@ -25,12 +25,11 @@ import java.util.List; import java.util.Optional; import org.apache.polygene.api.identity.Identity; import org.apache.polygene.api.identity.StringIdentity; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; public class HasTypesCollectorsTest { @@ -64,12 +63,12 @@ public class HasTypesCollectorsTest Optional<ValueType> number = valueTypes.stream() .collect( HasTypesCollectors.matchingType( Number.class ) ); - assertTrue( number.isPresent() ); + assertThat( number.isPresent(), is( true ) ); assertThat( number.get(), equalTo( ValueType.of( Double.class ) ) ); Optional<ValueType> integer = valueTypes.stream() .collect( HasTypesCollectors.matchingType( Integer.class ) ); - assertTrue( integer.isPresent() ); + assertThat( integer.isPresent(), is( true ) ); assertThat( integer.get(), equalTo( ValueType.of( Integer.class ) ) ); } @@ -117,19 +116,19 @@ public class HasTypesCollectorsTest Optional<ValueType> number = valueTypes.stream() .collect( HasTypesCollectors.matchingType( ValueType.of( Number.class ) ) ); - assertTrue( number.isPresent() ); + assertThat( number.isPresent(), is( true ) ); assertThat( number.get(), equalTo( ValueType.of( Number.class ) ) ); Optional<ValueType> integer = valueTypes.stream() .collect( HasTypesCollectors.matchingType( ValueType.of( Integer.class ) ) ); - assertTrue( integer.isPresent() ); + assertThat( integer.isPresent(), is( true ) ); assertThat( integer.get(), equalTo( ValueType.of( Integer.class ) ) ); Optional<ValueType> both = valueTypes.stream() .collect( HasTypesCollectors.matchingType( ValueType.of( Number.class, Integer.class ) ) ); - assertTrue( both.isPresent() ); + assertThat( both.isPresent(), is( true ) ); assertThat( both.get(), equalTo( ValueType.of( Number.class, Integer.class ) ) ); } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/type/HasTypesPredicatesTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/type/HasTypesPredicatesTest.java b/core/api/src/test/java/org/apache/polygene/api/type/HasTypesPredicatesTest.java index 8e8bf5d..bad4b16 100644 --- a/core/api/src/test/java/org/apache/polygene/api/type/HasTypesPredicatesTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/type/HasTypesPredicatesTest.java @@ -20,54 +20,40 @@ package org.apache.polygene.api.type; import java.time.LocalDate; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; public class HasTypesPredicatesTest { @Test public void hasEqualTypePredicate() { - assertTrue( new HasEqualType<>( Integer.class ) - .test( ValueType.of( Integer.class ) ) ); - assertTrue( new HasEqualType<>( Integer.class ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertFalse( new HasEqualType<>( Number.class ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertFalse( new HasEqualType<>( String.class ) - .test( ValueType.of( LocalDate.class, Integer.class ) ) ); + assertThat( new HasEqualType<>( Integer.class ).test( ValueType.of( Integer.class ) ), is( true ) ); + assertThat( new HasEqualType<>( Integer.class ).test( ValueType.of( String.class, Integer.class ) ), is( true ) ); + assertThat( new HasEqualType<>( Number.class ).test( ValueType.of( String.class, Integer.class ) ), is( false ) ); + assertThat( new HasEqualType<>( String.class ).test( ValueType.of( LocalDate.class, Integer.class ) ), is( false ) ); - assertTrue( new HasEqualType<>( ValueType.of( Integer.class ) ) - .test( ValueType.of( Integer.class ) ) ); - assertTrue( new HasEqualType<>( ValueType.of( Integer.class ) ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertFalse( new HasEqualType<>( ValueType.of( Number.class ) ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertFalse( new HasEqualType<>( ValueType.of( String.class ) ) - .test( ValueType.of( LocalDate.class, Integer.class ) ) ); + assertThat( new HasEqualType<>( ValueType.of( Integer.class ) ).test( ValueType.of( Integer.class ) ), is( true ) ); + assertThat( new HasEqualType<>( ValueType.of( Integer.class ) ).test( ValueType.of( String.class, Integer.class ) ), is( true ) ); + assertThat( new HasEqualType<>( ValueType.of( Number.class ) ).test( ValueType.of( String.class, Integer.class ) ), is( false ) ); + assertThat( new HasEqualType<>( ValueType.of( String.class ) ).test( ValueType.of( LocalDate.class, Integer.class ) ), is( false ) ); } @Test public void hasAssignableTypePredicate() { - assertTrue( new HasAssignableFromType<>( Number.class ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertFalse( new HasAssignableFromType<>( Integer.class ) - .test( ValueType.of( Integer.class ) ) ); - assertFalse( new HasAssignableFromType<>( String.class ) - .test( ValueType.of( LocalDate.class, Integer.class ) ) ); + assertThat( new HasAssignableFromType<>( Number.class ).test( ValueType.of( String.class, Integer.class ) ), is( true ) ); + assertThat( new HasAssignableFromType<>( Integer.class ).test( ValueType.of( Integer.class ) ), is( false ) ); + assertThat( new HasAssignableFromType<>( String.class ).test( ValueType.of( LocalDate.class, Integer.class ) ), is( false ) ); } @Test public void hasEqualOrAssignablePredicate() { - assertTrue( new HasEqualOrAssignableFromType<>( Number.class ) - .test( ValueType.of( String.class, Integer.class ) ) ); - assertTrue( new HasEqualOrAssignableFromType<>( Integer.class ) - .test( ValueType.of( Integer.class ) ) ); - assertFalse( new HasEqualOrAssignableFromType<>( String.class ) - .test( ValueType.of( LocalDate.class, Integer.class ) ) ); + assertThat( new HasEqualOrAssignableFromType<>( Number.class ).test( ValueType.of( String.class, Integer.class ) ), is( true ) ); + assertThat( new HasEqualOrAssignableFromType<>( Integer.class ).test( ValueType.of( Integer.class ) ), is( true ) ); + assertThat( new HasEqualOrAssignableFromType<>( String.class ).test( ValueType.of( LocalDate.class, Integer.class ) ), is( false ) ); } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java b/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java index 95d328a..9462352 100644 --- a/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java @@ -36,12 +36,12 @@ import org.apache.polygene.spi.module.ModuleSpi; import org.apache.polygene.spi.type.ValueTypeFactory; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -import static org.junit.Assert.assertThat; public class ValueTypeFactoryTest extends AbstractPolygeneTest { @@ -64,7 +64,7 @@ public class ValueTypeFactoryTest extends AbstractPolygeneTest Property<Map<String, Integer>> map(); } - @Before + @BeforeEach public void setup() { valueTypeFactory = ( (ModuleSpi) module.instance() ).valueTypeFactory(); http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java index c401167..42cb060 100644 --- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java @@ -29,7 +29,7 @@ import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class RemovalTest extends AbstractPolygeneTest http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java index 52d4901..7f671d0 100644 --- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java @@ -44,10 +44,10 @@ import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.spi.PolygeneSPI; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; -import static org.junit.Assert.assertThat; public class ToEntityConversionTest extends AbstractPolygeneTest http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java index 3b768bb..221a593 100644 --- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java @@ -45,11 +45,11 @@ import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.spi.PolygeneSPI; import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.AnyOf.anyOf; import static org.hamcrest.core.IsEqual.equalTo; -import static org.junit.Assert.assertThat; public class ToValueConversionTest extends AbstractPolygeneTest http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/unitofwork/UnitOfWorkTemplateTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/UnitOfWorkTemplateTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/UnitOfWorkTemplateTest.java index 43bd5b7..ab7d113 100644 --- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/UnitOfWorkTemplateTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/UnitOfWorkTemplateTest.java @@ -19,14 +19,14 @@ */ package org.apache.polygene.api.unitofwork; -import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; import org.apache.polygene.api.entity.EntityBuilderTemplate; import org.apache.polygene.api.entity.EntityComposite; import org.apache.polygene.api.property.Property; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; +import org.apache.polygene.test.AbstractPolygeneTest; import org.apache.polygene.test.EntityTestAssembler; +import org.junit.jupiter.api.Test; /** * TODO http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java b/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java index 834cc97..44f48ce 100644 --- a/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java @@ -25,13 +25,13 @@ import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.HashSet; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.apache.polygene.api.util.Classes.interfacesOf; import static org.apache.polygene.api.util.Classes.interfacesWithMethods; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; /** * Tests for Classes http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/util/CollectorsTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/util/CollectorsTest.java b/core/api/src/test/java/org/apache/polygene/api/util/CollectorsTest.java index 1beb26a..6d8016c 100644 --- a/core/api/src/test/java/org/apache/polygene/api/util/CollectorsTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/util/CollectorsTest.java @@ -21,14 +21,13 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; public class CollectorsTest { @@ -60,8 +59,8 @@ public void single() @Test public void singleOrEmpty() { - assertEquals( Optional.empty(), Stream.of().collect( Collectors.singleOrEmpty() ) ); - assertEquals( Optional.of( 1 ), Stream.of( 1 ).collect( Collectors.singleOrEmpty() ) ); + assertThat( Stream.of().collect( Collectors.singleOrEmpty() ), equalTo( Optional.empty() ) ); + assertThat( Stream.of( 1 ).collect( Collectors.singleOrEmpty() ), equalTo( Optional.of( 1 ) ) ); try { http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java index 725e33e..8e98de4 100644 --- a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java +++ b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java @@ -33,11 +33,11 @@ import org.apache.polygene.api.serialization.Serializer; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.serialization.javaxjson.assembly.JavaxJsonSerializationAssembler; import org.apache.polygene.test.AbstractPolygeneTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.stream.Collectors.toList; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; /** * Snippets: http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6ae17138/core/api/src/test/java/org/apache/polygene/api/value/ValueBuilderTemplateTest.java ---------------------------------------------------------------------- diff --git a/core/api/src/test/java/org/apache/polygene/api/value/ValueBuilderTemplateTest.java b/core/api/src/test/java/org/apache/polygene/api/value/ValueBuilderTemplateTest.java index f52d103..8bdc56e 100644 --- a/core/api/src/test/java/org/apache/polygene/api/value/ValueBuilderTemplateTest.java +++ b/core/api/src/test/java/org/apache/polygene/api/value/ValueBuilderTemplateTest.java @@ -19,11 +19,11 @@ */ package org.apache.polygene.api.value; -import org.junit.Test; import org.apache.polygene.api.property.Property; import org.apache.polygene.bootstrap.AssemblyException; import org.apache.polygene.bootstrap.ModuleAssembly; import org.apache.polygene.test.AbstractPolygeneTest; +import org.junit.jupiter.api.Test; /** * TODO