After r1695126, I found that most of the Java files have svn:eol-style=native. So only 116 Java files were missing svn:eol-style=native. I guess those have been added by committers who are not using the OFBiz svn config file on their machines. So rather than removing svn:eol-style=native, this commits add the property to the files which miss it. Here 116+89=205 files have their svn:eol-style property changed to native.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1695129 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,126 +1,126 @@
|
||||
/*******************************************************************************
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*******************************************************************************/
|
||||
package org.ofbiz.testtools;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.ofbiz.base.component.ComponentConfig;
|
||||
import org.ofbiz.base.config.GenericConfigException;
|
||||
import org.ofbiz.base.config.ResourceHandler;
|
||||
import org.ofbiz.base.container.Container;
|
||||
import org.ofbiz.base.container.ContainerException;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.UtilMisc;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* A Container implementation to run the tests configured through this testtools stuff.
|
||||
*/
|
||||
public class TestListContainer implements Container {
|
||||
|
||||
public static final String module = TestListContainer.class.getName();
|
||||
|
||||
private String name;
|
||||
private String outputLocation;
|
||||
private String mode = "text";
|
||||
|
||||
public static final class FoundTest {
|
||||
public final String componentName;
|
||||
public final String suiteName;
|
||||
|
||||
public FoundTest(String componentName, String suiteName) {
|
||||
this.componentName = componentName;
|
||||
this.suiteName = suiteName;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(String[] args, String name, String configFile) {
|
||||
this.name = name;
|
||||
this.outputLocation = args[0];
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
if ("-ant".equals(args[i])) {
|
||||
mode = "ant";
|
||||
} else if ("-text".equals(args[i])) {
|
||||
mode = "text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean start() throws ContainerException {
|
||||
List<FoundTest> foundTests = new LinkedList<FoundTest>();
|
||||
for (ComponentConfig.TestSuiteInfo testSuiteInfo: ComponentConfig.getAllTestSuiteInfos(null)) {
|
||||
String componentName = testSuiteInfo.getComponentConfig().getComponentName();
|
||||
ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
|
||||
|
||||
try {
|
||||
Document testSuiteDocument = testSuiteResource.getDocument();
|
||||
Element documentElement = testSuiteDocument.getDocumentElement();
|
||||
foundTests.add(new FoundTest(componentName, documentElement.getAttribute("suite-name")));
|
||||
} catch (GenericConfigException e) {
|
||||
String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
|
||||
Debug.logError(e, errMsg, module);
|
||||
throw new IllegalArgumentException(errMsg);
|
||||
}
|
||||
}
|
||||
try {
|
||||
FileOutputStream fout = new FileOutputStream(outputLocation + ".tmp");
|
||||
PrintStream pout = new PrintStream(fout);
|
||||
if ("text".equals(mode)) {
|
||||
for (FoundTest foundTest: foundTests) {
|
||||
pout.format("%s:%s\n", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
} else if ("ant".equals(mode)) {
|
||||
pout.println("<project default=\"all-tests\">");
|
||||
pout.print(" <target name=\"all-tests\" depends=\"");
|
||||
for (int i = 0; i < foundTests.size(); i++) {
|
||||
if (i != 0) pout.print(',');
|
||||
FoundTest foundTest = foundTests.get(i);
|
||||
pout.format("%s:%s", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
pout.println("\"/>\n");
|
||||
for (FoundTest foundTest : foundTests) {
|
||||
pout.format(" <target name=\"%1$s:%2$s\">\n <ant antfile=\"build.xml\" target=\"run-single-test-suite\">\n <property name=\"test.component\" value=\"%1$s\"/>\n <property name=\"test.suiteName\" value=\"%2$s\"/>\n </ant>\n </target>\n", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
pout.println("</project>");
|
||||
}
|
||||
pout.close();
|
||||
fout.close();
|
||||
new File(outputLocation + ".tmp").renameTo(new File(outputLocation));
|
||||
} catch (IOException e) {
|
||||
Debug.logError(e, module);
|
||||
throw UtilMisc.initCause(new IllegalArgumentException(e.getMessage()), e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void stop() throws ContainerException {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*******************************************************************************/
|
||||
package org.ofbiz.testtools;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.ofbiz.base.component.ComponentConfig;
|
||||
import org.ofbiz.base.config.GenericConfigException;
|
||||
import org.ofbiz.base.config.ResourceHandler;
|
||||
import org.ofbiz.base.container.Container;
|
||||
import org.ofbiz.base.container.ContainerException;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.UtilMisc;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* A Container implementation to run the tests configured through this testtools stuff.
|
||||
*/
|
||||
public class TestListContainer implements Container {
|
||||
|
||||
public static final String module = TestListContainer.class.getName();
|
||||
|
||||
private String name;
|
||||
private String outputLocation;
|
||||
private String mode = "text";
|
||||
|
||||
public static final class FoundTest {
|
||||
public final String componentName;
|
||||
public final String suiteName;
|
||||
|
||||
public FoundTest(String componentName, String suiteName) {
|
||||
this.componentName = componentName;
|
||||
this.suiteName = suiteName;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(String[] args, String name, String configFile) {
|
||||
this.name = name;
|
||||
this.outputLocation = args[0];
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
if ("-ant".equals(args[i])) {
|
||||
mode = "ant";
|
||||
} else if ("-text".equals(args[i])) {
|
||||
mode = "text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean start() throws ContainerException {
|
||||
List<FoundTest> foundTests = new LinkedList<FoundTest>();
|
||||
for (ComponentConfig.TestSuiteInfo testSuiteInfo: ComponentConfig.getAllTestSuiteInfos(null)) {
|
||||
String componentName = testSuiteInfo.getComponentConfig().getComponentName();
|
||||
ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler();
|
||||
|
||||
try {
|
||||
Document testSuiteDocument = testSuiteResource.getDocument();
|
||||
Element documentElement = testSuiteDocument.getDocumentElement();
|
||||
foundTests.add(new FoundTest(componentName, documentElement.getAttribute("suite-name")));
|
||||
} catch (GenericConfigException e) {
|
||||
String errMsg = "Error reading XML document from ResourceHandler for loader [" + testSuiteResource.getLoaderName() + "] and location [" + testSuiteResource.getLocation() + "]";
|
||||
Debug.logError(e, errMsg, module);
|
||||
throw new IllegalArgumentException(errMsg);
|
||||
}
|
||||
}
|
||||
try {
|
||||
FileOutputStream fout = new FileOutputStream(outputLocation + ".tmp");
|
||||
PrintStream pout = new PrintStream(fout);
|
||||
if ("text".equals(mode)) {
|
||||
for (FoundTest foundTest: foundTests) {
|
||||
pout.format("%s:%s\n", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
} else if ("ant".equals(mode)) {
|
||||
pout.println("<project default=\"all-tests\">");
|
||||
pout.print(" <target name=\"all-tests\" depends=\"");
|
||||
for (int i = 0; i < foundTests.size(); i++) {
|
||||
if (i != 0) pout.print(',');
|
||||
FoundTest foundTest = foundTests.get(i);
|
||||
pout.format("%s:%s", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
pout.println("\"/>\n");
|
||||
for (FoundTest foundTest : foundTests) {
|
||||
pout.format(" <target name=\"%1$s:%2$s\">\n <ant antfile=\"build.xml\" target=\"run-single-test-suite\">\n <property name=\"test.component\" value=\"%1$s\"/>\n <property name=\"test.suiteName\" value=\"%2$s\"/>\n </ant>\n </target>\n", foundTest.componentName, foundTest.suiteName);
|
||||
}
|
||||
pout.println("</project>");
|
||||
}
|
||||
pout.close();
|
||||
fout.close();
|
||||
new File(outputLocation + ".tmp").renameTo(new File(outputLocation));
|
||||
} catch (IOException e) {
|
||||
Debug.logError(e, module);
|
||||
throw UtilMisc.initCause(new IllegalArgumentException(e.getMessage()), e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void stop() throws ContainerException {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user