Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/ps-java-services] r5600 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration main/java/org/perfsonar/base2/service/configuration/migration/grammar/function test/java/org/perfsonar/base2/service/configuration/migration/grammar/function

Subject: perfsonar development work

List archive

[GEANT/SA2/ps-java-services] r5600 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration main/java/org/perfsonar/base2/service/configuration/migration/grammar/function test/java/org/perfsonar/base2/service/configuration/migration/grammar/function


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/ps-java-services] r5600 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration main/java/org/perfsonar/base2/service/configuration/migration/grammar/function test/java/org/perfsonar/base2/service/configuration/migration/grammar/function
  • Date: Tue, 27 Apr 2010 11:21:36 +0100

Author: psnc.pietrzak
Date: 2010-04-27 11:21:36 +0100 (Tue, 27 Apr 2010)
New Revision: 5600

Modified:

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/function/FunctionExpression.java

trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/grammar/function/ReplaceFunctionTest.java
Log:
Bug fix

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
2010-04-27 09:05:39 UTC (rev 5599)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/MigratorComponent.java
2010-04-27 10:21:36 UTC (rev 5600)
@@ -54,9 +54,13 @@
@Override
public void run() throws PerfSONARException {
try {
+ if (configFiles.getFiles().size() <= 0) {
+ logger.debug("psbase-1 configuration files
were not found.");
+ return;
+ }
final String templateFilePath =
getFullPath("configuration.xml.template");
final String configurationFile =
getFullPath("configuration.xml");
- logger.info("Creating configuration file: " +
configurationFile + " from template: " + templateFilePath + "...");
+ logger.debug("Creating configuration file: " +
configurationFile + " from template: " + templateFilePath + "...");
engine.createFileFromTemplate(new
File(templateFilePath), configurationFile);
logger.info("Configuration file: " +
configurationFile + " created successfully from template: " +
templateFilePath);


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/function/FunctionExpression.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/function/FunctionExpression.java
2010-04-27 09:05:39 UTC (rev 5599)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/function/FunctionExpression.java
2010-04-27 10:21:36 UTC (rev 5600)
@@ -27,7 +27,11 @@
*
*/
public class FunctionExpression extends BaseExpression {
- private final Pattern functionPattern =
Pattern.compile("[#]([a-zA-Z0-9_]+)\\(([^()]*)\\)");
+ //private final Pattern functionPattern =
Pattern.compile("[#]([a-zA-Z0-9_]+)\\(([^()]*)\\)");
+ //[^\"]*
+ //([a-zA-Z]+\\s+\"\")*
+ private final Pattern functionPattern =
Pattern.compile("[#]([a-zA-Z0-9_]+)\\((([a-zA-Z]+\\s+\"[^\"]*\"\\s*)*)\\)");
+
protected Pattern getPattern() {
return functionPattern;
}

Modified:
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/grammar/function/ReplaceFunctionTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/grammar/function/ReplaceFunctionTest.java
2010-04-27 09:05:39 UTC (rev 5599)
+++
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/grammar/function/ReplaceFunctionTest.java
2010-04-27 10:21:36 UTC (rev 5600)
@@ -8,7 +8,7 @@
*/
public class ReplaceFunctionTest extends FunctionTestCase {
protected String getLine() {
- return "value=\"#replace(string
\"${component.mp.xmldb.db_uri}\" regexp \"as\" with \"bas\")\"";
+ return "<option name=\"url\" value=\"#replace(string
\"http://localhost:8180/exist/rest/db/ls\"; regexp
\"http://(.+)/exist/rest/db/(.*)\" with
\"xmldb:exist://$1/exist/xmlrpc/db/$2\")\" />";
}

public void testGetName() {
@@ -17,9 +17,9 @@

public void testGetArguments() {
Map<String, String> expected = new Hashtable<String,
String>();
- expected.put("string", "${component.mp.xmldb.db_uri}");
- expected.put("regexp", "as");
- expected.put("with", "bas");
+ expected.put("string",
"http://localhost:8180/exist/rest/db/ls";);
+ expected.put("regexp", "http://(.+)/exist/rest/db/(.*)");
+ expected.put("with", "xmldb:exist://$1/exist/xmlrpc/db/$2");
assertEquals(expected, function.getArguments());
}




  • [GEANT/SA2/ps-java-services] r5600 - in trunk/perfsonar-java-base2/src: main/java/org/perfsonar/base2/service/configuration/migration main/java/org/perfsonar/base2/service/configuration/migration/grammar/function test/java/org/perfsonar/base2/service/configuration/migration/grammar/function, svn-noreply, 04/27/2010

Archive powered by MHonArc 2.6.16.

Top of Page