├── .gitignore ├── LICENSE.txt ├── NOTICE.txt ├── RELEASE.txt ├── build.xml ├── checkstyle.xml ├── lib ├── commons-io-1.4.jar ├── database │ ├── db2java.zip │ ├── derby.jar │ ├── mysql-connector-java-5.0.4-bin.jar │ ├── ojdbc14.jar │ ├── postgresql-8.2-504.jdbc3.jar │ └── sqljdbc.jar ├── jboss-archive-browsing.jar ├── openjpa │ ├── openjpa-1.0.1.jar │ └── serp-1.13.1.jar ├── spring-agent.jar └── toplink │ ├── eclipselink.jar │ ├── toplink-api.jar │ └── toplink-essentials.jar ├── pom.xml ├── runIntegrationTest.bat ├── src ├── integrationtest │ ├── README.txt │ └── java │ │ └── org │ │ └── unitils │ │ └── integrationtest │ │ ├── JUnit4Test.java │ │ ├── Publisher.java │ │ ├── Subscriber.java │ │ ├── TestNGTest.java │ │ ├── TestNGTest1.java │ │ ├── UnitilsIntegrationTest.java │ │ ├── persistence │ │ ├── NoDatabaseTest.java │ │ ├── datasets │ │ │ ├── NoPersons.xml │ │ │ ├── SinglePerson-result.xml │ │ │ └── SinglePerson.xml │ │ ├── dbscripts │ │ │ └── 01_createPersonTable.sql │ │ ├── hibernate │ │ │ ├── HibernateSpringTest.java │ │ │ ├── HibernateTest.java │ │ │ ├── hibernate-test.cfg.xml │ │ │ └── hibernateSpringTest-spring.xml │ │ ├── jdbc │ │ │ └── JdbcTest.java │ │ └── jpa │ │ │ ├── HibernateJpaJotmSpringTest.java │ │ │ ├── HibernateJpaSpringTest.java │ │ │ ├── HibernateJpaTest.java │ │ │ ├── OpenJpaTest.java │ │ │ ├── ToplinkJpaSpringTest.java │ │ │ ├── ToplinkJpaTest.java │ │ │ ├── hibernate-persistence-test.xml │ │ │ ├── hibernateJpaJotmSpringTest-spring.xml │ │ │ ├── hibernateJpaSpringTest-spring.xml │ │ │ ├── openjpa-persistence-test.xml │ │ │ ├── toplink-persistence-test.xml │ │ │ └── toplinkJpaSpringTest-spring.xml │ │ ├── sampleproject │ │ ├── dao │ │ │ ├── PersonDao.java │ │ │ └── impl │ │ │ │ └── JdbcPersonDao.java │ │ └── model │ │ │ └── Person.java │ │ └── unitils-integrationtest.properties └── tools │ ├── java │ └── org │ │ └── unitils │ │ ├── build │ │ ├── ClassUsageFinder.java │ │ └── ClassUsageLoggingClassLoader.java │ │ └── site │ │ └── UnitilsSitePostprocessor.java │ └── resources │ └── log4j.xml ├── tools ├── addMissingMavenDeps │ ├── addEjb3PersistenceMavenDep.bat │ └── addJtaMavenDep.bat ├── jarjar │ ├── build.xml │ └── lib │ │ └── jarjar-1.0rc6.jar └── maven │ ├── assembly-unitils-with-dependencies.xml │ └── assembly-unitils.xml ├── unitils-core ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── unitils │ │ ├── TestRunnerAccessor.java │ │ ├── UnitilsBlockJUnit4ClassRunner.java │ │ ├── UnitilsJUnit3.java │ │ ├── UnitilsJUnit4.java │ │ ├── UnitilsJUnit4TestClassRunner.java │ │ ├── UnitilsLoggableTestRunner.java │ │ ├── UnitilsParameterized.java │ │ ├── core │ │ ├── ConfigurationLoader.java │ │ ├── Factory.java │ │ ├── Module.java │ │ ├── ModulesLoader.java │ │ ├── ModulesRepository.java │ │ ├── TestContext.java │ │ ├── TestListener.java │ │ ├── Unitils.java │ │ ├── UnitilsException.java │ │ ├── config │ │ │ ├── Configuration.java │ │ │ └── UnitilsConfiguration.java │ │ ├── dbsupport │ │ │ ├── Db2DbSupport.java │ │ │ ├── DbSupport.java │ │ │ ├── DbSupportFactory.java │ │ │ ├── DefaultSQLHandler.java │ │ │ ├── DerbyDbSupport.java │ │ │ ├── H2DbSupport.java │ │ │ ├── HsqldbDbSupport.java │ │ │ ├── MsSqlDbSupport.java │ │ │ ├── MySqlDbSupport.java │ │ │ ├── Oracle10DbSupport.java │ │ │ ├── Oracle9DbSupport.java │ │ │ ├── OracleDbSupport.java │ │ │ ├── PostgreSqlDbSupport.java │ │ │ └── SQLHandler.java │ │ ├── junit │ │ │ ├── AfterTestMethodStatement.java │ │ │ ├── AfterTestTearDownStatement.java │ │ │ ├── BeforeTestClassStatement.java │ │ │ ├── BeforeTestMethodStatement.java │ │ │ └── BeforeTestSetUpStatement.java │ │ └── util │ │ │ ├── AnnotatedInstanceManager.java │ │ │ ├── ArrayAndCollectionFormatter.java │ │ │ ├── BaseConfigurable.java │ │ │ ├── ConfigUtils.java │ │ │ ├── Configurable.java │ │ │ ├── FileResolver.java │ │ │ ├── ObjectFormatter.java │ │ │ ├── ObjectToInjectHolder.java │ │ │ ├── PropertiesReader.java │ │ │ ├── ResourceConfig.java │ │ │ ├── ResourceConfigLoader.java │ │ │ ├── StoredIdentifierCase.java │ │ │ └── TypeUtils.java │ │ ├── reflectionassert │ │ ├── ReflectionAssert.java │ │ ├── ReflectionComparator.java │ │ ├── ReflectionComparatorFactory.java │ │ ├── ReflectionComparatorMode.java │ │ ├── comparator │ │ │ ├── Comparator.java │ │ │ └── impl │ │ │ │ ├── CollectionComparator.java │ │ │ │ ├── HibernateProxyComparator.java │ │ │ │ ├── IgnoreDefaultsComparator.java │ │ │ │ ├── LenientDatesComparator.java │ │ │ │ ├── LenientNumberComparator.java │ │ │ │ ├── LenientOrderCollectionComparator.java │ │ │ │ ├── MapComparator.java │ │ │ │ ├── ObjectComparator.java │ │ │ │ └── SimpleCasesComparator.java │ │ ├── difference │ │ │ ├── ClassDifference.java │ │ │ ├── CollectionDifference.java │ │ │ ├── Difference.java │ │ │ ├── DifferenceVisitor.java │ │ │ ├── MapDifference.java │ │ │ ├── ObjectDifference.java │ │ │ └── UnorderedCollectionDifference.java │ │ ├── report │ │ │ ├── DifferenceReport.java │ │ │ ├── DifferenceView.java │ │ │ └── impl │ │ │ │ ├── DefaultDifferenceReport.java │ │ │ │ ├── DefaultDifferenceView.java │ │ │ │ ├── SimpleDifferenceView.java │ │ │ │ └── TreeDifferenceView.java │ │ └── util │ │ │ ├── HibernateUtil.java │ │ │ ├── InnerDifferenceFinder.java │ │ │ └── MatchingScoreCalculator.java │ │ ├── thirdparty │ │ └── org │ │ │ └── apache │ │ │ └── commons │ │ │ ├── dbutils │ │ │ └── DbUtils.java │ │ │ └── io │ │ │ ├── FileUtils.java │ │ │ ├── IOUtils.java │ │ │ ├── NullInputStream.java │ │ │ └── NullWriter.java │ │ └── util │ │ ├── AnnotationPropertyAccessor.java │ │ ├── AnnotationUtils.java │ │ ├── CollectionUtils.java │ │ ├── FileUtils.java │ │ ├── MethodUtils.java │ │ ├── MissingKeysException.java │ │ ├── ModuleUtils.java │ │ ├── PropertyUtils.java │ │ ├── ReaderInputStream.java │ │ ├── ReflectionUtils.java │ │ ├── ResourcebundleCheck.java │ │ └── WriterOutputStream.java │ └── resources │ └── unitils-default.properties ├── unitils-database ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── database │ ├── DataSourceWrapper.java │ ├── DatabaseModule.java │ ├── DatabaseUnitils.java │ ├── SQLUnitils.java │ ├── UnitilsDataSourceFactoryBean.java │ ├── annotations │ ├── TestDataSource.java │ └── Transactional.java │ ├── config │ ├── DataSourceFactory.java │ ├── DatabaseConfiguration.java │ ├── DatabaseConfigurations.java │ ├── DatabaseConfigurationsFactory.java │ └── PropertiesDataSourceFactory.java │ ├── sqlassert │ └── SqlAssert.java │ ├── transaction │ ├── UnitilsTransactionManager.java │ └── impl │ │ ├── DefaultUnitilsTransactionManager.java │ │ └── UnitilsTransactionManagementConfiguration.java │ └── util │ ├── Flushable.java │ └── TransactionMode.java ├── unitils-dbmaintainer ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── unitils │ │ └── dbmaintainer │ │ ├── DBMaintainer.java │ │ ├── clean │ │ ├── DBCleaner.java │ │ ├── DBClearer.java │ │ └── impl │ │ │ ├── DefaultDBCleaner.java │ │ │ └── DefaultDBClearer.java │ │ ├── locator │ │ ├── ClassPathDataLocator.java │ │ ├── ClassPathResourceLocator.java │ │ ├── ClassPathScriptLocator.java │ │ └── resourcepickingstrategie │ │ │ ├── ResourcePickingStrategie.java │ │ │ └── impl │ │ │ └── UniqueMostRecentPickingStrategie.java │ │ ├── script │ │ ├── ExecutedScript.java │ │ ├── Script.java │ │ ├── ScriptContentHandle.java │ │ ├── ScriptParser.java │ │ ├── ScriptRunner.java │ │ ├── ScriptSource.java │ │ ├── StatementBuilder.java │ │ ├── impl │ │ │ ├── DefaultScriptParser.java │ │ │ ├── DefaultScriptRunner.java │ │ │ ├── DefaultScriptSource.java │ │ │ ├── OracleScriptParser.java │ │ │ └── ResourceScriptSource.java │ │ └── parsingstate │ │ │ ├── ParsingState.java │ │ │ └── impl │ │ │ ├── BaseParsingState.java │ │ │ ├── InBlockCommentParsingState.java │ │ │ ├── InDoubleQuotesParsingState.java │ │ │ ├── InLineCommentParsingState.java │ │ │ ├── InSingleQuotesParsingState.java │ │ │ ├── NormalParsingState.java │ │ │ └── OracleNormalParsingState.java │ │ ├── structure │ │ ├── ConstraintsDisabler.java │ │ ├── DataSetStructureGenerator.java │ │ ├── SequenceUpdater.java │ │ └── impl │ │ │ ├── DefaultConstraintsDisabler.java │ │ │ ├── DefaultSequenceUpdater.java │ │ │ ├── DtdDataSetStructureGenerator.java │ │ │ └── XsdDataSetStructureGenerator.java │ │ ├── util │ │ ├── BaseDatabaseAccessor.java │ │ ├── DatabaseAccessing.java │ │ └── DatabaseModuleConfigUtils.java │ │ └── version │ │ ├── ExecutedScriptInfoSource.java │ │ ├── Version.java │ │ └── impl │ │ └── DefaultExecutedScriptInfoSource.java │ └── resources │ └── org │ └── unitils │ └── dbmaintainer │ └── util │ └── ant │ └── antlib.xml ├── unitils-dbunit ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── dbunit │ ├── DbUnitModule.java │ ├── DbUnitUnitils.java │ ├── annotation │ ├── DataSet.java │ ├── DataSets.java │ ├── ExpectedDataSet.java │ └── ExpectedDataSets.java │ ├── dataset │ ├── Column.java │ ├── Row.java │ ├── Schema.java │ ├── SchemaFactory.java │ ├── Table.java │ └── comparison │ │ ├── ColumnDifference.java │ │ ├── RowDifference.java │ │ ├── SchemaDifference.java │ │ └── TableDifference.java │ ├── datasetfactory │ ├── DataSetFactory.java │ ├── DataSetResolver.java │ └── impl │ │ ├── DbUnitDataSet.java │ │ ├── DbUnitTable.java │ │ ├── DbUnitTableMetaData.java │ │ ├── DefaultDataSetResolver.java │ │ ├── MultiSchemaXmlDataSetFactory.java │ │ └── ResourceMultiSchemaXmlDataSetFactory.java │ ├── datasetloadstrategy │ ├── DataSetLoadStrategy.java │ └── impl │ │ ├── BaseDataSetLoadStrategy.java │ │ ├── CleanInsertLoadStrategy.java │ │ ├── InsertLoadStrategy.java │ │ ├── RefreshLoadStrategy.java │ │ └── UpdateLoadStrategy.java │ └── util │ ├── DataSetAssert.java │ ├── DbUnitDatabaseConnection.java │ ├── FileHandler.java │ ├── MultiSchemaDataSet.java │ ├── MultiSchemaXmlDataSetReader.java │ └── MultiSchemaXmlDataSetReaderExtend.java ├── unitils-easymock ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── easymock │ ├── EasyMockModule.java │ ├── EasyMockUnitils.java │ ├── annotation │ ├── AfterCreateMock.java │ ├── Mock.java │ └── RegularMock.java │ └── util │ ├── Calls.java │ ├── Dates.java │ ├── Defaults.java │ ├── InvocationOrder.java │ ├── LenientMocksControl.java │ ├── Order.java │ └── ReflectionArgumentMatcher.java ├── unitils-inject ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── inject │ ├── InjectModule.java │ ├── annotation │ ├── InjectInto.java │ ├── InjectIntoByType.java │ ├── InjectIntoStatic.java │ ├── InjectIntoStaticByType.java │ └── TestedObject.java │ └── util │ ├── InjectionUtils.java │ ├── PropertyAccess.java │ ├── Restore.java │ └── ValueToRestore.java ├── unitils-io ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── io │ ├── IOModule.java │ ├── IOUnitils.java │ ├── annotation │ ├── FileContent.java │ ├── TempDir.java │ ├── TempFile.java │ └── handler │ │ ├── FileContentAnnotationHandler.java │ │ ├── TempDirAnnotationHandler.java │ │ └── TempFileAnnotationHandler.java │ ├── conversion │ ├── ConversionStrategy.java │ └── impl │ │ ├── PropertiesConversionStrategy.java │ │ └── StringConversionStrategy.java │ ├── filecontent │ ├── FileContentReader.java │ ├── FileContentReaderFactory.java │ └── impl │ │ ├── DefaultFileContentReader.java │ │ └── DefaultFileContentReaderFactory.java │ ├── reader │ ├── FileResolvingStrategy.java │ ├── FileResolvingStrategyFactory.java │ ├── ReadingStrategy.java │ ├── ReadingStrategyFactory.java │ └── impl │ │ ├── DefaultFileResolvingStrategy.java │ │ ├── DefaultFileResolvingStrategyFactory.java │ │ ├── FileReadingStrategy.java │ │ └── FileReadingStrategyFactory.java │ └── temp │ ├── TempService.java │ ├── TempServiceFactory.java │ └── impl │ ├── DefaultTempService.java │ └── DefaultTempServiceFactory.java ├── unitils-mock ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── mock │ ├── ArgumentMatchers.java │ ├── Mock.java │ ├── MockModule.java │ ├── MockUnitils.java │ ├── PartialMock.java │ ├── annotation │ ├── AfterCreateMock.java │ ├── ArgumentMatcher.java │ ├── Dummy.java │ └── MatchStatement.java │ ├── argumentmatcher │ ├── ArgumentMatcher.java │ ├── ArgumentMatcherPositionFinder.java │ ├── ArgumentMatcherRepository.java │ └── impl │ │ ├── AnyArgumentMatcher.java │ │ ├── DefaultArgumentMatcher.java │ │ ├── EqualsArgumentMatcher.java │ │ ├── LenEqArgumentMatcher.java │ │ ├── NotNullArgumentMatcher.java │ │ ├── NullArgumentMatcher.java │ │ ├── RefEqArgumentMatcher.java │ │ └── SameArgumentMatcher.java │ ├── core │ ├── BehaviorDefiningInvocation.java │ ├── BehaviorDefiningInvocations.java │ ├── MockFactory.java │ ├── MockObject.java │ ├── MockProxy.java │ ├── ObservedInvocation.java │ ├── PartialMockObject.java │ ├── PartialMockProxy.java │ ├── Scenario.java │ ├── matching │ │ ├── MatchingInvocationBuilder.java │ │ ├── MatchingInvocationHandler.java │ │ └── impl │ │ │ ├── AssertInvokedInSequenceVerifyingMatchingInvocationHandler.java │ │ │ ├── AssertInvokedVerifyingMatchingInvocationHandler.java │ │ │ ├── AssertNotInvokedVerifyingMatchingInvocationHandler.java │ │ │ ├── AssertVerifyingMatchingInvocationHandler.java │ │ │ └── BehaviorDefiningMatchingInvocationHandler.java │ └── proxy │ │ ├── CglibProxyMethodInterceptor.java │ │ ├── CloneUtil.java │ │ ├── ProxyFactory.java │ │ ├── ProxyInvocation.java │ │ ├── ProxyInvocationHandler.java │ │ ├── ProxyUtils.java │ │ └── StackTraceUtils.java │ ├── dummy │ ├── DummyObject.java │ └── DummyObjectUtil.java │ ├── mockbehavior │ ├── MockBehavior.java │ ├── ValidatableMockBehavior.java │ └── impl │ │ ├── DefaultValueReturningMockBehavior.java │ │ ├── DummyValueReturningMockBehavior.java │ │ ├── ExceptionThrowingMockBehavior.java │ │ ├── NoopMockBehavior.java │ │ ├── OriginalBehaviorInvokingMockBehavior.java │ │ ├── StubMockBehavior.java │ │ └── ValueReturningMockBehavior.java │ └── report │ ├── ScenarioReport.java │ └── impl │ ├── DefaultScenarioReport.java │ ├── DetailedObservedInvocationsReport.java │ ├── ObservedInvocationsReport.java │ ├── ProxyInvocationsReport.java │ └── SuggestedAssertsReport.java ├── unitils-orm ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ ├── orm │ ├── common │ │ ├── OrmModule.java │ │ ├── spring │ │ │ └── OrmSpringSupport.java │ │ └── util │ │ │ ├── ConfiguredOrmPersistenceUnit.java │ │ │ ├── OrmConfig.java │ │ │ └── OrmPersistenceUnitLoader.java │ ├── hibernate │ │ ├── HibernateModule.java │ │ ├── HibernateUnitils.java │ │ ├── annotation │ │ │ └── HibernateSessionFactory.java │ │ └── util │ │ │ ├── HibernateAnnotationConfigLoader.java │ │ │ ├── HibernateAssert.java │ │ │ ├── HibernateSessionFactoryLoader.java │ │ │ ├── HibernateSpringSupport.java │ │ │ └── UnitilsLocalSessionFactoryBean.java │ └── jpa │ │ ├── JpaModule.java │ │ ├── JpaUnitils.java │ │ ├── annotation │ │ └── JpaEntityManagerFactory.java │ │ └── util │ │ ├── JpaAnnotationConfigLoader.java │ │ ├── JpaConfig.java │ │ ├── JpaEntityManagerFactoryLoader.java │ │ ├── JpaProviderSupport.java │ │ ├── provider │ │ ├── hibernate │ │ │ ├── HibernateJpaProviderSupport.java │ │ │ ├── UnitilsHibernateJpaVendorAdapter.java │ │ │ └── UnitilsHibernatePersistenceProvider.java │ │ ├── openjpa │ │ │ └── OpenJpaProviderSupport.java │ │ └── toplink │ │ │ └── ToplinkJpaProviderSupport.java │ │ └── spring │ │ └── JpaSpringSupport.java │ └── util │ └── AnnotationConfigLoader.java ├── unitils-spring ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── unitils │ └── spring │ ├── SpringModule.java │ ├── SpringUnitils.java │ ├── annotation │ ├── ConfigureProfile.java │ ├── SpringApplicationContext.java │ ├── SpringBean.java │ ├── SpringBeanByName.java │ └── SpringBeanByType.java │ ├── profile │ ├── ProfileModule.java │ └── TypeConfiguration.java │ └── util │ ├── ApplicationContextFactory.java │ ├── ApplicationContextManager.java │ ├── ClassPathXmlApplicationContextFactory.java │ └── SpringUnitilsAdaptorTestExecutionListener.java ├── unitils-test ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── unitils │ │ │ ├── JUnit3TestExecutor.java │ │ │ ├── JUnit4TestExecutor.java │ │ │ ├── TestExecutor.java │ │ │ ├── TracingTestListener.java │ │ │ ├── UnitilsInvocationTestBase.java │ │ │ ├── UnitilsJUnit3TestBase.java │ │ │ ├── UnitilsJUnit3Test_TestClass1.java │ │ │ ├── UnitilsJUnit3Test_TestClass2.java │ │ │ ├── UnitilsJUnit4TestBase.java │ │ │ ├── UnitilsJUnit4Test_TestClass1.java │ │ │ ├── UnitilsJUnit4Test_TestClass2.java │ │ │ └── spring │ │ │ ├── SpringUnitilsJUnit38TestBase.java │ │ │ └── SpringUnitilsJUnit4TestBase.java │ └── test │ │ ├── java │ │ ├── DefaultPackageClass.java │ │ ├── DefaultPackageDataSet.java │ │ ├── DefaultPackageDataSet.xml │ │ ├── FileResolverTest-defaultPackage.txt │ │ └── org │ │ │ └── unitils │ │ │ ├── DefaultDataSetResolverTest-otherPackage.xml │ │ │ ├── FileResolverTest-otherPackage.txt │ │ │ ├── JUnitUnitilsInvocationExceptionTest.java │ │ │ ├── JUnitUnitilsInvocationTest.java │ │ │ ├── JustATestClass.java │ │ │ ├── UnitilsParameterizedGetParametersMethod.java │ │ │ ├── UnitilsParameterizedTest.java │ │ │ ├── UnitilsParameterizedTestClassRunnerForParameters.java │ │ │ ├── core │ │ │ ├── ConfigurationLoaderPropertyTest.java │ │ │ ├── ConfigurationLoaderTest.java │ │ │ ├── ModulesLoaderTest.java │ │ │ ├── ModulesRepositoryTest.java │ │ │ ├── config │ │ │ │ ├── ConfigurationContainsPropertyTest.java │ │ │ │ ├── ConfigurationGetAllPropertiesTest.java │ │ │ │ ├── ConfigurationGetBooleanListTest.java │ │ │ │ ├── ConfigurationGetBooleanTest.java │ │ │ │ ├── ConfigurationGetClassListTest.java │ │ │ │ ├── ConfigurationGetClassTest.java │ │ │ │ ├── ConfigurationGetEnumListTest.java │ │ │ │ ├── ConfigurationGetEnumValueTest.java │ │ │ │ ├── ConfigurationGetInstanceOfListTest.java │ │ │ │ ├── ConfigurationGetInstanceOfTest.java │ │ │ │ ├── ConfigurationGetIntegerListTest.java │ │ │ │ ├── ConfigurationGetIntegerTest.java │ │ │ │ ├── ConfigurationGetLongListTest.java │ │ │ │ ├── ConfigurationGetLongTest.java │ │ │ │ ├── ConfigurationGetOptionalBooleanListTest.java │ │ │ │ ├── ConfigurationGetOptionalBooleanTest.java │ │ │ │ ├── ConfigurationGetOptionalClassListTest.java │ │ │ │ ├── ConfigurationGetOptionalClassTest.java │ │ │ │ ├── ConfigurationGetOptionalEnumListTest.java │ │ │ │ ├── ConfigurationGetOptionalEnumValueTest.java │ │ │ │ ├── ConfigurationGetOptionalInstanceOfListTest.java │ │ │ │ ├── ConfigurationGetOptionalInstanceOfTest.java │ │ │ │ ├── ConfigurationGetOptionalIntegerListTest.java │ │ │ │ ├── ConfigurationGetOptionalIntegerTest.java │ │ │ │ ├── ConfigurationGetOptionalLongListTest.java │ │ │ │ ├── ConfigurationGetOptionalLongTest.java │ │ │ │ ├── ConfigurationGetOptionalStringClassifierTest.java │ │ │ │ ├── ConfigurationGetOptionalStringListTest.java │ │ │ │ ├── ConfigurationGetOptionalStringTest.java │ │ │ │ ├── ConfigurationGetOptionalValueListOfTypeTest.java │ │ │ │ ├── ConfigurationGetOptionalValueOfTypeTest.java │ │ │ │ ├── ConfigurationGetPropertiesTest.java │ │ │ │ ├── ConfigurationGetStringListTest.java │ │ │ │ ├── ConfigurationGetStringTest.java │ │ │ │ ├── ConfigurationGetValueListOfTypeTest.java │ │ │ │ ├── ConfigurationGetValueOfTypeTest.java │ │ │ │ ├── ConfigurationOverridingPropertiesTest.java │ │ │ │ ├── UnitilsConfigurationContainsPropertyTest.java │ │ │ │ ├── UnitilsConfigurationGetBooleanTest.java │ │ │ │ ├── UnitilsConfigurationGetInstanceOfTest.java │ │ │ │ ├── UnitilsConfigurationGetInstanceTest.java │ │ │ │ ├── UnitilsConfigurationGetIntTest.java │ │ │ │ ├── UnitilsConfigurationGetLongTest.java │ │ │ │ ├── UnitilsConfigurationGetPropertiesTest.java │ │ │ │ ├── UnitilsConfigurationGetStringListTest.java │ │ │ │ └── UnitilsConfigurationGetStringTest.java │ │ │ ├── dbsupport │ │ │ │ └── DbSupportTest.java │ │ │ ├── junit │ │ │ │ ├── AfterTestMethodStatementMockTest.java │ │ │ │ ├── AfterTestMethodStatementTest.java │ │ │ │ ├── AfterTestTearDownStatementTest.java │ │ │ │ ├── BeforeTestClassStatementTest.java │ │ │ │ ├── BeforeTestMethodStatementTest.java │ │ │ │ └── BeforeTestSetUpStatementTest.java │ │ │ └── util │ │ │ │ ├── FileResolverTest.java │ │ │ │ ├── FileResolverTest.txt │ │ │ │ ├── MockAndProxyObjectFormatterTest.java │ │ │ │ ├── PropertiesReaderTest.java │ │ │ │ ├── ReflectionUtilsTest.java │ │ │ │ ├── ResourcebundleCheckTest.java │ │ │ │ └── SQLTestUtils.java │ │ │ ├── database │ │ │ ├── DatabaseModuleGetCorrectWrapper.java │ │ │ ├── DatabaseModuleMultipleDatabasesTest.java │ │ │ ├── DatabaseModuleTest.java │ │ │ ├── DatabaseModuleTransactionManagerTest.java │ │ │ ├── DatabaseModuleTransactionalTestBase.java │ │ │ ├── config │ │ │ │ ├── DatabaseConfigurationsFactoryMultipleDatabaseTest.java │ │ │ │ ├── DatabaseConfigurationsFactoryTest.java │ │ │ │ ├── DatabaseConfigurationsTest.java │ │ │ │ └── PropertiesDataSourceFactoryTest.java │ │ │ └── sqlassert │ │ │ │ └── SqlAssertTest.java │ │ │ ├── dbmaintainer │ │ │ ├── DBMaintainerTest.java │ │ │ ├── DbMaintainerIntegrationTest.java │ │ │ ├── clean │ │ │ │ └── impl │ │ │ │ │ ├── DefaultDBCleanerMultiSchemaPreserveTest.java │ │ │ │ │ ├── DefaultDBCleanerMultiSchemaTest.java │ │ │ │ │ ├── DefaultDBCleanerTest.java │ │ │ │ │ ├── DefaultDBClearerMultiSchemaPreserveTest.java │ │ │ │ │ ├── DefaultDBClearerMultiSchemaTest.java │ │ │ │ │ ├── DefaultDBClearerPreserveDoesNotExistTest.java │ │ │ │ │ ├── DefaultDBClearerPreserveTest.java │ │ │ │ │ └── DefaultDBClearerTest.java │ │ │ ├── locator │ │ │ │ ├── ClassPathDataLocatorTest.java │ │ │ │ ├── ClassPathScriptLocatorTest.java │ │ │ │ ├── ResourceLoadingClassTest.java │ │ │ │ ├── ResourceLoadingDefaultClassTest.java │ │ │ │ ├── ResourceLoadingMethodTest.java │ │ │ │ └── ResourceLoadingMulitpleClassTest.java │ │ │ ├── resourcepickingstrategie │ │ │ │ └── ResourcePickingStrategieTest.java │ │ │ ├── script │ │ │ │ └── impl │ │ │ │ │ ├── DefaultScriptParserTest.java │ │ │ │ │ ├── DefaultScriptRunnerTest.java │ │ │ │ │ ├── DefaultScriptRunnerTest │ │ │ │ │ ├── test-script1.sql │ │ │ │ │ └── test-script2.sql │ │ │ │ │ ├── DefaultScriptSourceTest.java │ │ │ │ │ ├── DefaultScriptSourceTest │ │ │ │ │ └── test_scripts │ │ │ │ │ │ ├── 1_scripts │ │ │ │ │ │ ├── 001_scriptA.sql │ │ │ │ │ │ ├── 002_scriptB.sql │ │ │ │ │ │ ├── 003_scriptC.xxx │ │ │ │ │ │ └── scriptD.sql │ │ │ │ │ │ ├── 2_scripts │ │ │ │ │ │ ├── 002_scriptE.sql │ │ │ │ │ │ ├── scriptF.sql │ │ │ │ │ │ └── subfolder │ │ │ │ │ │ │ ├── 001_scriptG.sql │ │ │ │ │ │ │ └── scriptH.sql │ │ │ │ │ │ ├── postprocessing │ │ │ │ │ │ ├── post-scriptA.sql │ │ │ │ │ │ └── post-scriptB.sql │ │ │ │ │ │ └── scripts │ │ │ │ │ │ ├── 001_scriptI.sql │ │ │ │ │ │ └── scriptJ.sql │ │ │ │ │ ├── DefaultScriptSourceTest_DuplicateVersion │ │ │ │ │ ├── 001_scriptA.sql │ │ │ │ │ └── 001_scriptB.sql │ │ │ │ │ ├── ExtendedScriptSourceLoadAllScriptsTest.java │ │ │ │ │ ├── ExtendedScriptSourceTest.java │ │ │ │ │ ├── OracleScriptParserTest.java │ │ │ │ │ ├── ResourceScriptSourceQualifiersMultiSupportTest.java │ │ │ │ │ └── ScriptParserTest │ │ │ │ │ ├── plsql-script-ending-with-comment.sql │ │ │ │ │ ├── plsql-script.sql │ │ │ │ │ ├── sql-script-ending-with-comment.sql │ │ │ │ │ ├── sql-script-missing-semicolon.sql │ │ │ │ │ ├── sql-script-not-ending-with-new-line.sql │ │ │ │ │ └── sql-script.sql │ │ │ ├── structure │ │ │ │ ├── ConstraintsDisablerTest.java │ │ │ │ ├── DtdDataSetStructureGeneratorTest.java │ │ │ │ ├── SequenceUpdaterTest.java │ │ │ │ ├── XsdDataSetStructureGeneratorMultiSchemaTest.java │ │ │ │ └── XsdDataSetStructureGeneratorTest.java │ │ │ └── version │ │ │ │ ├── VersionTest.java │ │ │ │ └── impl │ │ │ │ └── DefaultExecutedScriptInfoSourceTest.java │ │ │ ├── dbunit │ │ │ ├── CustomDataSet.xml │ │ │ ├── DbUnitModuleDataSetMultiSchemaTest$DataSetTest.multiSchema.xml │ │ │ ├── DbUnitModuleDataSetMultiSchemaTest$DataSetTest.multiSchemaNoDefault.xml │ │ │ ├── DbUnitModuleDataSetMultiSchemaTest.java │ │ │ ├── DbUnitModuleDataSetOperationTest$DataSetTest.xml │ │ │ ├── DbUnitModuleDataSetOperationTest.java │ │ │ ├── DbUnitModuleDataSetTest$DataSetTestSubClass_dataSetAnnotationOnSubClass.xml │ │ │ ├── DbUnitModuleDataSetTest$DataSetTestSubClass_dataSetAnnotationOnSuperClass.xml │ │ │ ├── DbUnitModuleDataSetTest.java │ │ │ ├── DbUnitModuleTestDefaultDatabaseMetaHandler.java │ │ │ ├── DbunitDifferentCollumnsTest-WithAllColumns.xml │ │ │ ├── DbunitDifferentCollumnsTest-WithOnlyOneColumn.xml │ │ │ ├── DbunitDifferentCollumnsTest-WithOnlyPersonName.xml │ │ │ ├── DbunitDifferentColumnsTest-DifferentColumns.xml │ │ │ ├── DbunitDifferentColumnsTest-FirstContainsLessAttributes.xml │ │ │ ├── DbunitDifferentColumnsTest-FirstContainsMoreAttributes.xml │ │ │ ├── DbunitDifferentColumnsTest-FirstContainsNoAttributes.xml │ │ │ ├── DbunitDifferentColumnsTest-FirstContainsSameAttributes.xml │ │ │ ├── DbunitModuleNaming.java │ │ │ ├── DifferentColumnsDataSet.xml │ │ │ ├── EmptyTableTest.java │ │ │ ├── EmptyTableTest.xml │ │ │ ├── EmptyTablesTest2.java │ │ │ ├── ExpectedDataSetDifferentColumnsTest-DifferentColumns.xml │ │ │ ├── ExpectedDataSetDifferentColumnsTest-FirstContainsLessAttributes.xml │ │ │ ├── ExpectedDataSetDifferentColumnsTest-FirstContainsMoreAttributes.xml │ │ │ ├── ExpectedDataSetDifferentColumnsTest-FirstContainsSameAttributes.xml │ │ │ ├── ExpectedDataSetDifferentColumnsTest.java │ │ │ ├── ExpectedDataSetDifferentColumnsTest.xml │ │ │ ├── ExpectedDataSetNoAnnotationOnClassLevelTest$TestClass.testMethod1-result.xml │ │ │ ├── ExpectedDataSetNoAnnotationOnClassLevelTest.java │ │ │ ├── ExpectedDataSetTest$CustomTestClass.testMethod2-result.xml │ │ │ ├── ExpectedDataSetTest$TestClass.testMethod1-result.xml │ │ │ ├── ExpectedDataSetTest$TestClass.testMethod3-result.xml │ │ │ ├── ExpectedDataSetTest$TestClass.testMethod4-result.xml │ │ │ ├── ExpectedDataSetTest-nullValue.xml │ │ │ ├── ExpectedDataSetTest.java │ │ │ ├── ExpectedDataSetWithPrimaryKeysTest-differentValues.xml │ │ │ ├── ExpectedDataSetWithPrimaryKeysTest-emptyTable.xml │ │ │ ├── ExpectedDataSetWithPrimaryKeysTest-missingRow.xml │ │ │ ├── ExpectedDataSetWithPrimaryKeysTest.java │ │ │ ├── ExpectedDataSetWithPrimaryKeysTest.xml │ │ │ ├── JustAClass.java │ │ │ ├── dataSet1.xml │ │ │ ├── dataSet2.xml │ │ │ ├── dataset │ │ │ │ ├── ColumnComparisonTest.java │ │ │ │ ├── RowComparisonTest.java │ │ │ │ ├── RowComparisonWithPrimaryKeysTest.java │ │ │ │ ├── SchemaComparisonTest.java │ │ │ │ └── TableComparisonTest.java │ │ │ ├── datasetfactory │ │ │ │ └── impl │ │ │ │ │ ├── DefaultDataSetResolverTest.java │ │ │ │ │ └── DefaultDataSetResolverTest.xml │ │ │ ├── multidatabase │ │ │ │ ├── MultiDatabaseIntTest.java │ │ │ │ ├── MultiDatabaseIntTest.testMultipleDataSetsDatabase1_1.xml │ │ │ │ ├── MultiDatabaseIntTest.testMultipleDataSetsDatabase1_2.xml │ │ │ │ ├── MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_1.xml │ │ │ │ ├── MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_2.xml │ │ │ │ ├── MultiDatabaseIntTest.testOneDataSetDatabase1.xml │ │ │ │ └── MultiDatabaseIntTest.testOneDataSetDatabase2.xml │ │ │ └── util │ │ │ │ ├── FileHandlerCreateFileTest.java │ │ │ │ ├── FileHandlerDeleteFilesTest.java │ │ │ │ ├── FileHandlerWriteToFileTest.java │ │ │ │ ├── LessColumnsFirstDataSet.xml │ │ │ │ ├── LessColumnsLastDataSet.xml │ │ │ │ ├── MultiSchemaDataSet.xml │ │ │ │ ├── MultiSchemaNoDefaultDataSet.xml │ │ │ │ └── MultiSchemaXmlDataSetReaderTest.java │ │ │ ├── easymock │ │ │ ├── EasyMockModuleTest.java │ │ │ └── util │ │ │ │ ├── LenientMocksControlTest.java │ │ │ │ └── ReflectionArgumentMatcherTest.java │ │ │ ├── inject │ │ │ ├── InjectIntoByTypeWithMocksTest.java │ │ │ ├── InjectModuleCreateTestedObjectsTest.java │ │ │ ├── InjectModuleInjectIntoByTypeExceptionsTest.java │ │ │ ├── InjectModuleInjectIntoByTypeTest.java │ │ │ ├── InjectModuleInjectIntoExceptionsTest.java │ │ │ ├── InjectModuleInjectIntoStaticByTypeExceptionsTest.java │ │ │ ├── InjectModuleInjectIntoStaticTest.java │ │ │ ├── InjectModuleInjectIntoTest.java │ │ │ ├── InjectModuleRestoreInjectIntoByTypeTest.java │ │ │ ├── InjectModuleRestoreTest.java │ │ │ └── InjectionUtilsInjectIntoByTypeTest.java │ │ │ ├── io │ │ │ ├── DummyConversionStrategy.java │ │ │ ├── IOModuleIntegrationTest.java │ │ │ ├── IOModuleTempDirTest.java │ │ │ ├── IOModuleTempFileTest.java │ │ │ ├── IOUnitilsCreateTempDirTest.java │ │ │ ├── IOUnitilsCreateTempFileTest.java │ │ │ ├── IOUnitilsDeleteTempFileOrDirTest.java │ │ │ ├── IOUnitilsReadFileContentTest.java │ │ │ ├── IOUnitilsReadFileContentTest.properties │ │ │ ├── IOUnitilsReadFileContentTest.txt │ │ │ ├── annotation │ │ │ │ └── handler │ │ │ │ │ ├── FileContentAnnotationHandlerTest.java │ │ │ │ │ ├── TempDirAnnotationHandlerAfterTestMethodTest.java │ │ │ │ │ ├── TempDirAnnotationHandlerBeforeTestSetUpTest.java │ │ │ │ │ ├── TempFileAnnotationHandlerAfterTestMethodTest.java │ │ │ │ │ └── TempFileAnnotationHandlerBeforeTestSetUpTest.java │ │ │ ├── conversion │ │ │ │ └── impl │ │ │ │ │ ├── PropertiesConversionStrategyTest.java │ │ │ │ │ └── StringConversionStrategyTest.java │ │ │ ├── filecontent │ │ │ │ └── impl │ │ │ │ │ ├── DefaultFileContentReaderFactoryTest.java │ │ │ │ │ └── DefaultFileContentReaderTest.java │ │ │ ├── reader │ │ │ │ └── impl │ │ │ │ │ ├── DefaultFileResolvingStrategyFactoryTest.java │ │ │ │ │ └── FileReadingStrategyFactoryTest.java │ │ │ └── temp │ │ │ │ └── impl │ │ │ │ ├── DefaultTempServiceCreateTempDirTest.java │ │ │ │ ├── DefaultTempServiceCreateTempFileTest.java │ │ │ │ ├── DefaultTempServiceDeleteTempFileOrDirTest.java │ │ │ │ └── DefaultTempServiceFactoryTest.java │ │ │ ├── mock │ │ │ ├── MockModuleTest.java │ │ │ ├── annotation │ │ │ │ └── DummyTest.java │ │ │ ├── argumentmatcher │ │ │ │ ├── ArgumentMatcherAnyTest.java │ │ │ │ ├── ArgumentMatcherLongDoubleTest.java │ │ │ │ ├── ArgumentMatcherPositionFinderTest.java │ │ │ │ └── ArgumentMatcherTest.java │ │ │ ├── core │ │ │ │ ├── MockObjectAssertTest.java │ │ │ │ ├── MockObjectCastTest.java │ │ │ │ ├── MockObjectChainedMethodsTest.java │ │ │ │ ├── MockObjectInvalidSyntaxTest.java │ │ │ │ ├── MockObjectMatchingBehaviorTest.java │ │ │ │ ├── MockObjectPartialMockTest.java │ │ │ │ ├── MockObjectPerformsTest.java │ │ │ │ ├── MockObjectRaisesTest.java │ │ │ │ ├── MockObjectResetTest.java │ │ │ │ ├── MockObjectReturningOtherMockTest.java │ │ │ │ ├── MockObjectReturnsTest.java │ │ │ │ ├── MockObjectTest.java │ │ │ │ ├── PartialMockConstructorTest.java │ │ │ │ ├── PartialMockObjectMockedInstanceTest.java │ │ │ │ ├── PartialMockObjectStubTest.java │ │ │ │ ├── PartialMockObjectTest.java │ │ │ │ └── proxy │ │ │ │ │ ├── CloneUtilTest.java │ │ │ │ │ ├── GetProxiedTypeIfProxyUtilTest.java │ │ │ │ │ └── StackTraceUtilsTest.java │ │ │ ├── dummy │ │ │ │ └── DummyObjectUtilTest.java │ │ │ ├── mockbehavior │ │ │ │ └── impl │ │ │ │ │ ├── DefaultValueReturningMockBehaviorExecuteNumbersTest.java │ │ │ │ │ └── DefaultValueReturningMockBehaviorExecuteTest.java │ │ │ └── report │ │ │ │ └── impl │ │ │ │ ├── DetailedObservedInvocationsReportFieldNamesTest.java │ │ │ │ ├── DetailedObservedInvocationsReportTest.java │ │ │ │ ├── FieldNamesDetailedObservedInvocationsReportTest.java │ │ │ │ ├── FieldNamesObservedInvocationsReportTest.java │ │ │ │ ├── ObservedInvocationsReportTest.java │ │ │ │ └── SuggestedAssertsReportTest.java │ │ │ ├── orm │ │ │ ├── hibernate │ │ │ │ ├── HibernateModuleConfigurationInheritanceTest.java │ │ │ │ ├── HibernateModuleConfigurationTest.java │ │ │ │ ├── HibernateModuleInjectionTest.java │ │ │ │ ├── hibernate-sub.cfg.xml │ │ │ │ └── hibernate.cfg.xml │ │ │ └── jpa │ │ │ │ ├── JpaModuleInjectionTest.java │ │ │ │ └── persistence-test.xml │ │ │ ├── parameterized │ │ │ ├── JustATestClass.java │ │ │ ├── ParameterizedIntegrationTest.java │ │ │ ├── UnitilsParametersNullParametersStveParametersTest.java │ │ │ └── UnitilsParametersNullParametersTest.java │ │ │ ├── reflectionassert │ │ │ ├── Car.java │ │ │ ├── Person.java │ │ │ ├── ReflectionAssertAssertPropertiesNotNullTest.java │ │ │ ├── ReflectionAssertCollectionsTest.java │ │ │ ├── ReflectionAssertCyclicCollectionTest.java │ │ │ ├── ReflectionAssertErrorMessagesTest.java │ │ │ ├── ReflectionAssertPropertiesCollectionsTest.java │ │ │ ├── ReflectionAssertPropertiesTest.java │ │ │ ├── ReflectionAssertTest.java │ │ │ ├── ReflectionAssertTraversedInstanceTest.java │ │ │ ├── ReflectionComparatorArrayTest.java │ │ │ ├── ReflectionComparatorCalendarTest.java │ │ │ ├── ReflectionComparatorCollectionTest.java │ │ │ ├── ReflectionComparatorDateTest.java │ │ │ ├── ReflectionComparatorEnumsTest.java │ │ │ ├── ReflectionComparatorLenientOrderCollectionsTest.java │ │ │ ├── ReflectionComparatorLenientTest.java │ │ │ ├── ReflectionComparatorMapTest.java │ │ │ ├── ReflectionComparatorPrimitivesArrayTest.java │ │ │ ├── ReflectionComparatorPrimitivesTest.java │ │ │ ├── ReflectionComparatorSharedReferencesTest.java │ │ │ ├── ReflectionComparatorTest.java │ │ │ └── hibernate │ │ │ │ ├── Child.java │ │ │ │ ├── Parent.java │ │ │ │ ├── ReflectionComparatorHibernateProxyTest-context.xml │ │ │ │ ├── ReflectionComparatorHibernateProxyTest.java │ │ │ │ └── hibernate.cfg.xml │ │ │ ├── spring │ │ │ ├── SpringModuleApplicationContextInheritanceTest.java │ │ │ ├── SpringModuleApplicationContextTest.java │ │ │ ├── SpringModuleInjectApplicationContextTest.java │ │ │ ├── SpringModuleSpringBeansTest.java │ │ │ ├── SpringUnitilsJUnit38Test_TestClass1.java │ │ │ ├── SpringUnitilsJUnit38Test_TestClass2.java │ │ │ ├── SpringUnitilsJUnit4Test_TestClass1.java │ │ │ ├── SpringUnitilsJUnit4Test_TestClass2.java │ │ │ ├── profile │ │ │ │ ├── ProfileModuleInjectBeans.java │ │ │ │ ├── ProfileModuleTest.java │ │ │ │ ├── ProfilesModuleConfigurationIntegrationTest.java │ │ │ │ ├── ProfilesModuleSpringApplicationContextIntegrationTest.java │ │ │ │ ├── TestProfile.java │ │ │ │ └── TestProfile1.java │ │ │ └── services-config.xml │ │ │ └── util │ │ │ ├── AnnotationUtilsTest.java │ │ │ ├── ModuleUtilsTest.java │ │ │ ├── PropertyUtilsTest.java │ │ │ ├── ReflectionUtilsCreateInstanceOfTypeTest.java │ │ │ ├── ReflectionUtilsEnumTest.java │ │ │ ├── ReflectionUtilsGetGenericTypesTest.java │ │ │ ├── ReflectionUtilsTest.java │ │ │ └── ReflectionUtilsTypesTest.java │ │ └── resources │ │ ├── applicationContext-dao-test.xml │ │ ├── dbscripts │ │ └── Person.sql │ │ ├── hibernate.cfg.xml │ │ ├── log4j.xml │ │ ├── org │ │ └── unitils │ │ │ ├── database │ │ │ ├── DatabaseUnitilsTest.sql │ │ │ ├── MultipleDatabases.xml │ │ │ └── config │ │ │ │ ├── H2DbSupportTest.properties │ │ │ │ ├── H2DbSupportTestDefault.properties │ │ │ │ ├── config-oracle.properties │ │ │ │ ├── testconfig.properties │ │ │ │ ├── testconfigMultipleDatabases.properties │ │ │ │ ├── testconfig_defaultdatabase.properties │ │ │ │ └── unitils.properties │ │ │ ├── dbmaintainer │ │ │ └── locator │ │ │ │ ├── ResourceLoadingDefaultClassTest.xml │ │ │ │ ├── ResourceLoadingMethodTest.testLoadingResourceDatasetDefault-result.xml │ │ │ │ └── ResourceLoadingMethodTest.xml │ │ │ ├── dbunit │ │ │ ├── DbUnitModuleNaming.xml │ │ │ ├── JustAClass-method1.xml │ │ │ ├── test1 │ │ │ │ └── testFile.txt │ │ │ ├── test2 │ │ │ │ └── testFile.txt │ │ │ └── testdbscripts │ │ │ │ ├── 001_Initial_TESTcreate.sql │ │ │ │ ├── 002_Initial_TESTcreate.sql │ │ │ │ ├── 003_Initial_TESTcreate.sql │ │ │ │ └── testsubpackage │ │ │ │ └── 004_Initial_TESTcreate.sql │ │ │ ├── io │ │ │ ├── FileContentTestListenerTest$DefaultTestStub.properties │ │ │ ├── FileContentTestListenerTest$DefaultTestStub.txt │ │ │ ├── IOModuleIntegrationTest.properties │ │ │ └── IOModuleIntegrationTest.txt │ │ │ ├── spring │ │ │ └── profile │ │ │ │ ├── DummyTable.sql │ │ │ │ └── applicationContext-dao-test.xml │ │ │ └── testdata │ │ │ ├── exampleCorruptResourceData.xml │ │ │ ├── exampleFunkyData.xml │ │ │ ├── exampleResourceData.xml │ │ │ └── exampleResourceLoadingData.xml │ │ ├── propertiesReaderTest.properties │ │ ├── resourcebundle │ │ ├── comments_de.properties │ │ ├── comments_fr.properties │ │ ├── comments_nl.properties │ │ ├── invoice_de.properties │ │ ├── invoice_fr.properties │ │ └── invoice_nl.properties │ │ └── unitils.properties └── test-output │ ├── Default suite │ ├── Default test.html │ └── Default test.xml │ ├── bullet_point.png │ ├── collapseall.gif │ ├── emailable-report.html │ ├── failed.png │ ├── index.html │ ├── jquery-1.7.1.min.js │ ├── navigator-bullet.png │ ├── old │ ├── Default suite │ │ ├── Default test.properties │ │ ├── classes.html │ │ ├── groups.html │ │ ├── index.html │ │ ├── main.html │ │ ├── methods-alphabetical.html │ │ ├── methods-not-run.html │ │ ├── methods.html │ │ ├── reporter-output.html │ │ ├── testng.xml.html │ │ └── toc.html │ └── index.html │ ├── passed.png │ ├── skipped.png │ ├── testng-reports.css │ ├── testng-reports.js │ ├── testng-results.xml │ └── testng.css ├── unitils-testng-test ├── pom.xml ├── src │ └── test │ │ └── java │ │ └── org │ │ └── unitils │ │ ├── TestNGTestExecutor.java │ │ ├── TestNGUnitilsInvocationExceptionTest.java │ │ ├── TestNGUnitilsInvocationTest.java │ │ ├── UnitilsTestNGTestBase.java │ │ ├── UnitilsTestNGTest_EmptyTestClass.java │ │ ├── UnitilsTestNGTest_GroupsTest.java │ │ ├── UnitilsTestNGTest_TestClass1.java │ │ ├── UnitilsTestNGTest_TestClass2.java │ │ └── spring │ │ ├── SpringUnitilsTestNGTest.java │ │ ├── SpringUnitilsTestNGTest_TestClass1.java │ │ └── SpringUnitilsTestNGTest_TestClass2.java └── unitils-testng-test.iml └── unitils-testng ├── pom.xml └── src └── main └── java └── org └── unitils └── UnitilsTestNG.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | /.idea 3 | /target -------------------------------------------------------------------------------- /RELEASE.txt: -------------------------------------------------------------------------------- 1 | Maven release tasks: 2 | 3 | mvn release:prepare 4 | mvn release:perform 5 | mvn release:clean 6 | 7 | 8 | Step 1: Actual run 9 | 10 | Command: mvn release:prepare 11 | 12 | This will: check whether everything is ready to be release 13 | update version 14 | create release tag 15 | 16 | 17 | 18 | 19 | Step 2: Create release 20 | 21 | Command: mvn release:perform 22 | 23 | This will: download clean release 24 | build unitils 25 | create distribution 26 | upload the unitils jar to the repository on SourceForge 27 | 28 | 29 | 30 | Note: to set-up the FTP connection to SourceForge, you need to add following settings.xml to /.m2 31 | 32 | 33 | 34 | 35 | sourceforge-repository 36 | your_username 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /lib/commons-io-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/commons-io-1.4.jar -------------------------------------------------------------------------------- /lib/database/db2java.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/db2java.zip -------------------------------------------------------------------------------- /lib/database/derby.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/derby.jar -------------------------------------------------------------------------------- /lib/database/mysql-connector-java-5.0.4-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/mysql-connector-java-5.0.4-bin.jar -------------------------------------------------------------------------------- /lib/database/ojdbc14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/ojdbc14.jar -------------------------------------------------------------------------------- /lib/database/postgresql-8.2-504.jdbc3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/postgresql-8.2-504.jdbc3.jar -------------------------------------------------------------------------------- /lib/database/sqljdbc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/database/sqljdbc.jar -------------------------------------------------------------------------------- /lib/jboss-archive-browsing.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/jboss-archive-browsing.jar -------------------------------------------------------------------------------- /lib/openjpa/openjpa-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/openjpa/openjpa-1.0.1.jar -------------------------------------------------------------------------------- /lib/openjpa/serp-1.13.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/openjpa/serp-1.13.1.jar -------------------------------------------------------------------------------- /lib/spring-agent.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/spring-agent.jar -------------------------------------------------------------------------------- /lib/toplink/eclipselink.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/toplink/eclipselink.jar -------------------------------------------------------------------------------- /lib/toplink/toplink-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/toplink/toplink-api.jar -------------------------------------------------------------------------------- /lib/toplink/toplink-essentials.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/lib/toplink/toplink-essentials.jar -------------------------------------------------------------------------------- /runIntegrationTest.bat: -------------------------------------------------------------------------------- 1 | java -javaagent:C:/Projects/unitils/lib/spring-agent-2.5.2.jar -cp bin;lib/spring;lib/antlr-2.7.6rc1.jar;lib/cglib-nodep-2.1_3.jar;lib/commons-collections-3.2.jar;lib/commons-dbcp-1.2.2.jar;lib/commons-io-1.4.jar;lib/commons-lang-2.3.jar;lib/commons-logging-1.1.jar;lib/commons-pool-1.2.jar;lib/dbunit-2.2.jar;lib/dom4j-1.6.1.jar;lib/hibernate-3.2.5.ga.jar;lib/hibernate-annotations-3.3.0.ga.jar;lib/hibernate-commons-annotations-3.3.0.ga.jar;lib/hibernate-entitymanager-3.3.1.jar;lib/hsqldb.jar;lib/javassist-3.6.ga.jar;lib/javax-persistence-3.0-public_review.jar;lib/jboss-archive-browsing.jar;lib/jta-1.0.1B.jar;lib/junit-4.4.jar;lib/ognl-2.6.9.jar;lib/toplink/toplink-api.jar;lib/toplink/toplink-essentials.jar;lib/openjpa/openjpa-1.0.1.jar;lib/openjpa/serp-1.13.1.jar;lib/testng-5.7-jdk15.jar;lib/spring-test-2.5.2.jar;lib/easymock-2.3.jar;lib/easymockclassextension-2.3.jar;lib/jmock-2.4.0.jar org.unitils.integrationtest.UnitilsIntegrationTest -------------------------------------------------------------------------------- /src/integrationtest/README.txt: -------------------------------------------------------------------------------- 1 | This source folder contains a number of integration tests for unitils. 2 | All tests are executed from org.unitils.integrationtest.UnitilsIntegrationTest, the other test classes in this source folder are used by UnitilsIntegrationTest and are not meant to be run separately. 3 | 4 | For the toplink tests to pass, following jvm parameter must be added: 5 | -javaagent:/path-to-unitils/lib/spring-agent.jar 6 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/JUnit4Test.java: -------------------------------------------------------------------------------- 1 | package org.unitils.integrationtest; 2 | 3 | import org.junit.Test; 4 | 5 | public class JUnit4Test { 6 | 7 | 8 | 9 | public JUnit4Test() { 10 | super(); 11 | System.out.println("Constructor"); 12 | } 13 | 14 | @Test public void test1() { 15 | System.out.println("test1"); 16 | } 17 | 18 | @Test public void test2() { 19 | System.out.println("test2"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/Publisher.java: -------------------------------------------------------------------------------- 1 | package org.unitils.integrationtest; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class Publisher { 7 | 8 | private Set subscribers = new HashSet(); 9 | 10 | public void addSubscriber(Subscriber subscriber) { 11 | subscribers.add(subscriber); 12 | } 13 | 14 | public void publish(String message) { 15 | for (Subscriber subscriber : subscribers) { 16 | subscriber.receive(message); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/Subscriber.java: -------------------------------------------------------------------------------- 1 | package org.unitils.integrationtest; 2 | 3 | public interface Subscriber { 4 | 5 | public void receive(String message); 6 | } 7 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/TestNGTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.integrationtest; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.testng.Assert; 6 | import org.testng.TestListenerAdapter; 7 | import org.testng.TestNG; 8 | import org.testng.annotations.AfterMethod; 9 | import org.testng.annotations.BeforeMethod; 10 | import org.testng.annotations.Test; 11 | import org.testng.reporters.TextReporter; 12 | import org.unitils.UnitilsTestNG; 13 | 14 | public class TestNGTest extends UnitilsTestNG { 15 | 16 | @BeforeMethod 17 | public void before(Method m) { 18 | System.out.println("BeforeMethod " + m.getName()); 19 | } 20 | 21 | @Test public void test() { 22 | System.out.println("executing"); 23 | Assert.assertEquals("test", "test"); 24 | } 25 | 26 | @Test public void test1() { 27 | System.out.println("executing"); 28 | Assert.assertEquals("test", "test1"); 29 | } 30 | 31 | @AfterMethod 32 | public void after(Method m) { 33 | System.out.println("AfterMethod " + m.getName()); 34 | } 35 | 36 | public static void main(String[] args) { 37 | TestListenerAdapter tla = new TextReporter("test", 3); 38 | TestNG testng = new TestNG(); 39 | testng.setTestClasses(new Class[] { TestNGTest.class}); 40 | testng.addListener(tla); 41 | testng.run(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/TestNGTest1.java: -------------------------------------------------------------------------------- 1 | package org.unitils.integrationtest; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.testng.Assert; 6 | import org.testng.TestListenerAdapter; 7 | import org.testng.TestNG; 8 | import org.testng.annotations.AfterMethod; 9 | import org.testng.annotations.BeforeMethod; 10 | import org.testng.annotations.Test; 11 | import org.testng.reporters.TextReporter; 12 | import org.unitils.UnitilsTestNG; 13 | 14 | public class TestNGTest1 extends UnitilsTestNG { 15 | 16 | @BeforeMethod 17 | public void before(Method m) { 18 | System.out.println("BeforeMethod " + m.getName()); 19 | } 20 | 21 | @Test public void test() { 22 | System.out.println("executing"); 23 | Assert.assertEquals("test", "test"); 24 | } 25 | 26 | @Test public void test1() { 27 | System.out.println("executing"); 28 | Assert.assertEquals("test", "test1"); 29 | } 30 | 31 | @AfterMethod 32 | public void after(Method m) { 33 | System.out.println("AfterMethod " + m.getName()); 34 | } 35 | 36 | public static void main(String[] args) { 37 | TestListenerAdapter tla = new TextReporter("test", 3); 38 | TestNG testng = new TestNG(); 39 | testng.setTestClasses(new Class[] { TestNGTest.class}); 40 | testng.addListener(tla); 41 | testng.run(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/NoDatabaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2007, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.integrationtest.persistence; 17 | 18 | import static junit.framework.Assert.assertTrue; 19 | 20 | import org.junit.Test; 21 | import org.unitils.UnitilsJUnit4; 22 | 23 | /** 24 | * @author Filip Neven 25 | * @author Tim Ducheyne 26 | */ 27 | public class NoDatabaseTest extends UnitilsJUnit4 { 28 | 29 | @Test 30 | public void testWhichDoesntNeedDatabase() { 31 | assertTrue("This test must pass", true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/datasets/NoPersons.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/datasets/SinglePerson-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/datasets/SinglePerson.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/dbscripts/01_createPersonTable.sql: -------------------------------------------------------------------------------- 1 | create table person (id varchar(10) not null, name varchar(20) not null); 2 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/hibernate/hibernate-test.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | org.hibernate.dialect.HSQLDialect 10 | 11 | 12 | org.hibernate.cache.NoCacheProvider 13 | 14 | 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/hibernate/hibernateSpringTest-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | org.unitils.integrationtest.sampleproject.model.Person 10 | 11 | 12 | 13 | 14 | hibernate.dialect=org.hibernate.dialect.HSQLDialect 15 | hibernate.show_sql=true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/jpa/hibernate-persistence-test.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.hibernate.ejb.HibernatePersistence 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/jpa/hibernateJpaSpringTest-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/jpa/openjpa-persistence-test.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.apache.openjpa.persistence.PersistenceProviderImpl 8 | 9 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/jpa/toplink-persistence-test.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider 8 | 9 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/persistence/jpa/toplinkJpaSpringTest-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/sampleproject/dao/PersonDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.integrationtest.sampleproject.dao; 17 | 18 | import org.unitils.integrationtest.sampleproject.model.Person; 19 | 20 | public interface PersonDao { 21 | 22 | Person findById(Long id); 23 | 24 | void persist(Person person); 25 | } 26 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/sampleproject/model/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.integrationtest.sampleproject.model; 17 | 18 | 19 | import javax.persistence.Column; 20 | import javax.persistence.Entity; 21 | import javax.persistence.Id; 22 | import javax.persistence.Table; 23 | 24 | /** 25 | * Represents a user 26 | */ 27 | @Entity 28 | @Table(name = "PERSON") 29 | public class Person { 30 | 31 | @Id 32 | private Long id; 33 | 34 | @Column 35 | private String name; 36 | 37 | 38 | protected Person() { 39 | super(); 40 | } 41 | 42 | public Person(Long id, String name) { 43 | this.id = id; 44 | this.name = name; 45 | } 46 | 47 | public Long getId() { 48 | return id; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/integrationtest/java/org/unitils/integrationtest/unitils-integrationtest.properties: -------------------------------------------------------------------------------- 1 | # Properties for the PropertiesDataSourceFactory 2 | database.driverClassName=org.hsqldb.jdbcDriver 3 | database.url=jdbc:hsqldb:mem:unitils 4 | database.userName=sa 5 | database.password= 6 | 7 | database.dialect=hsqldb 8 | database.schemaNames=public 9 | 10 | updateDataBaseSchema.enabled=true 11 | 12 | dbMaintainer.script.locations=C:/Temp/unitilsintegrationtests 13 | dbMaintainer.generateDataSetStructure.enabled=false 14 | dbMaintainer.disableConstraints.enabled=false 15 | dbMaintainer.updateSequences.enabled=false 16 | dbMaintainer.autoCreateExecutedScriptsTable=true -------------------------------------------------------------------------------- /src/tools/java/org/unitils/build/ClassUsageLoggingClassLoader.java: -------------------------------------------------------------------------------- 1 | package org.unitils.build; 2 | 3 | import java.util.SortedSet; 4 | import java.util.TreeSet; 5 | 6 | public class ClassUsageLoggingClassLoader extends ClassLoader { 7 | 8 | private static SortedSet loadedClasses = new TreeSet(); 9 | 10 | private static SortedSet foundClasses = new TreeSet(); 11 | 12 | 13 | 14 | public ClassUsageLoggingClassLoader() { 15 | super(); 16 | } 17 | 18 | 19 | public ClassUsageLoggingClassLoader(ClassLoader parent) { 20 | super(parent); 21 | } 22 | 23 | @Override 24 | public Class loadClass(String name) throws ClassNotFoundException { 25 | loadedClasses.add(name); 26 | return super.loadClass(name); 27 | } 28 | 29 | @Override 30 | public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { 31 | loadedClasses.add(name); 32 | return super.loadClass(name, resolve); 33 | } 34 | 35 | 36 | @Override 37 | protected Class findClass(String name) throws ClassNotFoundException { 38 | foundClasses.add(name); 39 | return super.findClass(name); 40 | } 41 | 42 | 43 | public static SortedSet getLoadedClasses() { 44 | return loadedClasses; 45 | } 46 | 47 | 48 | public static SortedSet getFoundClasses() { 49 | return foundClasses; 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/tools/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tools/addMissingMavenDeps/addEjb3PersistenceMavenDep.bat: -------------------------------------------------------------------------------- 1 | mvn install:install-file -DgroupId=javax.persistence -DartifactId=ejb -Dversion=3.0-public_review -Dpackaging=jar -Dfile=../../lib/javax-persistence-3.0-public_review.jar -------------------------------------------------------------------------------- /tools/addMissingMavenDeps/addJtaMavenDep.bat: -------------------------------------------------------------------------------- 1 | mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=../../lib/jta-1.0.1B.jar -------------------------------------------------------------------------------- /tools/jarjar/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tools/jarjar/lib/jarjar-1.0rc6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/tools/jarjar/lib/jarjar-1.0rc6.jar -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/TestRunnerAccessor.java: -------------------------------------------------------------------------------- 1 | 2 | package org.unitils; 3 | 4 | import java.lang.reflect.Method; 5 | 6 | /** 7 | * Interface to expose the capability of executing test methods to the outside 8 | * world. 9 | * 10 | * @author jef 11 | */ 12 | public interface TestRunnerAccessor { 13 | 14 | /** 15 | * Execute a test method on a given tested object. 16 | * @param testedObject 17 | * @param testMethod 18 | */ 19 | void executeTestMethod(Object testedObject, Method testMethod); 20 | } 21 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/UnitilsJUnit4.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | import org.junit.runner.RunWith; 19 | 20 | /** 21 | * Base test class that will Unitils-enable your test. This base class will make sure that the 22 | * core unitils test listener methods are invoked in the expected order. See {@link org.unitils.core.TestListener} for 23 | * more information on the listener invocation order. 24 | *

25 | * This actually is an empty test class that only instructs JUnit4 to use a custom test runner for the test. 26 | * As an alternative to subclassing this class, you could also add the @RunWith(UnitilsJUnit4TestClassRunner.class) to 27 | * your test base class. 28 | * 29 | * @author Tim Ducheyne 30 | */ 31 | @RunWith(UnitilsJUnit4TestClassRunner.class) 32 | public abstract class UnitilsJUnit4 { 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/UnitilsLoggableTestRunner.java: -------------------------------------------------------------------------------- 1 | package org.unitils; 2 | 3 | import org.junit.internal.runners.InitializationError; 4 | import org.junit.internal.runners.MethodRoadie; 5 | import org.junit.internal.runners.TestMethod; 6 | import org.junit.runner.Description; 7 | import org.junit.runner.notification.RunNotifier; 8 | 9 | import java.lang.reflect.Method; 10 | 11 | public class UnitilsLoggableTestRunner extends UnitilsJUnit4TestClassRunner { 12 | public UnitilsLoggableTestRunner(Class testClass) 13 | throws InitializationError { 14 | super(testClass); 15 | } 16 | 17 | protected MethodRoadie createMethodRoadie(Object testObject, Method testMethod, TestMethod jUnitTestMethod, RunNotifier notifier, Description description) { 18 | return new LoggingTestListenerInvokingMethodRoadie(testObject, testMethod, jUnitTestMethod, notifier, description); 19 | } 20 | 21 | protected class LoggingTestListenerInvokingMethodRoadie extends UnitilsJUnit4TestClassRunner.TestListenerInvokingMethodRoadie { 22 | public LoggingTestListenerInvokingMethodRoadie(Object testObject, Method testMethod, TestMethod jUnitTestMethod, RunNotifier notifier, Description description) { 23 | super(testObject, testMethod, jUnitTestMethod, notifier, description); 24 | } 25 | 26 | protected void runTestMethod() { 27 | String name = this.testMethod.getName(); 28 | System.out.println("\n--------- " + name + " started --------- "); 29 | super.runTestMethod(); 30 | System.out.println("--------- " + name + " ended ----------- \n"); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/Factory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.core; 18 | 19 | /** 20 | * @author Tim Ducheyne 21 | */ 22 | public interface Factory { 23 | 24 | T create(); 25 | } 26 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/UnitilsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core; 17 | 18 | /** 19 | * Exception type, used for all unrecoverable exceptions that occur in unitils. 20 | */ 21 | public class UnitilsException extends RuntimeException { 22 | 23 | public UnitilsException() { 24 | } 25 | 26 | public UnitilsException(String message) { 27 | super(message); 28 | } 29 | 30 | public UnitilsException(String message, Throwable cause) { 31 | super(message, cause); 32 | } 33 | 34 | public UnitilsException(Throwable cause) { 35 | super(cause); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/dbsupport/Oracle10DbSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.dbsupport; 17 | 18 | /** 19 | * @author Filip Neven 20 | * @author Tim Ducheyne 21 | */ 22 | public class Oracle10DbSupport extends OracleDbSupport { 23 | 24 | @Override 25 | protected Integer getOracleMajorVersionNumber() { 26 | return 10; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/dbsupport/Oracle9DbSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.dbsupport; 17 | 18 | /** 19 | * @author Filip Neven 20 | * @author Tim Ducheyne 21 | */ 22 | public class Oracle9DbSupport extends OracleDbSupport { 23 | 24 | @Override 25 | protected Integer getOracleMajorVersionNumber() { 26 | return 9; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/junit/BeforeTestClassStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.junit; 17 | 18 | import org.junit.runners.model.Statement; 19 | import org.unitils.core.TestListener; 20 | 21 | /** 22 | * @author Tim Ducheyne 23 | */ 24 | public class BeforeTestClassStatement extends Statement { 25 | 26 | protected Class testClass; 27 | protected TestListener unitilsTestListener; 28 | protected Statement nextStatement; 29 | 30 | 31 | public BeforeTestClassStatement(Class testClass, TestListener unitilsTestListener, Statement nextStatement) { 32 | this.testClass = testClass; 33 | this.unitilsTestListener = unitilsTestListener; 34 | this.nextStatement = nextStatement; 35 | } 36 | 37 | 38 | @Override 39 | public void evaluate() throws Throwable { 40 | unitilsTestListener.beforeTestClass(testClass); 41 | nextStatement.evaluate(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/util/BaseConfigurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.util; 17 | 18 | import java.util.Properties; 19 | 20 | /** 21 | * Base class for implementations that need access to the unitils configuration 22 | * 23 | * @author Filip Neven 24 | * @author Tim Ducheyne 25 | * 26 | */ 27 | public class BaseConfigurable implements Configurable { 28 | 29 | protected Properties configuration; 30 | 31 | /* 32 | * @see org.unitils.core.util.Configurable#init(java.util.Properties) 33 | */ 34 | public void init(Properties configuration) { 35 | this.configuration = configuration; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/util/Configurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.util; 17 | 18 | import java.util.Properties; 19 | 20 | /** 21 | * @author Filip Neven 22 | * @author Tim Ducheyne 23 | */ 24 | public interface Configurable { 25 | 26 | /** 27 | * Initializes the database operation class with the given {@link Properties} 28 | * 29 | * @param configuration The configuration, not null 30 | */ 31 | public void init(Properties configuration); 32 | } 33 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/util/ResourceConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.util; 17 | 18 | /** 19 | * Marker interface that indicates that the implementation wraps the necessary configuration for 20 | * configuring some resource 21 | * 22 | * @author Filip Neven 23 | * @author Tim Ducheyne 24 | */ 25 | public interface ResourceConfig { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/util/ResourceConfigLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.util; 17 | 18 | 19 | /** 20 | * Defines the contract for implementations that find a resource configuration on a test object, returning 21 | * a subtype of {@link ResourceConfig} that wraps the configuration 22 | * 23 | * @author Filip Neven 24 | * @author Tim Ducheyne 25 | * 26 | * @param Implementation of {@link ResourceConfig} 27 | */ 28 | public interface ResourceConfigLoader { 29 | 30 | 31 | /** 32 | * @param testObject The test instance, not null 33 | * @return The resource configuration for the given test object. Null if the test object 34 | * doesn't specify any configuration for the resource type in question 35 | */ 36 | RC loadResourceConfig(Object testObject); 37 | } 38 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/core/util/StoredIdentifierCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.util; 17 | 18 | /** 19 | * Possible values for the stored identifier case. 20 | * 21 | * @author Tim Ducheyne 22 | * @author Filip Neven 23 | */ 24 | public enum StoredIdentifierCase { 25 | 26 | /** 27 | * The database stores unquoted identifiers as lower case 28 | */ 29 | LOWER_CASE, 30 | 31 | /** 32 | * The database stores unquoted identifiers as upper case 33 | */ 34 | UPPER_CASE, 35 | 36 | /** 37 | * The database stores unquoted identifiers as case sensitive 38 | */ 39 | MIXED_CASE 40 | } 41 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/reflectionassert/report/DifferenceReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.reflectionassert.report; 17 | 18 | import org.unitils.reflectionassert.difference.Difference; 19 | 20 | /** 21 | * Creates a report of the given differences. 22 | * 23 | * @author Tim Ducheyne 24 | * @author Filip Neven 25 | */ 26 | public interface DifferenceReport { 27 | 28 | 29 | /** 30 | * Creates a report. 31 | * 32 | * @param difference The difference to output, null for a match 33 | * @return The report, not null 34 | */ 35 | public String createReport(Difference difference); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/reflectionassert/report/DifferenceView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.reflectionassert.report; 17 | 18 | import org.unitils.reflectionassert.difference.Difference; 19 | 20 | 21 | /** 22 | * An interface for classes that can create a string representation of a Difference. 23 | * 24 | * @author Tim Ducheyne 25 | * @author Filip Neven 26 | */ 27 | public interface DifferenceView { 28 | 29 | 30 | /** 31 | * Creates a string representation of the given difference tree. 32 | * 33 | * @param difference The root difference, not null 34 | * @return The string representation, not null 35 | */ 36 | String createView(Difference difference); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/util/AnnotationPropertyAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.util; 17 | 18 | import java.lang.annotation.Annotation; 19 | 20 | /** 21 | * todo javadoc 22 | * 23 | * @author Filip Neven 24 | * @author Tim Ducheyne 25 | */ 26 | public interface AnnotationPropertyAccessor { 27 | 28 | // todo javadoc 29 | public T getAnnotationProperty(S annotation); 30 | } 31 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/util/MissingKeysException.java: -------------------------------------------------------------------------------- 1 | package org.unitils.util; 2 | 3 | 4 | 5 | /** 6 | * MissingKeyException: If one or more resourcebundles doesn't contain a key. 7 | * 8 | * @author Willemijn Wouters 9 | * 10 | * @since 3.4 11 | * 12 | */ 13 | public class MissingKeysException extends Exception { 14 | 15 | public MissingKeysException(String message) { 16 | super(message); 17 | } 18 | 19 | /** */ 20 | private static final long serialVersionUID = 7281526112203174186L; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/util/ReaderInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.util; 17 | 18 | import java.io.IOException; 19 | import java.io.InputStream; 20 | import java.io.Reader; 21 | 22 | /** 23 | * Wrapper that makes an Reader available as an InputStream 24 | */ 25 | public class ReaderInputStream extends InputStream { 26 | 27 | private Reader reader; 28 | 29 | public ReaderInputStream(Reader reader) { 30 | this.reader = reader; 31 | } 32 | 33 | public int read() throws IOException { 34 | return reader.read(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /unitils-core/src/main/java/org/unitils/util/WriterOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * $Id$ 17 | */ 18 | package org.unitils.util; 19 | 20 | import java.io.IOException; 21 | import java.io.OutputStream; 22 | import java.io.Writer; 23 | 24 | /** 25 | * @author Filip Neven 26 | * @author Tim Ducheyne 27 | */ 28 | public class WriterOutputStream extends OutputStream { 29 | 30 | private Writer writer; 31 | 32 | 33 | public WriterOutputStream(Writer writer) { 34 | this.writer = writer; 35 | } 36 | 37 | 38 | @Override 39 | public void write(int b) throws IOException { 40 | writer.write(b); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /unitils-database/src/main/java/org/unitils/database/util/Flushable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.database.util; 17 | 18 | /** 19 | * Marks a module as being flushable. This means that {@link #flushDatabaseUpdates(Object)} will be called on the module 20 | * when a flush is requested on the DatabaseModule (by calling its {@link #flushDatabaseUpdates(Object)} method). 21 | *

22 | * An example a flushable module is the HibernateModule. Hibernate stores updates in the session (in memory) without performing 23 | * them on the database. If you want to be sure that these updates are executed on the database, you need to flush the hibernate session. 24 | * 25 | * @author Tim Ducheyne 26 | * @author Filip Neven 27 | */ 28 | public interface Flushable { 29 | 30 | /** 31 | * Flush all cached database operations. 32 | * @param testObject 33 | */ 34 | void flushDatabaseUpdates(Object testObject); 35 | } 36 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/clean/DBCleaner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.clean; 17 | 18 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 19 | 20 | /** 21 | * Defines the contract for implementations that delete data from the database, that could cause problems when performing 22 | * updates to the database, such as adding not null columns or foreign key constraints. 23 | * 24 | * @author Filip Neven 25 | * @author Tim Ducheyne 26 | */ 27 | public interface DBCleaner extends DatabaseAccessing { 28 | 29 | 30 | /** 31 | * Delete data from the database schema, that could cause problems when performing updates. 32 | */ 33 | void cleanSchemas(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/clean/DBClearer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.clean; 17 | 18 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 19 | 20 | 21 | /** 22 | * Defines the contract for implementations that clear a database schema, so that it can for instance 23 | * be recreated from scratch by the {@link org.unitils.dbmaintainer.DBMaintainer} 24 | * 25 | * @author Filip Neven 26 | * @author Tim Ducheyne 27 | */ 28 | public interface DBClearer extends DatabaseAccessing { 29 | 30 | 31 | /** 32 | * Clears the database schemas. 33 | */ 34 | void clearSchemas(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/locator/resourcepickingstrategie/ResourcePickingStrategie.java: -------------------------------------------------------------------------------- 1 | package org.unitils.dbmaintainer.locator.resourcepickingstrategie; 2 | 3 | import java.net.URL; 4 | import java.util.List; 5 | 6 | 7 | /** 8 | * Defines a Strategie for picking out resources. 9 | * 10 | * 11 | * @author Jeroen Horemans 12 | * @author Thomas De Rycke 13 | * @author Willemijn Wouters 14 | * 15 | * @since 3.4 16 | * 17 | */ 18 | public interface ResourcePickingStrategie { 19 | 20 | /** 21 | * @param list 22 | * @param searchedPath 23 | * @return List 24 | */ 25 | List filter(List list, String searchedPath); 26 | } 27 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/script/ScriptParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.script; 17 | 18 | import java.io.Reader; 19 | import java.util.Properties; 20 | 21 | /** 22 | * An interface for a parser that can parse statements out of a script. 23 | * 24 | * @author Tim Ducheyne 25 | * @author Filip Neven 26 | */ 27 | public interface ScriptParser { 28 | 29 | 30 | /** 31 | * Initializes the parser with the given configuration settings. 32 | * 33 | * @param configuration The config, not null 34 | * @param scriptReader The script stream, not null 35 | */ 36 | void init(Properties configuration, Reader scriptReader); 37 | 38 | 39 | /** 40 | * Gets the next statement out of the given script stream. 41 | * 42 | * @return the statements, null if no more statements 43 | */ 44 | String getNextStatement(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/script/ScriptRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.script; 17 | 18 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 19 | 20 | 21 | /** 22 | * Runs a given database script. 23 | * 24 | * @author Filip Neven 25 | * @author Tim Ducheyne 26 | */ 27 | public interface ScriptRunner extends DatabaseAccessing { 28 | 29 | 30 | /** 31 | * Executes the given script 32 | * 33 | * @param script A handle that provides access to the content of the script, not null 34 | */ 35 | void execute(ScriptContentHandle scriptContentHandle); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/structure/ConstraintsDisabler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.structure; 17 | 18 | 19 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 20 | 21 | /** 22 | * A task for disabling all foreign key, check and not-null constraints on a database schema. 23 | * Primary key constraints will not be disabled. 24 | * 25 | * @author Filip Neven 26 | * @author Tim Ducheyne 27 | * @author Bart Vermeiren 28 | */ 29 | public interface ConstraintsDisabler extends DatabaseAccessing { 30 | 31 | 32 | /** 33 | * Disables all constraints of the database schemas. 34 | */ 35 | void disableConstraints(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/structure/DataSetStructureGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.structure; 17 | 18 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 19 | 20 | /** 21 | * Generator for structure files, such as dtd or xml schema, for a DbUnit flat-xml data set file. 22 | * 23 | * @author Filip Neven 24 | * @author Tim Ducheyne 25 | */ 26 | public interface DataSetStructureGenerator extends DatabaseAccessing { 27 | 28 | 29 | /** 30 | * Generates the data set structure files, eg DTD or XSD 31 | */ 32 | void generateDataSetStructure(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/structure/SequenceUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.structure; 17 | 18 | import org.unitils.dbmaintainer.util.DatabaseAccessing; 19 | 20 | /** 21 | * Defines the contract for implementation classes that update all sequences and identity columns of a database to 22 | * a sufficiently high value, so that test data be inserted easily. 23 | * 24 | * @author Filip Neven 25 | * @author Tim Ducheyne 26 | */ 27 | public interface SequenceUpdater extends DatabaseAccessing { 28 | 29 | 30 | /** 31 | * Updates all database sequences and identity columns to a sufficiently high value, so that test data be inserted 32 | * easily. 33 | */ 34 | void updateSequences(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/java/org/unitils/dbmaintainer/util/DatabaseAccessing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbmaintainer.util; 17 | 18 | import java.util.List; 19 | import java.util.Properties; 20 | 21 | import org.unitils.core.dbsupport.SQLHandler; 22 | 23 | /** 24 | * Task that can be performed on a database. 25 | * 26 | * @author Filip Neven 27 | * @author Tim Ducheyne 28 | */ 29 | public interface DatabaseAccessing { 30 | 31 | /** 32 | * Initializes the database operation class with the given {@link Properties}, {@link SQLHandler}. 33 | * 34 | * @param configuration The configuration, not null 35 | * @param sqlHandler The sql handler, not null 36 | * @param dialect 37 | * @param schemaNames 38 | */ 39 | public void init(Properties configuration, SQLHandler sqlHandler, String dialect, List schemaNames); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /unitils-dbmaintainer/src/main/resources/org/unitils/dbmaintainer/util/ant/antlib.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | -------------------------------------------------------------------------------- /unitils-dbunit/src/main/java/org/unitils/dbunit/annotation/DataSets.java: -------------------------------------------------------------------------------- 1 | package org.unitils.dbunit.annotation; 2 | 3 | import static java.lang.annotation.ElementType.METHOD; 4 | import static java.lang.annotation.ElementType.TYPE; 5 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 6 | 7 | import java.lang.annotation.Inherited; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.Target; 10 | 11 | 12 | /** 13 | * Multiple {@link DataSet}. 14 | * 15 | * @author wiw 16 | * 17 | * @since 3.4.1 18 | * 19 | */ 20 | @Target({TYPE, METHOD}) 21 | @Retention(RUNTIME) 22 | @Inherited 23 | public @interface DataSets { 24 | 25 | /** 26 | * One or more {@link DataSet} 27 | * @return {@link java.lang.reflect.Array} 28 | */ 29 | DataSet[] value(); 30 | } 31 | -------------------------------------------------------------------------------- /unitils-dbunit/src/main/java/org/unitils/dbunit/annotation/ExpectedDataSets.java: -------------------------------------------------------------------------------- 1 | package org.unitils.dbunit.annotation; 2 | 3 | import static java.lang.annotation.ElementType.METHOD; 4 | import static java.lang.annotation.ElementType.TYPE; 5 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 6 | 7 | import java.lang.annotation.Inherited; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.Target; 10 | 11 | 12 | /** 13 | * Multiple {@link ExpectedDataSet}. 14 | * 15 | * @author wiw 16 | * 17 | * @since 3.4.1 18 | * 19 | */ 20 | @Target({TYPE, METHOD}) 21 | @Retention(RUNTIME) 22 | @Inherited 23 | public @interface ExpectedDataSets { 24 | 25 | /** 26 | * One or more {@link ExpectedDataSet} 27 | * @return {@link java.lang.reflect.Array} 28 | */ 29 | ExpectedDataSet[] value(); 30 | } 31 | -------------------------------------------------------------------------------- /unitils-dbunit/src/main/java/org/unitils/dbunit/datasetfactory/DataSetResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.dbunit.datasetfactory; 17 | 18 | import java.io.File; 19 | 20 | import org.unitils.core.util.Configurable; 21 | 22 | /** 23 | * Resolves the location for a data set with a certain name. 24 | * 25 | * @author Tim Ducheyne 26 | * @author Filip Neven 27 | * @author Tuomas Jormola 28 | */ 29 | public interface DataSetResolver extends Configurable { 30 | 31 | 32 | /** 33 | * Resolves the location for a data set with a certain name. 34 | * An exception is raised if the file could not be found. 35 | * 36 | * @param testClass The test class, not null 37 | * @param dataSetName The name of the data set, not null 38 | * @return The data set file, not null 39 | */ 40 | File resolve(Class testClass, String dataSetName); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /unitils-easymock/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.unitils 6 | unitils 7 | 3.4.3-SNAPSHOT 8 | ../pom.xml 9 | 10 | unitils-easymock 11 | jar 12 | Unitils EasyMock module 13 | 14 | 15 | 16 | org.unitils 17 | unitils-core 18 | ${project.version} 19 | 20 | 21 | org.easymock 22 | easymock 23 | 2.3 24 | 25 | 26 | cglib 27 | cglib 28 | 2.2 29 | 30 | 31 | org.easymock 32 | easymockclassextension 33 | 2.3 34 | 35 | 36 | -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/annotation/AfterCreateMock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.annotation; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | import java.lang.annotation.Retention; 20 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Annotation that is called after a mock object has been created by the {@link org.unitils.easymock.EasyMockModule} 25 | * 26 | * @author Filip Neven 27 | * @author Tim Ducheyne 28 | */ 29 | @Target(METHOD) 30 | @Retention(RUNTIME) 31 | public @interface AfterCreateMock { 32 | } 33 | -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/util/Calls.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.util; 17 | 18 | /** 19 | * Possible values for allowing unexpected (non-recorded) method calls on mock objects. When set to lenient, a 'Nice 20 | * mock' is created, as called in the EasyMock terminology. For non-void methods this means that a Java default (null, 21 | * 0 or false) is returned. 22 | * 23 | * @author Tim Ducheyne 24 | * @author Filip Neven 25 | */ 26 | public enum Calls { 27 | 28 | /** 29 | * Defaults to the value of the org.unitils.easymock.annotation.LenientMock$Calls configuration setting. 30 | */ 31 | DEFAULT, 32 | 33 | /** 34 | * Accept unexpected method calls. Return default values (null, 0) for unexpected non-void method calls 35 | */ 36 | LENIENT, 37 | 38 | /** 39 | * Throw an exception when unexpected method calls occur 40 | */ 41 | STRICT 42 | } 43 | -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/util/Dates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.util; 17 | 18 | /** 19 | * Possible values for checking arguments with date values. 20 | * 21 | * @author Tim Ducheyne 22 | * @author Filip Neven 23 | */ 24 | public enum Dates { 25 | 26 | /** 27 | * Defaults to the value of the org.unitils.easymock.annotation.LenientMock$Dates configuration setting. 28 | */ 29 | DEFAULT, 30 | 31 | /** 32 | * Actual date values of arguments and inner fields of arguments are ignored. It will only check whether both 33 | * dates are null or both dates are not null. The actual date and hour do not matter. 34 | */ 35 | LENIENT, 36 | 37 | /** 38 | * Date values will also be compared. 39 | */ 40 | STRICT 41 | } -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/util/Defaults.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.util; 17 | 18 | /** 19 | * Possible values for checking arguments with default values. 20 | * 21 | * @author Tim Ducheyne 22 | * @author Filip Neven 23 | */ 24 | public enum Defaults { 25 | 26 | /** 27 | * Defaults to the value of the org.unitils.easymock.annotation.LenientMock$Defaults configuration setting. 28 | */ 29 | DEFAULT, 30 | 31 | 32 | /** 33 | * All arguments that have default values as expected values will not be checked. E.g. if a null value is recorded 34 | * as argument it will not be checked when the actual invocation occurs. The same applies for inner-fields of 35 | * object arguments that contain default java values. 36 | */ 37 | IGNORE_DEFAULTS, 38 | 39 | /** 40 | * Arguments with default values will also be checked. 41 | */ 42 | STRICT 43 | } -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/util/InvocationOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.util; 17 | 18 | 19 | /** 20 | * Possible values for checking the order of method invocation on the mock. 21 | * 22 | * @author Filip Neven 23 | * @author Tim Ducheyne 24 | */ 25 | public enum InvocationOrder { 26 | 27 | 28 | /** 29 | * NONE or STRICT as defined by the default value in the configuration. 30 | */ 31 | DEFAULT, 32 | 33 | /** 34 | * No order checking of method invocations. 35 | */ 36 | NONE, 37 | 38 | /** 39 | * Strict order checking of method invocations. 40 | */ 41 | STRICT 42 | 43 | } 44 | -------------------------------------------------------------------------------- /unitils-easymock/src/main/java/org/unitils/easymock/util/Order.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.easymock.util; 17 | 18 | public enum Order { 19 | 20 | /** 21 | * Defaults to the value of the org.unitils.easymock.annotation.LenientMock$Order configuration setting. 22 | */ 23 | DEFAULT, 24 | 25 | 26 | /** 27 | * The actual order of collections and arrays arguments and inner fields of arguments are ignored. It will 28 | * only check whether they both contain the same elements. 29 | */ 30 | LENIENT, 31 | 32 | /** 33 | * The order of collectios will be checked. 34 | */ 35 | STRICT 36 | } 37 | 38 | -------------------------------------------------------------------------------- /unitils-inject/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.unitils 6 | unitils 7 | 3.4.3-SNAPSHOT 8 | ../pom.xml 9 | 10 | unitils-inject 11 | jar 12 | Unitils inject module 13 | 14 | 15 | 16 | org.unitils 17 | unitils-core 18 | ${project.version} 19 | 20 | 21 | -------------------------------------------------------------------------------- /unitils-inject/src/main/java/org/unitils/inject/annotation/TestedObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.inject.annotation; 17 | 18 | import static java.lang.annotation.ElementType.FIELD; 19 | import java.lang.annotation.Retention; 20 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Annotation indicating the object under test. The object(s) referenced by the annotated field(s) is (are) used as 25 | * default target for injection. 26 | * 27 | * @author Filip Neven 28 | * @author Tim Ducheyne 29 | */ 30 | @Target(FIELD) 31 | @Retention(RUNTIME) 32 | public @interface TestedObject { 33 | } 34 | -------------------------------------------------------------------------------- /unitils-inject/src/main/java/org/unitils/inject/util/PropertyAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.inject.util; 17 | 18 | /** 19 | * The type of accessing properties: by field or by setter. If default is chosen, the property access is defined 20 | * in the Unitils configuration file. 21 | * 22 | * @author Filip Neven 23 | * @author Tim Ducheyne 24 | */ 25 | public enum PropertyAccess { 26 | 27 | /** 28 | * Field injection 29 | */ 30 | FIELD, 31 | 32 | /** 33 | * Setter injection 34 | */ 35 | SETTER, 36 | 37 | /** 38 | * Field or setter injection, defined by the configured default value 39 | */ 40 | DEFAULT 41 | 42 | } 43 | -------------------------------------------------------------------------------- /unitils-inject/src/main/java/org/unitils/inject/util/Restore.java: -------------------------------------------------------------------------------- 1 | package org.unitils.inject.util; 2 | 3 | /** 4 | * The type of accessing properties: by field or by setter. If default is chosen, the property access type is defined 5 | * in the Unitils configuration file. 6 | * 7 | * @author Filip Neven 8 | * @author Tim Ducheyne 9 | */ 10 | public enum Restore { 11 | 12 | /** 13 | * OLD_VALUE, NO_RESTORE or NULL_VALUE as defined by the default value in the configuration. 14 | */ 15 | DEFAULT, 16 | 17 | /** 18 | * Reset the injected field back to its original value 19 | */ 20 | OLD_VALUE, 21 | 22 | /** 23 | * Leave the injected field 24 | */ 25 | NO_RESTORE, 26 | 27 | /** 28 | * Set the injected field to the null or 0 value 29 | */ 30 | NULL_OR_0_VALUE 31 | 32 | } 33 | -------------------------------------------------------------------------------- /unitils-io/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.unitils 6 | unitils 7 | 3.4.3-SNAPSHOT 8 | ../pom.xml 9 | 10 | unitils-io 11 | jar 12 | Unitils io module 13 | 14 | 15 | 16 | org.unitils 17 | unitils-core 18 | ${project.version} 19 | 20 | 21 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/filecontent/FileContentReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.filecontent; 18 | 19 | /** 20 | * @author Jeroen Horemans 21 | * @author Tim Ducheyne 22 | * @author Thomas De Rycke 23 | * @since 3.3 24 | */ 25 | public interface FileContentReader { 26 | 27 | T readFileContent(String fileName, Class targetType, String encoding, Class testClass); 28 | } 29 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/filecontent/FileContentReaderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.filecontent; 18 | 19 | import java.util.Properties; 20 | 21 | /** 22 | * @author Tim Ducheyne 23 | * @author Jeroen Horemans 24 | * @since 3.3 25 | */ 26 | public interface FileContentReaderFactory { 27 | 28 | FileContentReader createFileContentReader(Properties configuration); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/reader/FileResolvingStrategyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.reader; 18 | 19 | import java.util.Properties; 20 | 21 | /** 22 | * @author Tim Ducheyne 23 | * @author Jeroen Horemans 24 | * @since 3.3 25 | */ 26 | public interface FileResolvingStrategyFactory { 27 | 28 | FileResolvingStrategy createFileResolvingStrategy(Properties configuration); 29 | } 30 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/reader/ReadingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.reader; 18 | 19 | import java.io.IOException; 20 | import java.io.InputStream; 21 | 22 | /** 23 | * @author Jeroen Horemans 24 | * @author Tim Ducheyne 25 | * @author Thomas De Rycke 26 | * @since 3.3 27 | */ 28 | public interface ReadingStrategy { 29 | 30 | InputStream getDefaultInputStream(String extension, Class testClass) throws IOException; 31 | 32 | InputStream getInputStream(String fileName, Class testClass) throws IOException; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/reader/ReadingStrategyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.reader; 18 | 19 | import java.util.Properties; 20 | 21 | /** 22 | * @author Tim Ducheyne 23 | * @author Jeroen Horemans 24 | * @since 3.3 25 | */ 26 | public interface ReadingStrategyFactory { 27 | 28 | ReadingStrategy createReadingStrategy(Properties configuration); 29 | } 30 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/temp/TempService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.temp; 18 | 19 | import java.io.File; 20 | 21 | /** 22 | * @author Jeroen Horemans 23 | * @author Tim Ducheyne 24 | * @author Thomas De Rycke 25 | * @since 3.3 26 | */ 27 | public interface TempService { 28 | 29 | File createTempDir(String dirName); 30 | 31 | File createTempFile(String fileName); 32 | 33 | void deleteTempFileOrDir(File fileOrDir); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /unitils-io/src/main/java/org/unitils/io/temp/TempServiceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io.temp; 18 | 19 | import java.util.Properties; 20 | 21 | /** 22 | * @author Jeroen Horemans 23 | * @author Tim Ducheyne 24 | * @author Thomas De Rycke 25 | * @since 3.3 26 | */ 27 | public interface TempServiceFactory { 28 | 29 | TempService createTempService(Properties configuration); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/annotation/AfterCreateMock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.annotation; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | import java.lang.annotation.Retention; 20 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Annotation for indicating that a method is to be called after a mock was created. This method can for example 25 | * do some extra configuration or install the instance in a service locator. 26 | *

27 | * The method should have following signature: void myMethod(Object mock, String name, Class type) 28 | *

29 | * The passed object is the created mock. 30 | * The name is the name of the mock, typically the name of the field. 31 | * The type is the class type of the mocked instance. 32 | * 33 | * @author Filip Neven 34 | * @author Tim Ducheyne 35 | * @author Kenny Claes 36 | */ 37 | @Target(METHOD) 38 | @Retention(RUNTIME) 39 | public @interface AfterCreateMock { 40 | } 41 | 42 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/annotation/MatchStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2007, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.annotation; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author Filip Neven 26 | * @author Tim Ducheyne 27 | */ 28 | @Target(METHOD) 29 | @Retention(RUNTIME) 30 | public @interface MatchStatement { 31 | } 32 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/core/MockFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright 2010, Unitils.org 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package org.unitils.mock.core; 19 | 20 | import org.unitils.mock.Mock; 21 | 22 | /** 23 | * @author Tim Ducheyne 24 | * @author Filip Neven 25 | */ 26 | public interface MockFactory { 27 | 28 | 29 | Mock createChainedMock(String name, Class mockedType); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/core/matching/MatchingInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright 2010, Unitils.org 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package org.unitils.mock.core.matching; 19 | 20 | import org.unitils.mock.argumentmatcher.ArgumentMatcher; 21 | import org.unitils.mock.core.proxy.ProxyInvocation; 22 | 23 | import java.util.List; 24 | 25 | public interface MatchingInvocationHandler { 26 | 27 | Object handleInvocation(ProxyInvocation proxyInvocation, List argumentMatchers) throws Throwable; 28 | } -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/core/proxy/ProxyInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2007, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.core.proxy; 17 | 18 | /** 19 | * A class for handling method invocations of a proxy. 20 | * 21 | * @author Tim Ducheyne 22 | * @author Filip Neven 23 | * @author Kenny Claes 24 | */ 25 | public interface ProxyInvocationHandler { 26 | 27 | 28 | /** 29 | * Handles the given method invocation of the proxy. 30 | * 31 | * @param proxyInvocation The method invocation, not null 32 | * @return The result value for the method invocation 33 | */ 34 | Object handleInvocation(ProxyInvocation proxyInvocation) throws Throwable; 35 | } 36 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/dummy/DummyObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2007, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.dummy; 17 | 18 | /** 19 | * @author Filip Neven 20 | * @author Tim Ducheyne 21 | */ 22 | public interface DummyObject { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/mockbehavior/MockBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.mockbehavior; 17 | 18 | import org.unitils.mock.core.proxy.ProxyInvocation; 19 | 20 | 21 | /** 22 | * Behavior for a mock instance. Mock behavior is defined before the test is performed and then executed during 23 | * the test when needed. If a certain proxy method invocation requires the mock behavior, the {@link #execute} method 24 | * is called with the invocation as argument. The result value will then be used as return value of the proxy method. 25 | * 26 | * @author Filip Neven 27 | * @author Tim Ducheyne 28 | * @author Kenny Claes 29 | */ 30 | public interface MockBehavior { 31 | 32 | 33 | /** 34 | * Executes the mock behavior. 35 | * 36 | * @param proxyInvocation The proxy method invocation, not null 37 | * @return The return value, null if there is no return value 38 | */ 39 | Object execute(ProxyInvocation proxyInvocation) throws Throwable; 40 | } 41 | -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/mockbehavior/ValidatableMockBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.mockbehavior; 17 | 18 | import org.unitils.core.UnitilsException; 19 | import org.unitils.mock.core.proxy.ProxyInvocation; 20 | 21 | 22 | /** 23 | * todo javadoc 24 | * 25 | * @author Filip Neven 26 | * @author Tim Ducheyne 27 | * @author Kenny Claes 28 | */ 29 | public interface ValidatableMockBehavior extends MockBehavior { 30 | 31 | 32 | /** 33 | * Checks whether the mock behavior can be executed for the given invocation. 34 | * An exception should be raised if this behavior is not suited for the given invocation. 35 | * 36 | * @param proxyInvocation The proxy method invocation, not null 37 | */ 38 | void assertCanExecute(ProxyInvocation proxyInvocation) throws UnitilsException; 39 | 40 | } -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/mockbehavior/impl/NoopMockBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.mockbehavior.impl; 17 | 18 | import org.unitils.mock.core.proxy.ProxyInvocation; 19 | import org.unitils.mock.mockbehavior.MockBehavior; 20 | 21 | /** 22 | * Mock behavior that does nothing. 23 | * 24 | * @author Tim Ducheyne 25 | * @author Filip Neven 26 | */ 27 | public class NoopMockBehavior implements MockBehavior { 28 | 29 | /** 30 | * Empty mock behavior. 31 | * 32 | * @param proxyInvocation The proxy method invocation, not null 33 | * @return null 34 | */ 35 | public Object execute(ProxyInvocation proxyInvocation) { 36 | return null; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/mockbehavior/impl/StubMockBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright 2010, Unitils.org 4 | * * 5 | * * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * * you may not use this file except in compliance with the License. 7 | * * You may obtain a copy of the License at 8 | * * 9 | * * http://www.apache.org/licenses/LICENSE-2.0 10 | * * 11 | * * Unless required by applicable law or agreed to in writing, software 12 | * * distributed under the License is distributed on an "AS IS" BASIS, 13 | * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * * See the License for the specific language governing permissions and 15 | * * limitations under the License. 16 | * 17 | */ 18 | package org.unitils.mock.mockbehavior.impl; 19 | 20 | import org.unitils.core.UnitilsException; 21 | import org.unitils.mock.core.proxy.ProxyInvocation; 22 | 23 | /** 24 | * Mock behavior that returns a default value if a value can be returned, nothing happens when the result type is void. 25 | * See {@link org.unitils.mock.mockbehavior.impl.DefaultValueReturningMockBehavior} for more info on the defaults. 26 | * 27 | * @author Tim Ducheyne 28 | * @author Filip Neven 29 | */ 30 | public class StubMockBehavior extends DefaultValueReturningMockBehavior { 31 | 32 | /** 33 | * Stub behavior is always allowed. 34 | * 35 | * @param proxyInvocation The proxy method invocation, not null 36 | */ 37 | public void assertCanExecute(ProxyInvocation proxyInvocation) throws UnitilsException { 38 | // allow void methods 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /unitils-mock/src/main/java/org/unitils/mock/report/ScenarioReport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.mock.report; 17 | 18 | import org.unitils.mock.core.Scenario; 19 | 20 | /** 21 | * Creates a report of the given {@link Scenario}. 22 | * 23 | * @author Kenny Claes 24 | * @author Filip Neven 25 | * @author Tim Ducheyne 26 | */ 27 | public interface ScenarioReport { 28 | 29 | 30 | /** 31 | * Creates a report. 32 | * @param scenario The scenario to output, not null 33 | * 34 | * @return the report, not null 35 | */ 36 | String createReport(Scenario scenario); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /unitils-orm/src/main/java/org/unitils/orm/hibernate/util/HibernateAnnotationConfigLoader.java: -------------------------------------------------------------------------------- 1 | package org.unitils.orm.hibernate.util; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.hibernate.cfg.Configuration; 6 | import org.unitils.orm.common.util.OrmConfig; 7 | import org.unitils.orm.hibernate.annotation.HibernateSessionFactory; 8 | import org.unitils.util.AnnotationConfigLoader; 9 | import org.unitils.util.CollectionUtils; 10 | 11 | public class HibernateAnnotationConfigLoader extends AnnotationConfigLoader { 12 | 13 | public HibernateAnnotationConfigLoader() { 14 | super(HibernateSessionFactory.class); 15 | } 16 | 17 | 18 | protected boolean isConfiguringAnnotation(HibernateSessionFactory annotation) { 19 | return annotation.value().length > 0; 20 | } 21 | 22 | 23 | protected OrmConfig createResourceConfig(HibernateSessionFactory configuringAnnotation, Method customConfigMethod) { 24 | return new OrmConfig(CollectionUtils.asSet(configuringAnnotation.value()), customConfigMethod); 25 | } 26 | 27 | 28 | protected boolean isCustomConfigMethod(Method annotatedMethod) { 29 | return annotatedMethod.getReturnType().toString().equals("void") 30 | && annotatedMethod.getParameterTypes().length == 1 31 | && Configuration.class.isAssignableFrom(annotatedMethod.getParameterTypes()[0]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /unitils-orm/src/main/java/org/unitils/orm/jpa/util/provider/hibernate/UnitilsHibernateJpaVendorAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.orm.jpa.util.provider.hibernate; 17 | 18 | import javax.persistence.spi.PersistenceProvider; 19 | 20 | import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; 21 | 22 | /** 23 | * Custom implementation of spring's HibernateJpaVendorAdapter that supplies a custom 24 | * subclass of HibernatePeristence as PersistenceProvider for hibernate JPA. 25 | * 26 | * @author Filip Neven 27 | * @author Tim Ducheyne 28 | */ 29 | public class UnitilsHibernateJpaVendorAdapter extends HibernateJpaVendorAdapter { 30 | 31 | @Override 32 | public PersistenceProvider getPersistenceProvider() { 33 | return new UnitilsHibernatePersistenceProvider(); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /unitils-spring/src/main/java/org/unitils/spring/SpringUnitils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.spring; 17 | 18 | import org.unitils.core.Unitils; 19 | 20 | /** 21 | * Utility facade for handling Spring things such as invalidating a cached application context. 22 | * 23 | * @author Tim Ducheyne 24 | * @author Filip Neven 25 | */ 26 | public class SpringUnitils { 27 | 28 | 29 | /** 30 | * Forces the reloading of the application context the next time that it is requested. If classes are given 31 | * only contexts that are linked to those classes will be reset. If no classes are given, all cached 32 | * contexts will be reset. 33 | * 34 | * @param classes The classes for which to reset the contexts 35 | */ 36 | public static void invalidateApplicationContext(Class... classes) { 37 | SpringModule springModule = Unitils.getInstance().getModulesRepository().getModuleOfType(SpringModule.class); 38 | springModule.invalidateApplicationContext(classes); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /unitils-spring/src/main/java/org/unitils/spring/annotation/ConfigureProfile.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import org.unitils.spring.profile.TypeConfiguration; 8 | 9 | 10 | /** 11 | * Choose which Spring profile you want to use. 12 | * 13 | * @author Jeroen Horemans 14 | * @author Thomas De Rycke 15 | * @author Willemijn Wouters 16 | * 17 | * @since 3.4 18 | * 19 | */ 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target({ElementType.TYPE}) 22 | public @interface ConfigureProfile { 23 | String value() default ""; 24 | String packageProfile() default ""; 25 | TypeConfiguration configuration() default TypeConfiguration.APPLICATIONCONTEXT; 26 | } 27 | -------------------------------------------------------------------------------- /unitils-spring/src/main/java/org/unitils/spring/annotation/SpringBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.spring.annotation; 17 | 18 | import static java.lang.annotation.ElementType.FIELD; 19 | import static java.lang.annotation.ElementType.METHOD; 20 | import java.lang.annotation.Retention; 21 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * This annotation can be used on fields or single-argument void methods, in order to inject a bean 26 | * from a spring ApplicationContext. The value attribute indicates the id of the bean 27 | * from the ApplicationContext. An ApplicationContext has to be configured 28 | * for this test using the {@link SpringApplicationContext} annotation. 29 | * 30 | * @author Filip Neven 31 | * @author Tim Ducheyne 32 | */ 33 | @Target({FIELD, METHOD}) 34 | @Retention(RUNTIME) 35 | public @interface SpringBean { 36 | 37 | String value(); 38 | } 39 | -------------------------------------------------------------------------------- /unitils-spring/src/main/java/org/unitils/spring/annotation/SpringBeanByName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.spring.annotation; 17 | 18 | import static java.lang.annotation.ElementType.FIELD; 19 | import static java.lang.annotation.ElementType.METHOD; 20 | import java.lang.annotation.Retention; 21 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * This annotation can be used on fields or setter methods, in order to inject a bean 26 | * from a spring ApplicationContext. The id of the bean in the application context is automatically 27 | * derived from the name of the field or setter method. An ApplicationContext has to be configured 28 | * for this test using the {@link SpringApplicationContext} annotation. 29 | * 30 | * @author Filip Neven 31 | * @author Tim Ducheyne 32 | */ 33 | @Target({FIELD, METHOD}) 34 | @Retention(RUNTIME) 35 | public @interface SpringBeanByName { 36 | } 37 | -------------------------------------------------------------------------------- /unitils-spring/src/main/java/org/unitils/spring/profile/TypeConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.profile; 2 | 3 | 4 | /** 5 | * How do you want to configure you're beans? Do you want to use the annotation {@link Configuration} or the annotation {@link SpringApplicationContext}. 6 | * 7 | * @author Jeroen Horemans 8 | * @author Thomas De Rycke 9 | * @author Willemijn Wouters 10 | * 11 | * @since 3.4 12 | * 13 | */ 14 | public enum TypeConfiguration { 15 | /** 16 | * You can use the annotation {@link Configuration} to define the beans in the applicationcontext. 17 | * The beans are defined in a seperate class and contains the annotation {@link Configuration} 18 | * example: 19 | * 20 | * @Configuration
21 | * @Profile("dev")
22 | * public class StandaloneDataConfig { 23 | *
24 | */ 25 | CONFIGURATION, 26 | /** 27 | * You can use the annotation {@link SpringApplicationContext} to define the beans in de applicationcontext. 28 | * All the beans are defined in an xml file.
29 | * {@code 30 | * ... 31 | * } 32 | */ 33 | APPLICATIONCONTEXT 34 | } 35 | -------------------------------------------------------------------------------- /unitils-test/src/main/java/org/unitils/TestExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | public interface TestExecutor { 19 | 20 | void runTests(Class... testClasses) throws Exception; 21 | 22 | void runTests(String testGroup, Class... testClasses) throws Exception; 23 | 24 | int getRunCount(); 25 | 26 | int getFailureCount(); 27 | 28 | int getIgnoreCount(); 29 | 30 | } -------------------------------------------------------------------------------- /unitils-test/src/main/java/org/unitils/UnitilsJUnit3Test_TestClass1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 19 | 20 | 21 | /** 22 | * JUnit 3 test class containing 2 test methods. This test test-class is used in the 23 | * {@link JUnitUnitilsInvocationTest} and {@link UnitilsInvocationExceptionTest} tests. 24 | * 25 | * @author Tim Ducheyne 26 | * @author Filip Neven 27 | */ 28 | public class UnitilsJUnit3Test_TestClass1 extends UnitilsJUnit3TestBase { 29 | 30 | public void test1() { 31 | registerTestInvocation(TEST_METHOD, "test1"); 32 | } 33 | 34 | 35 | public void test2() { 36 | registerTestInvocation(TEST_METHOD, "test2"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /unitils-test/src/main/java/org/unitils/UnitilsJUnit3Test_TestClass2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 19 | 20 | /** 21 | * JUnit 3 test class containing 2 test methods. This test test-class is used in the 22 | * {@link JUnitUnitilsInvocationTest} tests. 23 | * 24 | * @author Tim Ducheyne 25 | * @author Filip Neven 26 | */ 27 | public class UnitilsJUnit3Test_TestClass2 extends UnitilsJUnit3TestBase { 28 | 29 | public void test1() { 30 | registerTestInvocation(TEST_METHOD, "test1"); 31 | } 32 | 33 | 34 | public void test2() { 35 | registerTestInvocation(TEST_METHOD, "test2"); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /unitils-test/src/main/java/org/unitils/spring/SpringUnitilsJUnit4TestBase.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring; 2 | 3 | import org.springframework.test.context.TestExecutionListeners; 4 | import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; 5 | import org.unitils.TracingTestListener; 6 | import org.unitils.spring.util.SpringUnitilsAdaptorTestExecutionListener; 7 | 8 | 9 | // todo javadoc 10 | @TestExecutionListeners(value = SpringUnitilsAdaptorTestExecutionListener.class, inheritListeners = false) 11 | abstract public class SpringUnitilsJUnit4TestBase extends AbstractJUnit4SpringContextTests { 12 | 13 | /* Test listener that will record all invocations */ 14 | private static TracingTestListener tracingTestListener; 15 | 16 | 17 | /** 18 | * Sets the tracing test listener that will record all invocations. 19 | * 20 | * @param testListener the listener 21 | */ 22 | public static void setTracingTestListener(TracingTestListener testListener) { 23 | tracingTestListener = testListener; 24 | } 25 | 26 | /** 27 | * Records an invocation. 28 | * 29 | * @param invocation the invocation type, not null 30 | * @param testClass the test class, not null 31 | * @param testMethodName the actual test name, null if not applicable 32 | */ 33 | protected static void registerTestInvocation(TracingTestListener.TestInvocation invocation, Class testClass, String testMethodName) { 34 | if (tracingTestListener != null) { 35 | tracingTestListener.registerTestInvocation(invocation, testClass, testMethodName); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/DefaultPackageClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | public class DefaultPackageClass { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/DefaultPackageDataSet.java: -------------------------------------------------------------------------------- 1 | import org.unitils.dbunit.annotation.DataSet; 2 | 3 | 4 | public class DefaultPackageDataSet { 5 | 6 | @DataSet 7 | public void testMethod1() { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/DefaultPackageDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/FileResolverTest-defaultPackage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/src/test/java/FileResolverTest-defaultPackage.txt -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/DefaultDataSetResolverTest-otherPackage.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/FileResolverTest-otherPackage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/src/test/java/org/unitils/FileResolverTest-otherPackage.txt -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/JustATestClass.java: -------------------------------------------------------------------------------- 1 | package org.unitils; 2 | 3 | import org.unitils.dbunit.annotation.DataSet; 4 | 5 | 6 | /** 7 | * Just A Testclass. 8 | * 9 | * @author Jeroen Horemans 10 | * @author Thomas De Rycke 11 | * @author Willemijn Wouters 12 | * 13 | * @since 3.4 14 | * 15 | */ 16 | @DataSet 17 | public class JustATestClass { 18 | private Integer i; 19 | private String j; 20 | private Double k; 21 | 22 | 23 | 24 | /** 25 | * @param i 26 | * @param j 27 | * @param k 28 | */ 29 | public JustATestClass(Integer i, String j, Double k) { 30 | super(); 31 | this.i = i; 32 | this.j = j; 33 | this.k = k; 34 | } 35 | 36 | 37 | 38 | public void method1() { 39 | //do nothing 40 | } 41 | 42 | 43 | 44 | /** 45 | * @return the i 46 | */ 47 | public Integer getI() { 48 | return i; 49 | } 50 | 51 | 52 | /** 53 | * @return the j 54 | */ 55 | public String getJ() { 56 | return j; 57 | } 58 | 59 | 60 | /** 61 | * @return the k 62 | */ 63 | public Double getK() { 64 | return k; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/core/config/ConfigurationGetPropertiesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.core.config; 18 | 19 | import org.junit.Test; 20 | 21 | import java.util.Properties; 22 | 23 | import static org.junit.Assert.assertSame; 24 | 25 | /** 26 | * @author Tim Ducheyne 27 | */ 28 | public class ConfigurationGetPropertiesTest { 29 | 30 | /* Tested object */ 31 | private Configuration configuration; 32 | 33 | 34 | @Test 35 | public void getProperties() { 36 | Properties properties = new Properties(); 37 | configuration = new Configuration(properties); 38 | 39 | Properties result = configuration.getProperties(); 40 | assertSame(properties, result); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/core/config/UnitilsConfigurationGetPropertiesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.core.config; 17 | 18 | import org.junit.Test; 19 | 20 | import java.util.Properties; 21 | 22 | import static org.junit.Assert.assertSame; 23 | 24 | /** 25 | * @author Tim Ducheyne 26 | * @author Filip Neven 27 | */ 28 | public class UnitilsConfigurationGetPropertiesTest { 29 | 30 | /* Tested object */ 31 | private UnitilsConfiguration unitilsConfiguration; 32 | 33 | 34 | @Test 35 | public void getProperties() { 36 | Properties properties = new Properties(); 37 | unitilsConfiguration = new UnitilsConfiguration(properties); 38 | 39 | Properties result = unitilsConfiguration.getProperties(); 40 | assertSame(properties, result); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/core/util/FileResolverTest.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/src/test/java/org/unitils/core/util/FileResolverTest.txt -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/core/util/ResourcebundleCheckTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.core.util; 2 | 3 | import java.util.Locale; 4 | import java.util.MissingResourceException; 5 | 6 | import org.junit.Ignore; 7 | import org.junit.Test; 8 | import org.unitils.util.MissingKeysException; 9 | import org.unitils.util.ResourcebundleCheck; 10 | 11 | 12 | /** 13 | * Resourcebundlechecktest. 14 | * 15 | * @author Willemijn Wouters 16 | * 17 | * @since 3.4 18 | * 19 | */ 20 | public class ResourcebundleCheckTest { 21 | @Test 22 | public void testSuccess() throws Exception { 23 | ResourcebundleCheck.testAllTheKeys("resourcebundle/comments", new Locale("fr"), new Locale("nl"), new Locale("de")); 24 | 25 | } 26 | /** 27 | * The french bundle contains more keys than the others. 28 | * invoice_declaration_yes, invoice_declaration_no = 29 | * @throws Exception 30 | */ 31 | @Test(expected= MissingKeysException.class) 32 | public void testBad() throws Exception { 33 | ResourcebundleCheck.testAllTheKeys("resourcebundle/invoice", new Locale("nl"), new Locale("fr"), new Locale("de")); 34 | } 35 | 36 | @Ignore 37 | @Test(expected = MissingResourceException.class) 38 | public void testBadBundleDoesNotExist() throws Exception { 39 | ResourcebundleCheck.testAllTheKeys("resourcebundle/invoice", new Locale("fr"), new Locale("nl"), new Locale("de"), new Locale("sq")); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptRunnerTest/test-script1.sql: -------------------------------------------------------------------------------- 1 | 2 | create table table1 (col1 smallint); 3 | create table table2 (col1 smallint); -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptRunnerTest/test-script2.sql: -------------------------------------------------------------------------------- 1 | 2 | create table table3 (col1 smallint); -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/1_scripts/001_scriptA.sql: -------------------------------------------------------------------------------- 1 | Contents of script A -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/1_scripts/002_scriptB.sql: -------------------------------------------------------------------------------- 1 | Contents of script B -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/1_scripts/003_scriptC.xxx: -------------------------------------------------------------------------------- 1 | Contents of script A -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/1_scripts/scriptD.sql: -------------------------------------------------------------------------------- 1 | Contents of script C -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/2_scripts/002_scriptE.sql: -------------------------------------------------------------------------------- 1 | Contents of script E -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/2_scripts/scriptF.sql: -------------------------------------------------------------------------------- 1 | Contents of script F -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/2_scripts/subfolder/001_scriptG.sql: -------------------------------------------------------------------------------- 1 | Contents of script G -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/2_scripts/subfolder/scriptH.sql: -------------------------------------------------------------------------------- 1 | Contents of script H -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/postprocessing/post-scriptA.sql: -------------------------------------------------------------------------------- 1 | Contents of script A -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/postprocessing/post-scriptB.sql: -------------------------------------------------------------------------------- 1 | Contents of script B -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/scripts/001_scriptI.sql: -------------------------------------------------------------------------------- 1 | Contents of script G -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest/test_scripts/scripts/scriptJ.sql: -------------------------------------------------------------------------------- 1 | Contents of script H -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest_DuplicateVersion/001_scriptA.sql: -------------------------------------------------------------------------------- 1 | Contents of script A -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/DefaultScriptSourceTest_DuplicateVersion/001_scriptB.sql: -------------------------------------------------------------------------------- 1 | Contents of script B -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/plsql-script-ending-with-comment.sql: -------------------------------------------------------------------------------- 1 | 2 | -- a function declaration 3 | create 4 | or replace function funtion1(arg in number) return varchar2 DETERMINISTIC is 5 | test_return_value varchar2(1000); 6 | begin 7 | select 'test''' 8 | into lv_return_value 9 | from dual; 10 | 11 | return lv_return_value; 12 | 13 | exception 14 | when no_data_found then 15 | return ''; 16 | end; 17 | / 18 | 19 | 20 | create -- another function declaration 21 | function funtion2(arg in number) return varchar2 DETERMINISTIC is 22 | test_return_value varchar2(1000); 23 | begin 24 | /** something / in the body */ 25 | -- //// 26 | exception 27 | when no_data_found then 28 | return ''; 29 | end; 30 | / 31 | 32 | 33 | -- an anonymous block 34 | declare 35 | userName varchar2(30); 36 | begin 37 | select user into userName from dual; 38 | DBMS_UTILITY.compile_schema(userName); 39 | end; 40 | / 41 | 42 | 43 | -- a regular statement 44 | create table table1 (col1 smallint); 45 | 46 | //// 47 | 48 | /* a regular statement ending with a slash */ 49 | create 50 | table table1 (col1 smallint); 51 | / 52 | 53 | / 54 | / 55 | -- Ending with comment -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/plsql-script.sql: -------------------------------------------------------------------------------- 1 | 2 | -- a function declaration 3 | create 4 | or replace function funtion1(arg in number) return varchar2 DETERMINISTIC is 5 | test_return_value varchar2(1000); 6 | begin 7 | select 'test''' 8 | into lv_return_value 9 | from dual; 10 | 11 | return lv_return_value; 12 | 13 | exception 14 | when no_data_found then 15 | return ''; 16 | end; 17 | / 18 | 19 | 20 | create -- another function declaration 21 | function funtion2(arg in number) return varchar2 DETERMINISTIC is 22 | test_return_value varchar2(1000); 23 | begin 24 | /** something / in the body */ 25 | -- //// 26 | exception 27 | when no_data_found then 28 | return ''; 29 | end; 30 | / 31 | 32 | 33 | -- an anonymous block 34 | declare 35 | userName varchar2(30); 36 | begin 37 | select user into userName from dual; 38 | DBMS_UTILITY.compile_schema(userName); 39 | end; 40 | / 41 | 42 | 43 | -- a regular statement 44 | create table table1 (col1 smallint); 45 | 46 | //// 47 | 48 | /* a regular statement ending with a slash */ 49 | create 50 | table table1 (col1 smallint); 51 | / 52 | 53 | / 54 | / -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/sql-script-ending-with-comment.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, NAME VARCHAR2(50)); 5 | 6 | -- Ending with comment -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/sql-script-missing-semicolon.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, NAME VARCHAR2(50)) 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/sql-script-not-ending-with-new-line.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, NAME VARCHAR2(50)); -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbmaintainer/script/impl/ScriptParserTest/sql-script.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, NAME VARCHAR2(50)); 3 | CREATE TABLE ROLE (ID INTEGER PRIMARY KEY, ROLENAME VARCHAR2(20)); 4 | CREATE TABLE TABLE_B (ID INTEGER PRIMARY KEY); 5 | 6 | CREATE 7 | TABLE 8 | PRODUCTS 9 | (ID 10 | INTEGER 11 | PRIMARY 12 | KEY); 13 | 14 | INSERT INTO PERSON(NAME) VALUES ('This is 15 | a multiline 16 | value'); 17 | 18 | INSERT INTO PERSON(NAME) VALUES (''); 19 | INSERT INTO "PERSON"("""NAME""") VALUES (''''); 20 | 21 | -- comment1 22 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, -- inline comment 23 | -- comment2 /* ignored block comment*/ 24 | NAME VARCHAR2(50)); -- another comment 25 | 26 | /* comment1 */ 27 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, /* inline comment */ 28 | /* comment2 -- ignored line comment */ 29 | NAME VARCHAR2(50)); /* another comment */ 30 | 31 | /* this is a 32 | * multiline 33 | * comment */ 34 | CREATE TABLE PERSON (ID INTEGER PRIMARY KEY, /* inline comment 35 | -- ignored line comment 36 | */ 37 | NAME VARCHAR2(50)); /* another 38 | comment */ 39 | 40 | COMMENT ON TABLE PERSON IS 'This ; comment ; contains ; a semi-colon'; 41 | COMMENT ON TABLE PERSON IS 'This "comment" '' contains quotes and double quotes'; 42 | 43 | ;;;; 44 | 45 | -- last statement without ; 46 | COMMENT ON TABLE PERSON IS 'This /* comment */ contains a block and -- line comment'; 47 | 48 | ;;; -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/CustomDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbUnitModuleDataSetMultiSchemaTest$DataSetTest.multiSchema.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbUnitModuleDataSetMultiSchemaTest$DataSetTest.multiSchemaNoDefault.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbUnitModuleDataSetOperationTest$DataSetTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbUnitModuleDataSetTest$DataSetTestSubClass_dataSetAnnotationOnSubClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbUnitModuleDataSetTest$DataSetTestSubClass_dataSetAnnotationOnSuperClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentCollumnsTest-WithAllColumns.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentCollumnsTest-WithOnlyOneColumn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentCollumnsTest-WithOnlyPersonName.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentColumnsTest-DifferentColumns.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentColumnsTest-FirstContainsLessAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentColumnsTest-FirstContainsMoreAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentColumnsTest-FirstContainsNoAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DbunitDifferentColumnsTest-FirstContainsSameAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/DifferentColumnsDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/EmptyTableTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetDifferentColumnsTest-DifferentColumns.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetDifferentColumnsTest-FirstContainsLessAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetDifferentColumnsTest-FirstContainsMoreAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetDifferentColumnsTest-FirstContainsSameAttributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetDifferentColumnsTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetNoAnnotationOnClassLevelTest$TestClass.testMethod1-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetTest$CustomTestClass.testMethod2-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetTest$TestClass.testMethod1-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetTest$TestClass.testMethod3-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetTest$TestClass.testMethod4-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetTest-nullValue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetWithPrimaryKeysTest-differentValues.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetWithPrimaryKeysTest-emptyTable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetWithPrimaryKeysTest-missingRow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/ExpectedDataSetWithPrimaryKeysTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/JustAClass.java: -------------------------------------------------------------------------------- 1 | package org.unitils.dbunit; 2 | 3 | 4 | /** 5 | * Test class. 6 | * 7 | * @author Jeroen Horemans 8 | * @author Thomas De Rycke 9 | * @author Willemijn Wouters 10 | * 11 | * @since 3.4 12 | * 13 | */ 14 | public class JustAClass { 15 | 16 | public void method1() { 17 | //do nothing 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/dataSet1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/dataSet2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/datasetfactory/impl/DefaultDataSetResolverTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testMultipleDataSetsDatabase1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testMultipleDataSetsDatabase1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testOneDataSetDatabase1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/multidatabase/MultiDatabaseIntTest.testOneDataSetDatabase2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/util/FileHandlerDeleteFilesTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.dbunit.util; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.junit.Assert; 9 | import org.junit.Test; 10 | import org.unitils.dbunit.util.FileHandler; 11 | 12 | 13 | /** 14 | * Test {@link FileHandler#deleteFiles(List)}. 15 | * 16 | * @author wiw 17 | * 18 | * @since 3.4 19 | * 20 | */ 21 | public class FileHandlerDeleteFilesTest { 22 | 23 | private FileHandler sut = new FileHandler(); 24 | 25 | @Test 26 | public void testDeleteFiles() throws IOException { 27 | List lstFiles = new ArrayList(); 28 | File tempFile1 = File.createTempFile("FileHandlerDeleteFilesTest-", ".txt"); 29 | File tempFile2 = File.createTempFile("FileHandlerDeleteFilesTest-", ".txt"); 30 | File tempFile3 = File.createTempFile("FileHandlerDeleteFilesTest-", ".txt"); 31 | lstFiles.add(tempFile1); 32 | lstFiles.add(tempFile2); 33 | lstFiles.add(tempFile3); 34 | 35 | 36 | tempFile3.delete(); 37 | 38 | 39 | sut.deleteFiles(lstFiles); 40 | 41 | Assert.assertFalse(tempFile1.exists()); 42 | Assert.assertFalse(tempFile2.exists()); 43 | Assert.assertFalse(tempFile3.exists()); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/util/LessColumnsFirstDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/util/LessColumnsLastDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/util/MultiSchemaDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | " + 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/dbunit/util/MultiSchemaNoDefaultDataSet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/io/DummyConversionStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io; 18 | 19 | import org.unitils.io.conversion.ConversionStrategy; 20 | 21 | import java.io.IOException; 22 | import java.io.InputStream; 23 | 24 | /** 25 | * @author Jeroen Horemans 26 | * @author Tim Ducheyne 27 | * @author Thomas De Rycke 28 | * @since 3.3 29 | */ 30 | public class DummyConversionStrategy implements ConversionStrategy { 31 | 32 | public Object convertContent(InputStream inputStream, String encoding) throws IOException { 33 | return new Object(); 34 | } 35 | 36 | public String getDefaultFileExtension() { 37 | return "dummy"; 38 | } 39 | 40 | public Class getTargetType() { 41 | return Object.class; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/io/IOModuleIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.unitils.io; 18 | 19 | import org.junit.Test; 20 | import org.unitils.UnitilsJUnit4; 21 | import org.unitils.io.annotation.FileContent; 22 | 23 | import java.util.Properties; 24 | 25 | import static junit.framework.Assert.assertEquals; 26 | 27 | /** 28 | * @author Jeroen Horemans 29 | * @author Tim Ducheyne 30 | * @author Thomas De Rycke 31 | * @since 3.3 32 | */ 33 | public class IOModuleIntegrationTest extends UnitilsJUnit4 { 34 | 35 | @FileContent 36 | protected String fileContent; 37 | 38 | @FileContent 39 | protected Properties propertiesContent; 40 | 41 | @Test 42 | public void filledUpValuesTest() { 43 | assertEquals("testFile", fileContent); 44 | assertEquals("testFile", propertiesContent.getProperty("testFile")); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/io/IOUnitilsReadFileContentTest.properties: -------------------------------------------------------------------------------- 1 | testFile=testFile -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/io/IOUnitilsReadFileContentTest.txt: -------------------------------------------------------------------------------- 1 | testFile -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/orm/hibernate/hibernate-sub.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org/unitils/orm/hibernate/hibernate-sub.cfg.xml 9 | org.hibernate.dialect.HSQLDialect 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/orm/hibernate/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org/unitils/orm/hibernate/hibernate.cfg.xml 9 | org.hibernate.dialect.HSQLDialect 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/orm/jpa/persistence-test.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/parameterized/JustATestClass.java: -------------------------------------------------------------------------------- 1 | package org.unitils.parameterized; 2 | 3 | import org.junit.Before; 4 | import org.junit.Ignore; 5 | import org.junit.Test; 6 | 7 | 8 | /** 9 | * JustATestClass. 10 | * 11 | * @author Jeroen Horemans 12 | * @author Thomas De Rycke 13 | * @author Willemijn Wouters 14 | * 15 | * @since 3.4 16 | * 17 | */ 18 | @Ignore 19 | public class JustATestClass { 20 | 21 | public JustATestClass() { 22 | //do nothing 23 | } 24 | 25 | /** 26 | * @throws java.lang.Exception 27 | */ 28 | @Before 29 | public void setUp() throws Exception { 30 | //empty 31 | } 32 | 33 | @Test 34 | public static void test1() { 35 | //test method 36 | } 37 | 38 | @Test 39 | protected void test2() { 40 | //test method 41 | } 42 | 43 | @Test 44 | public String test3() { 45 | return ""; 46 | } 47 | 48 | @Test 49 | public void test4(String param1) { 50 | //test method 51 | } 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/parameterized/UnitilsParametersNullParametersStveParametersTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.parameterized; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collection; 5 | 6 | import org.apache.log4j.Logger; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Parameterized.Parameters; 10 | import org.unitils.UnitilsParameterized; 11 | 12 | /** 13 | * Test {@link UnitilsParameterized} 14 | * 15 | * @author Jeroen Horemans 16 | * @author Thomas De Rycke 17 | * @author Willemijn Wouters 18 | * 19 | * @since 3.4 20 | * 21 | */ 22 | @RunWith(UnitilsParameterized.class) 23 | public class UnitilsParametersNullParametersStveParametersTest { 24 | private static final Logger LOGGER = Logger.getLogger(UnitilsParametersNullParametersStveParametersTest.class); 25 | 26 | @Parameters 27 | public static Collection data() { 28 | Object[][] data = new Object[][] { { 1 }, { 2 }, { 3 }, { null } }; 29 | return Arrays.asList(data); 30 | } 31 | 32 | private Integer number; 33 | 34 | public UnitilsParametersNullParametersStveParametersTest(Integer number) { 35 | this.number = number; 36 | } 37 | 38 | @Test 39 | public void test() { 40 | LOGGER.debug(number); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/parameterized/UnitilsParametersNullParametersTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.parameterized; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collection; 5 | 6 | import org.apache.log4j.Logger; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Parameterized.Parameters; 10 | import org.unitils.UnitilsParameterized; 11 | 12 | 13 | /** 14 | * Test {@link StveParameterized} 15 | * 16 | * @author Jeroen Horemans 17 | * @author Thomas De Rycke 18 | * @author Willemijn Wouters 19 | * 20 | * @since 3.4 21 | * 22 | */ 23 | @RunWith(UnitilsParameterized.class) 24 | public class UnitilsParametersNullParametersTest { 25 | private static final Logger LOGGER = Logger.getLogger(UnitilsParametersNullParametersTest.class); 26 | 27 | @Parameters 28 | public static Collection data() { 29 | Object[][] data = new Object[][] { { 1 }, { 2 }, { 3 }, { null } }; 30 | return Arrays.asList(data); 31 | } 32 | 33 | private Integer number; 34 | 35 | public UnitilsParametersNullParametersTest(Integer number) { 36 | this.number = number; 37 | } 38 | 39 | @Test 40 | public void test() { 41 | LOGGER.debug(number); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/reflectionassert/Car.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.reflectionassert; 17 | 18 | /** 19 | * @author Filip Neven 20 | * @author Tim Ducheyne 21 | */ 22 | public class Car { 23 | 24 | private String brand; 25 | 26 | public Car(String brand) { 27 | this.brand = brand; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/reflectionassert/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils.reflectionassert; 17 | 18 | import java.util.List; 19 | import java.util.ArrayList; 20 | import java.util.Arrays; 21 | 22 | /** 23 | * @author Filip Neven 24 | * @author Tim Ducheyne 25 | */ 26 | public class Person { 27 | 28 | private String fName; 29 | private String lName; 30 | private String userName; 31 | private List cars; 32 | 33 | public Person(String fName, String lName, String userName, Car... cars) { 34 | this.fName = fName; 35 | this.lName = lName; 36 | this.userName = userName; 37 | this.cars = Arrays.asList(cars); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/reflectionassert/hibernate/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.hibernate.dialect.HSQLDialect 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/SpringUnitilsJUnit38Test_TestClass1.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring; 2 | 3 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 4 | 5 | public class SpringUnitilsJUnit38Test_TestClass1 extends SpringUnitilsJUnit38TestBase { 6 | 7 | public void test1() { 8 | registerTestInvocation(TEST_METHOD, "test1"); 9 | } 10 | 11 | 12 | public void test2() { 13 | registerTestInvocation(TEST_METHOD, "test2"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/SpringUnitilsJUnit38Test_TestClass2.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring; 2 | 3 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 4 | 5 | public class SpringUnitilsJUnit38Test_TestClass2 extends SpringUnitilsJUnit38TestBase { 6 | 7 | public void test1() { 8 | registerTestInvocation(TEST_METHOD, "test1"); 9 | } 10 | 11 | 12 | public void test2() { 13 | registerTestInvocation(TEST_METHOD, "test2"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/profile/ProfilesModuleConfigurationIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.profile; 2 | 3 | 4 | import javax.sql.DataSource; 5 | 6 | import org.junit.After; 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; 12 | import org.unitils.UnitilsJUnit4TestClassRunner; 13 | import org.unitils.spring.annotation.ConfigureProfile; 14 | 15 | 16 | /** 17 | * ProfilesModuleIntegrationTest. 18 | * 19 | * @author Jeroen Horemans 20 | * @author Thomas De Rycke 21 | * @author Willemijn Wouters 22 | * 23 | * @since 3.4 24 | * 25 | */ 26 | @RunWith(UnitilsJUnit4TestClassRunner.class) 27 | @ConfigureProfile(value = "dev", configuration = TypeConfiguration.CONFIGURATION, packageProfile = "org.unitils.spring.profile") 28 | public class ProfilesModuleConfigurationIntegrationTest { 29 | 30 | @Autowired 31 | private DataSource dataSource; 32 | 33 | @Test 34 | public void test() { 35 | 36 | Assert.assertTrue(dataSource instanceof EmbeddedDatabase); 37 | } 38 | 39 | 40 | @After 41 | public void dropDossierTable() { 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/profile/ProfilesModuleSpringApplicationContextIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.profile; 2 | 3 | import static org.unitils.database.SQLUnitils.executeUpdate; 4 | 5 | import javax.sql.DataSource; 6 | 7 | import org.junit.After; 8 | import org.junit.Assert; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy; 13 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; 14 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; 15 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; 16 | import org.unitils.UnitilsJUnit4TestClassRunner; 17 | import org.unitils.spring.annotation.ConfigureProfile; 18 | import org.unitils.spring.annotation.SpringApplicationContext; 19 | 20 | /** 21 | * ProfilesModuleSpringApplicationContextIntegrationTest. 22 | * 23 | * @author Jeroen Horemans 24 | * @author Thomas De Rycke 25 | * @author Willemijn Wouters 26 | * 27 | * @since 3.4 28 | * 29 | */ 30 | @RunWith(UnitilsJUnit4TestClassRunner.class) 31 | @SpringApplicationContext("classpath:org/unitils/spring/profile/applicationContext-dao-test.xml") 32 | @ConfigureProfile(value = "dev", configuration = TypeConfiguration.APPLICATIONCONTEXT) 33 | public class ProfilesModuleSpringApplicationContextIntegrationTest { 34 | 35 | @Autowired 36 | private DataSource dataSource; 37 | 38 | @Test 39 | public void test() { 40 | Assert.assertTrue(dataSource instanceof TransactionAwareDataSourceProxy); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/profile/TestProfile.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.profile; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import org.junit.Ignore; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.Profile; 9 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; 10 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; 11 | 12 | 13 | /** 14 | * Test {@link Profile}. 15 | * 16 | * @author Jeroen Horemans 17 | * @author Thomas De Rycke 18 | * @author Willemijn Wouters 19 | * 20 | * @since 3.4 21 | * 22 | */ 23 | @Ignore 24 | @Configuration 25 | @Profile("dev") 26 | public class TestProfile { 27 | @Bean 28 | public DataSource dataSource() { 29 | return new EmbeddedDatabaseBuilder() 30 | .setType(EmbeddedDatabaseType.HSQL) 31 | .addScript("classpath:org/unitils/database/DatabaseUnitilsTest.sql") 32 | .build(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/profile/TestProfile1.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring.profile; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import org.junit.Ignore; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.Profile; 9 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; 10 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; 11 | 12 | 13 | /** 14 | * Test {@link Profile}. 15 | * 16 | * @author Jeroen Horemans 17 | * @author Thomas De Rycke 18 | * @author Willemijn Wouters 19 | * 20 | * @since 3.4 21 | * 22 | */ 23 | @Ignore 24 | @Configuration 25 | @Profile("acc") 26 | public class TestProfile1 { 27 | @Bean 28 | public DataSource dataSource() { 29 | return new EmbeddedDatabaseBuilder() 30 | .setType(EmbeddedDatabaseType.HSQL) 31 | .addScript("classpath:org/unitils/spring/profile/DummyTable.sql") 32 | .build(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /unitils-test/src/test/java/org/unitils/spring/services-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/applicationContext-dao-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/dbscripts/Person.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE PERSON ( 2 | PERSONID INT NOT NULL, 3 | PERSONNAME VARCHAR(20) 4 | ); -------------------------------------------------------------------------------- /unitils-test/src/test/resources/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | resources/hibernate.cfg.xml 9 | org.hibernate.dialect.HSQLDialect 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/database/DatabaseUnitilsTest.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dossier 2 | (id varchar(50), 3 | name varchar(50)); 4 | 5 | 6 | insert into dossier values('1', 'test1'); 7 | insert into dossier values('2', 'test2'); 8 | insert into dossier values('3', 'test3'); -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/database/MultipleDatabases.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/database/config/H2DbSupportTest.properties: -------------------------------------------------------------------------------- 1 | 2 | database.names=database1, database2 3 | database.driverClassName=org.h2.Driver 4 | database.dialect=h2 5 | #Todo check url for H2 6 | database.url.database1=jdbc:h2:~/test1 7 | database.url.database2=jdbc:h2:~/test2 8 | database.userName=sa 9 | database.password= 10 | database.schemaNames=public 11 | 12 | org.unitils.database.config.DataSourceFactory.implClassName=org.unitils.database.config.PropertiesDataSourceFactory 13 | org.unitils.core.dbsupport.DbSupport.implClassName.h2=org.unitils.H2DbSupport 14 | database.storedIndentifierCase.h2=auto 15 | database.identifierQuoteString.h2=auto 16 | 17 | updateDataBaseSchema.enabled=false 18 | 19 | dataSource.wrapInTransactionalProxy=false -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/database/config/H2DbSupportTestDefault.properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | database.driverClassName=org.h2.Driver 4 | database.dialect=h2 5 | #Todo check url for H2 6 | database.url=jdbc:h2:~/test 7 | database.userName=sa 8 | database.password= 9 | database.schemaNames=public 10 | 11 | org.unitils.database.config.DataSourceFactory.implClassName=org.unitils.database.config.PropertiesDataSourceFactory 12 | org.unitils.core.dbsupport.DbSupport.implClassName.h2=org.unitils.H2DbSupport 13 | database.storedIndentifierCase.h2=auto 14 | database.identifierQuoteString.h2=auto 15 | 16 | updateDataBaseSchema.enabled=false 17 | 18 | dataSource.wrapInTransactionalProxy=false -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbmaintainer/locator/ResourceLoadingDefaultClassTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbmaintainer/locator/ResourceLoadingMethodTest.testLoadingResourceDatasetDefault-result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbmaintainer/locator/ResourceLoadingMethodTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/DbUnitModuleNaming.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/JustAClass-method1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/test1/testFile.txt: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/test2/testFile.txt: -------------------------------------------------------------------------------- 1 | test 2 -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/testdbscripts/001_Initial_TESTcreate.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dossier 2 | (id char(50), 3 | name char(50), 4 | Start_date date); 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/testdbscripts/002_Initial_TESTcreate.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dummytable 2 | (id char(50), 3 | name char(50), 4 | Start_date date); 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/testdbscripts/003_Initial_TESTcreate.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dummySecondtable 2 | (id char(50), 3 | name char(50), 4 | Start_date date); 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/dbunit/testdbscripts/testsubpackage/004_Initial_TESTcreate.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE 4thTable 2 | (id char(50), 3 | name char(50), 4 | Start_date date); 5 | 6 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/io/FileContentTestListenerTest$DefaultTestStub.properties: -------------------------------------------------------------------------------- 1 | FileContentTestListenerTest= text file -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/io/FileContentTestListenerTest$DefaultTestStub.txt: -------------------------------------------------------------------------------- 1 | The FileContentTestLisener txt test file -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/io/IOModuleIntegrationTest.properties: -------------------------------------------------------------------------------- 1 | testFile=testFile -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/io/IOModuleIntegrationTest.txt: -------------------------------------------------------------------------------- 1 | testFile -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/spring/profile/DummyTable.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dummytable 2 | (id char(50), 3 | name char(50), 4 | Start_date date); -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/spring/profile/applicationContext-dao-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/testdata/exampleCorruptResourceData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | sdf 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/testdata/exampleFunkyData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/testdata/exampleResourceData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/org/unitils/testdata/exampleResourceLoadingData.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unitils-test/src/test/resources/propertiesReaderTest.properties: -------------------------------------------------------------------------------- 1 | testprop = some value -------------------------------------------------------------------------------- /unitils-test/src/test/resources/resourcebundle/comments_nl.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/src/test/resources/resourcebundle/comments_nl.properties -------------------------------------------------------------------------------- /unitils-test/src/test/resources/resourcebundle/invoice_de.properties: -------------------------------------------------------------------------------- 1 | both = 2 | contribution = 3 | filterRetribution = Retributies 4 | filterContribution = 5 | filterBoth = Heffingen & Retributies 6 | invoice_head_title = Historiek facturen 7 | invoice_enterprise_name = Ondernemingsnaam 8 | invoice_enterprise_number = Ondernemingsnummer 9 | invoice_back = Terug 10 | invoice_table_title = Aanslagjaar {0} 11 | invoice_table_header_1 = Aanslagjaar 12 | invoice_table_header_2 = Evenementen 13 | invoice_table_header_3 = Datum 14 | invoice_table_header_4 = Campagne ID 15 | invoice_table_header_5 = Kommentar 16 | invoice_table_header_6 = Bedrag (\u20AC) 17 | invoice_document_notsended = Formulier niet verzonden 18 | invoice_document_inprogress = Lopende verzending 19 | no_invoice = Er werden geen facturatiegegevens gevonden voor de opgegeven onderneming 20 | retribution = Retributies 21 | 22 | 23 | no_retrib = Geen gegevens over retributies voor deze onderneming 24 | no_invoice_retrib = Geen gegevens over heffingen/retributies voor deze onderneming 25 | no_invoice = Geen gegevens over heffingen voor deze onderneming -------------------------------------------------------------------------------- /unitils-test/src/test/resources/resourcebundle/invoice_fr.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/src/test/resources/resourcebundle/invoice_fr.properties -------------------------------------------------------------------------------- /unitils-test/src/test/resources/resourcebundle/invoice_nl.properties: -------------------------------------------------------------------------------- 1 | both = Heffingen & Retributies 2 | contribution = Heffingen 3 | filterRetribution = Retributies 4 | filterContribution = Heffingen 5 | filterBoth = Heffingen & Retributies 6 | invoice_head_title = Historiek facturen 7 | invoice_enterprise_name = Ondernemingsnaam 8 | invoice_enterprise_number = Ondernemingsnummer 9 | invoice_back = Terug 10 | invoice_table_title = Aanslagjaar {0} 11 | invoice_table_header_1 = Aanslagjaar 12 | invoice_table_header_2 = Evenementen 13 | invoice_table_header_3 = Datum 14 | invoice_table_header_4 = Campagne ID 15 | invoice_table_header_5 = Kommentar 16 | invoice_table_header_6 = Bedrag (\u20AC) 17 | invoice_document_notsended = Formulier niet verzonden 18 | invoice_document_inprogress = Lopende verzending 19 | no_invoice = Er werden geen facturatiegegevens gevonden voor de opgegeven onderneming 20 | retribution = Retributies 21 | 22 | 23 | no_retrib = Geen gegevens over retributies voor deze onderneming 24 | no_invoice_retrib = Geen gegevens over heffingen/retributies voor deze onderneming 25 | no_invoice = Geen gegevens over heffingen voor deze onderneming -------------------------------------------------------------------------------- /unitils-test/test-output/Default suite/Default test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unitils-test/test-output/bullet_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/bullet_point.png -------------------------------------------------------------------------------- /unitils-test/test-output/collapseall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/collapseall.gif -------------------------------------------------------------------------------- /unitils-test/test-output/emailable-report.html: -------------------------------------------------------------------------------- 1 | 2 | TestNG Report
Test# Passed# Skipped# FailedTime (ms)Included GroupsExcluded Groups
Default suite
Default test0000
ClassMethodStartTime (ms)
Default suite

Default test

-------------------------------------------------------------------------------- /unitils-test/test-output/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/failed.png -------------------------------------------------------------------------------- /unitils-test/test-output/navigator-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/navigator-bullet.png -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/Default test.properties: -------------------------------------------------------------------------------- 1 | [SuiteResult context=Default test] -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
Class nameMethod nameGroups
7 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/groups.html: -------------------------------------------------------------------------------- 1 |

Groups used for this test run

-------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/index.html: -------------------------------------------------------------------------------- 1 | Results for Default suite 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/main.html: -------------------------------------------------------------------------------- 1 | Results for Default suite 2 | Select a result on the left-hand pane. 3 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/methods-alphabetical.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Default suite

(Hover the method name to see the test class name)

2 | 3 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/methods-not-run.html: -------------------------------------------------------------------------------- 1 |

Methods that were not run

2 |
-------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/methods.html: -------------------------------------------------------------------------------- 1 |

Methods run, sorted chronologically

>> means before, << means after


Default suite

(Hover the method name to see the test class name)

2 | 3 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/reporter-output.html: -------------------------------------------------------------------------------- 1 |

Reporter output

-------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/testng.xml.html: -------------------------------------------------------------------------------- 1 | testng.xml for Default suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Default suite">
  <test verbose="2" name="Default test">
    <classes>
      <class name="org.unitils.JustATestClass"/>
      <class name="org.unitils.UnitilsParameterizedTest"/>
      <class name="org.unitils.TestClassRunnerForParametersTest"/>
      <class name="org.unitils.JUnitUnitilsInvocationTest"/>
      <class name="org.unitils.JUnitUnitilsInvocationExceptionTest"/>
    </classes>
  </test> <!-- Default test -->
</suite> <!-- Default suite -->
-------------------------------------------------------------------------------- /unitils-test/test-output/old/Default suite/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Results for Default suite 4 | 5 | 6 | 7 | 8 |

Results for
Default suite

9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 |
1 test0 class0 method:
14 |   chronological
15 |   alphabetical
16 |   not run (0)
0 groupreporter outputtestng.xml
23 | 24 |

29 |

25 |
Default test (0/0/0) 26 | Results 27 |
28 |
30 | -------------------------------------------------------------------------------- /unitils-test/test-output/old/index.html: -------------------------------------------------------------------------------- 1 | 2 | Test results 3 | 4 | 5 |

Test results

6 | 7 | 8 | 9 |
SuitePassedFailedSkippedtestng.xml
Total000 
Default suite000Link
10 | -------------------------------------------------------------------------------- /unitils-test/test-output/passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/passed.png -------------------------------------------------------------------------------- /unitils-test/test-output/skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteam/unitils/cd365e49390bae950620543f96cd6c8921e790c6/unitils-test/test-output/skipped.png -------------------------------------------------------------------------------- /unitils-test/test-output/testng-results.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /unitils-test/test-output/testng.css: -------------------------------------------------------------------------------- 1 | .invocation-failed, .test-failed { background-color: #DD0000; } 2 | .invocation-percent, .test-percent { background-color: #006600; } 3 | .invocation-passed, .test-passed { background-color: #00AA00; } 4 | .invocation-skipped, .test-skipped { background-color: #CCCC00; } 5 | 6 | .main-page { 7 | font-size: x-large; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /unitils-testng-test/src/test/java/org/unitils/TestNGTestExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package org.unitils; 5 | 6 | import org.testng.TestListenerAdapter; 7 | import org.testng.TestNG; 8 | 9 | class TestNGTestExecutor implements TestExecutor { 10 | 11 | private TestListenerAdapter testListenerAdapter; 12 | 13 | public void runTests(Class... testClasses) throws Exception { 14 | testListenerAdapter = new TestListenerAdapter(); 15 | 16 | TestNG testng = new TestNG(); 17 | testng.setTestClasses(testClasses); 18 | testng.addListener(testListenerAdapter); 19 | testng.run(); 20 | } 21 | 22 | public void runTests(String testGroups, Class... testClasses) throws Exception { 23 | testListenerAdapter = new TestListenerAdapter(); 24 | 25 | TestNG testng = new TestNG(); 26 | testng.setGroups(testGroups); 27 | testng.setTestClasses(testClasses); 28 | testng.addListener(testListenerAdapter); 29 | testng.run(); 30 | } 31 | 32 | public int getRunCount() { 33 | return testListenerAdapter.getPassedTests().size() + 34 | testListenerAdapter.getFailedTests().size() + 35 | testListenerAdapter.getSkippedTests().size(); 36 | } 37 | 38 | public int getFailureCount() { 39 | return testListenerAdapter.getFailedTests().size(); 40 | } 41 | 42 | public int getIgnoreCount() { 43 | return testListenerAdapter.getSkippedTests().size(); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /unitils-testng-test/src/test/java/org/unitils/UnitilsTestNGTest_TestClass1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 19 | 20 | import org.testng.annotations.Test; 21 | 22 | /** 23 | * TestNG test class containing 2 active and 1 ignored test method. This test test-class is used 24 | * in the {@link TestNGUnitilsInvocationTest} and {@link TestNGUnitilsInvocationExceptionTest} tests. 25 | * 26 | * @author Tim Ducheyne 27 | * @author Filip Neven 28 | */ 29 | public class UnitilsTestNGTest_TestClass1 extends UnitilsTestNGTestBase { 30 | 31 | 32 | @Test 33 | public void test1() { 34 | registerTestInvocation(TEST_METHOD, "test1"); 35 | } 36 | 37 | 38 | @Test 39 | public void test2() { 40 | registerTestInvocation(TEST_METHOD, "test2"); 41 | } 42 | 43 | 44 | @Test(enabled = false) 45 | public void test3() { 46 | registerTestInvocation(TEST_METHOD, "test3"); 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /unitils-testng-test/src/test/java/org/unitils/UnitilsTestNGTest_TestClass2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Unitils.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.unitils; 17 | 18 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 19 | 20 | import org.testng.annotations.Test; 21 | 22 | /** 23 | * TestNG test class containing 2 test methods. This test test-class is used in the {@link TestNGUnitilsInvocationTest} tests. 24 | * 25 | * @author Tim Ducheyne 26 | * @author Filip Neven 27 | */ 28 | public class UnitilsTestNGTest_TestClass2 extends UnitilsTestNGTestBase { 29 | 30 | 31 | @Test 32 | public void test1() { 33 | registerTestInvocation(TEST_METHOD, "test1"); 34 | } 35 | 36 | 37 | @Test 38 | public void test2() { 39 | registerTestInvocation(TEST_METHOD, "test2"); 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /unitils-testng-test/src/test/java/org/unitils/spring/SpringUnitilsTestNGTest_TestClass1.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring; 2 | 3 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 4 | 5 | import org.testng.annotations.Test; 6 | 7 | /** 8 | * @author Filip Neven 9 | * @author Tim Ducheyne 10 | */ 11 | public class SpringUnitilsTestNGTest_TestClass1 extends SpringUnitilsTestNGTest { 12 | 13 | @Test 14 | public void test1() { 15 | registerTestInvocation(TEST_METHOD, "test1"); 16 | } 17 | 18 | 19 | @Test 20 | public void test2() { 21 | registerTestInvocation(TEST_METHOD, "test2"); 22 | } 23 | 24 | 25 | @Test(enabled = false) 26 | public void test3() { 27 | registerTestInvocation(TEST_METHOD, "test3"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /unitils-testng-test/src/test/java/org/unitils/spring/SpringUnitilsTestNGTest_TestClass2.java: -------------------------------------------------------------------------------- 1 | package org.unitils.spring; 2 | 3 | import static org.unitils.TracingTestListener.TestInvocation.TEST_METHOD; 4 | 5 | import org.testng.annotations.Test; 6 | 7 | /** 8 | * @author Filip Neven 9 | * @author Tim Ducheyne 10 | */ 11 | public class SpringUnitilsTestNGTest_TestClass2 extends SpringUnitilsTestNGTest { 12 | 13 | @Test 14 | public void test1() { 15 | registerTestInvocation(TEST_METHOD, "test1"); 16 | } 17 | 18 | 19 | @Test 20 | public void test2() { 21 | registerTestInvocation(TEST_METHOD, "test2"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /unitils-testng/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | org.unitils 6 | unitils 7 | 3.4.3-SNAPSHOT 8 | ../pom.xml 9 | 10 | unitils-testng 11 | jar 12 | Unitils TestNG classes 13 | 14 | 15 | 16 | org.unitils 17 | unitils-core 18 | ${project.version} 19 | 20 | 21 | org.testng 22 | testng 23 | 5.8 24 | jdk15 25 | 26 | 27 | 28 | 29 | 30 | org.apache.maven.plugins 31 | maven-source-plugin 32 | 2.2.1 33 | 34 | 35 | 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------