OKW_Properties extends Properties { @Override public String getProperty(String fpsKey) { String lvsReturn = ""; String lvsKey = ""; lvsKey = Parser.ParseMe( fpsKey ); lvsReturn = super.getProperty( lvsKey ); if ( lvsReturn == null ) okw.log.Logger_Sngltn.getInstance().LogWarning( "Propertykey (parsed) not found: '" + lvsKey + "'" ); else lvsReturn = Parser.ParseMe( lvsReturn ); return lvsReturn; } private  OKW_Properties(); static OKW_Properties getInstance(); void clear(); void init(); void updateProperties(); Boolean addResource(String fpsResourceName); void addPropertiesFile(String fpsFileName); void PrintProperties(); void PrintPropertiesSources(); ArrayList<String> getKeysStartswith( String Startwitth ); ArrayList<String> getPropertiesForKeysStartswith( String Startwith ); @Override String getProperty(String fpsKey); String getProperty( String fpsKey, String fpsDefault, Object... Parameters ); Boolean getProperty2Boolean(String fpsKey, String fpsDefault );  }
@Test public final void tc_getProperty_CombindValues() throws IOException { assertEquals( "Wert 1", myProperties.getProperty( "CombineValues.One_Value" ) ); assertEquals( "Wert 1; Wert 2", myProperties.getProperty( "CombineValues.Two_Values" ) ); }
@Test public final void tc_getProperty_With_Paramaters() throws IOException { assertEquals( "P1: Param1", myProperties.getProperty( "ParamaterValues.One_Param", null, "Param1" ) ); assertEquals( "P1: Param1; P2: Param2", myProperties.getProperty( "ParamaterValues.Two_Params_1", null, "Param1", "Param2" ) ); assertEquals( "P2: Param2; P1: Param1", myProperties.getProperty( "ParamaterValues.Two_Params_2", null, "Param1", "Param2" ) ); }
@Test public final void tc_getProperty_With_Paramaters_Param_NotExist_1P() throws IOException { assertEquals( "", myProperties.getProperty( "ParamaterValues.One_Param_Notexists", null, "Param1" ) ); }
@Test public final void tc_getProperty_With_Paramaters_Param_NotExist_2P() throws IOException { assertEquals( "", myProperties.getProperty( "ParamaterValues.Two_Params_1_Notexists", null, "Param1", "Param2" ) ); }
@Test public final void tc_getProperty_With_ParamatersAndDefaultValues() throws IOException { assertEquals( "P1: Param1", myProperties.getProperty( "ParamaterValues.One_Param", "With DefaultValue P1: %P1%", "Param1" ) ); assertEquals( "P1: Param1; P2: Param2", myProperties.getProperty( "ParamaterValues.Two_Params_1", "With DefaultValue P1: %P1%; P2: %P2%", "Param1", "Param2" ) ); assertEquals( "With DefaultValue P1: Param1", myProperties.getProperty( "ParamaterValues.One_Param_NotExist", "With DefaultValue P1: %P1%", "Param1" ) ); assertEquals( "With DefaultValue P1: Param1; P2: Param2", myProperties.getProperty( "ParamaterValues.Two_Params_1_NotExist", "With DefaultValue P1: %P1%; P2: %P2%", "Param1", "Param2" ) ); }
@Test public final void tc_getProperty_With_ParamatersAndDefaultValuesPropertiesNotExist() throws IOException { assertEquals( "With DefaultValue P1: Param1", myProperties.getProperty( "ParamaterValues.One_Param_NotExist", "With DefaultValue P1: %P1%", "Param1" ) ); assertEquals( "With DefaultValue P1: Param1; P2: Param2", myProperties.getProperty( "ParamaterValues.Two_Params_1_NotExist", "With DefaultValue P1: %P1%; P2: %P2%", "Param1", "Param2" ) ); }