Class MCRTestCase

java.lang.Object
org.mycore.common.MCRTestCase
Direct Known Subclasses:
MCRAbstractCategoryImplTest, MCRAbstractMergerTest, MCRAccessKeyStrategyHelperTest, MCRAccessKeyTest, MCRAccessKeyTransformerTest, MCRBibTeX2MODSTransformerTest, MCRBindingTest, MCRCalendarTest, MCRCategoryIDTest, MCRCategoryImplTest, MCRChangeTrackerTest, MCRCheckPermissionChainResolverTest, MCRComponentTest, MCRConditionTransformerTest, MCRConfigurableInstanceHelperTest, MCRConfigurationTest, MCRCoreVersionTest, MCRCreatedByConditionTest, MCRCronjobManagerTest, MCRDataURLTest, MCRDOIParserTest, MCRDOIServiceTest, MCREditorSubmissionTest, MCREnrichmentTest, MCREventManagerTest, MCRExtentMergerTest, MCRFileSystemEventTest, MCRGroupClauseTest, MCRHyphenNormalizerTest, MCRIdentifierMergerTest, MCRIDPURLGeneratorTest, MCRIFS2TestCase, MCRIPConditionTest, MCRJanitorEventHandlerBaseTest, MCRJaxenXPathFactoryTest, MCRJPATestCase, MCRLabelTest, MCRLanguageDetectorTest, MCRMapObjectIDDOIGeneratorTest, MCRMergerTest, MCRMetaAddressTest, MCRMetaBooleanTest, MCRMetaClassificationTest, MCRMetaEnrichedLinkIDTest, MCRMetaHistoryDateTest, MCRMetaInstitutionNameTest, MCRMetaISO8601DateTest, MCRMetaLangTextTest, MCRMetaLinkTest, MCRMetaNumberTest, MCRMetaPersonNameTest, MCRMetaXMLTest, MCRMetsModelHelperTest, MCRMODSCollectionConditionTest, MCRMODSDateHelperTest, MCRMODSDOIMetadataServiceTest, MCRMODSEmbargoConditionTest, MCRMODSGenreConditionTest, MCRModsItemDataProviderTest, MCRMODSPagesHelperTest, MCRMODSWrapperTest, MCRNameMergerTest, MCRNodeBuilderTest, MCRObjectIDPoolTest, MCRObjectMetadataTest, MCRObjectStaticContentGeneratorTest, MCRObjectTest, MCROriginInfoMergerTest, MCRPIAndPredicateTest, MCRPIXPathPredicateTest, MCRProcessableFactoryTest, MCRProcessableSupplierTest, MCRQLSearchUtilsTest, MCRQueryParserTest, MCRQueryTest, MCRRegExConditionTest, MCRRelatedItemMergerTest, MCRRepeatBindingTest, MCRRoleConditionTest, MCRSecureTokenV2FilterConfigTest, MCRSessionTest, MCRSolrProxyServletTest, MCRSwapInsertTargetTest, MCRTextNormalizerTest, MCRTextResolverTest, MCRTitleInfoMergerTest, MCRTopologicalSortTest, MCRTransactionableCallableTest, MCRTransactionableRunnableTest, MCRTranslationTest, MCRUploadHelperTest, MCRURLTest, MCRUserConditionTest, MCRUserInformationLookupTest, MCRUtilsTest, MCRXEditorTransformerTest, MCRXEditorValidatorTest, MCRXMLCleanerTest, MCRXMLFunctionsTest, MCRXMLHelperTest, MCRXMLParserTest, MCRXPathBuilderTest, MCRXPathEvaluatorTest, MCRXSLTransformationTest, MyCoReWebPageProviderTest

public class MCRTestCase extends Object
  • Field Details

    • junitFolder

      public static org.junit.rules.TemporaryFolder junitFolder
  • Constructor Details

    • MCRTestCase

      public MCRTestCase()
  • Method Details

    • initBaseDir

      public static void initBaseDir() throws IOException
      Throws:
      IOException
    • setUp

      public void setUp() throws Exception
      initializes MCRConfiguration with an empty property file. This can be used to test MyCoRe classes without any propties set, using default. You may want to set Properties per TestCase with the set() method of MCRConfiguration2
      Throws:
      Exception
      See Also:
    • tearDown

      public void tearDown() throws Exception
      Throws:
      Exception
    • getTestProperties

      protected Map<String,String> getTestProperties()
    • initProperties

      protected void initProperties() throws IOException
      Creates a temporary properties file if the system variable MCR.Configuration.File is not set.
      Throws:
      IOException - Thrown if the creation of the temporary properties file failed.
    • getCurrentComponentName

      protected static String getCurrentComponentName()
    • isDebugEnabled

      protected boolean isDebugEnabled()
    • bzzz

      protected void bzzz()
      Waits 1,1 seconds and does nothing
    • getResourceAsStream

      protected InputStream getResourceAsStream(String fileName)
      Retrieve the resource file
      Example: /Classname/recource.file
      Parameters:
      fileName -
      Returns:
      the resource file as InputStream
    • getResourceAsURL

      protected URL getResourceAsURL(String fileName)
      Retrieve the resource file as URI. Example: /Classname/recource.file
      Parameters:
      fileName -
      Returns:
      the resource file as URL