Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing some TABs from the servicemix-utils codebase

git-svn-id: https://svn.apache.org/repos/asf/servicemix/utils/trunk@1085730 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 02377824985f6a9e8093ce1dba88a4e2fd79b02a 1 parent 8167df2
@gertv gertv authored
Showing with 358 additions and 358 deletions.
  1. +5 −5 src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java
  2. +1 −1  src/main/java/org/apache/servicemix/components/util/StreamDataSource.java
  3. +8 −8 src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java
  4. +1 −1  src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java
  5. +1 −1  src/main/java/org/apache/servicemix/jdbc/Statements.java
  6. +1 −1  src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java
  7. +1 −1  src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java
  8. +1 −1  src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java
  9. +1 −1  src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java
  10. +1 −1  src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java
  11. +1 −1  src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java
  12. +313 −313 src/main/java/org/apache/servicemix/util/FileUtil.java
  13. +1 −1  src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java
  14. +16 −16 src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java
  15. +1 −1  src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java
  16. +1 −1  src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java
  17. +1 −1  src/test/resources/org/apache/servicemix/components/util/encoding.xml
  18. +3 −3 src/test/resources/org/apache/servicemix/expression/expression-editor.xml
View
10 src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java
@@ -75,11 +75,11 @@ public String getOutputName(MessageExchange exchange, NormalizedMessage message)
return asString(fileName.evaluate(exchange, message));
}
- public String getTempOutputName(MessageExchange exchange,
- NormalizedMessage message) throws MessagingException {
- Object retVal = tempFileName.evaluate(exchange, message);
- return retVal == null ? null : asString(retVal);
- }
+ public String getTempOutputName(MessageExchange exchange,
+ NormalizedMessage message) throws MessagingException {
+ Object retVal = tempFileName.evaluate(exchange, message);
+ return retVal == null ? null : asString(retVal);
+ }
public void writeMessage(MessageExchange exchange, NormalizedMessage message,
OutputStream out, String path) throws IOException, JBIException {
View
2  src/main/java/org/apache/servicemix/components/util/StreamDataSource.java
@@ -27,7 +27,7 @@
*/
public class StreamDataSource extends org.apache.servicemix.util.jaf.StreamDataSource {
- public StreamDataSource(InputStream in) {
+ public StreamDataSource(InputStream in) {
super(in);
}
View
16 src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java
@@ -165,14 +165,14 @@ public Object run() {
ClassLoader classLoader = findClassLoader();
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(iFactoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
+ try {
+ // If we are deployed into an OSGi environment, leverage it
+ Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(iFactoryId);
+ if (spiClass != null) {
+ return spiClass.newInstance();
+ }
+ } catch (Throwable e) {
+ }
// Use the system property first
try {
View
2  src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java
@@ -46,4 +46,4 @@ public String getValue() {
public void setValue(String value) {
this.value = value;
}
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/Statements.java
@@ -210,4 +210,4 @@ public void setCountStatement(String getCountStatement) {
this.countStatement = getCountStatement;
}
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java
@@ -38,4 +38,4 @@
*/
public class BlobJDBCAdapter extends DefaultJDBCAdapter {
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java
@@ -46,4 +46,4 @@ protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws
s.setBytes(index, data);
}
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java
@@ -29,4 +29,4 @@ public void setStatements(Statements statements) {
super.setStatements(statements);
}
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java
@@ -37,4 +37,4 @@ public void setStatements(Statements statements) {
super.setStatements(statements);
}
-}
+}
View
2  src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java
@@ -67,4 +67,4 @@ protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws
s.setBinaryStream(index, new ByteArrayInputStream(data), data.length);
}
-}
+}
View
2  src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java
@@ -167,4 +167,4 @@ private void evict() {
}
}
}
-}
+}
View
626 src/main/java/org/apache/servicemix/util/FileUtil.java
@@ -41,59 +41,59 @@
*/
public final class FileUtil {
- private FileUtil() {
- }
+ private FileUtil() {
+ }
- /**
- * Move a File
- *
- * @param src
- * @param targetDirectory
- * @throws IOException
- */
- public static void moveFile(File src, File targetDirectory)
- throws IOException {
- if (src == null || !src.exists() || !src.isFile() ||
- targetDirectory == null || !targetDirectory.exists() || !targetDirectory.isDirectory() ||
- !src.renameTo(new File(targetDirectory, src.getName()))) {
- // unable to move the file
- throw new IOException("Failed to move " + src + " to " + targetDirectory);
- }
- }
+ /**
+ * Move a File
+ *
+ * @param src
+ * @param targetDirectory
+ * @throws IOException
+ */
+ public static void moveFile(File src, File targetDirectory)
+ throws IOException {
+ if (src == null || !src.exists() || !src.isFile() ||
+ targetDirectory == null || !targetDirectory.exists() || !targetDirectory.isDirectory() ||
+ !src.renameTo(new File(targetDirectory, src.getName()))) {
+ // unable to move the file
+ throw new IOException("Failed to move " + src + " to " + targetDirectory);
+ }
+ }
- /**
- * Build a path- but do not create it
- *
- * @param parent
- * @param subDirectory
- * @return a File representing the path
- */
- public static File getDirectoryPath(File parent, String subDirectory) {
- File result = null;
- if (parent != null) {
- result = new File(parent, subDirectory);
- }
- return result;
- }
+ /**
+ * Build a path- but do not create it
+ *
+ * @param parent
+ * @param subDirectory
+ * @return a File representing the path
+ */
+ public static File getDirectoryPath(File parent, String subDirectory) {
+ File result = null;
+ if (parent != null) {
+ result = new File(parent, subDirectory);
+ }
+ return result;
+ }
- /**
- * Build a directory path - creating directories if neccesary
- *
- * @param file
- * @return true if the directory exists, or making it was successful
- */
- public static boolean buildDirectory(File file) {
- return file.exists() || file.mkdirs();
- }
+ /**
+ * Build a directory path - creating directories if neccesary
+ *
+ * @param file
+ * @return true if the directory exists, or making it was successful
+ */
+ public static boolean buildDirectory(File file) {
+ return file.exists() || file.mkdirs();
+ }
- /**
- * Count files in a directory (including files in all subdirectories)
- *
- * @param directory
- * the directory to start in
- * @return the total number of files
- */
- public static int countFilesInDirectory(File directory) {
+ /**
+ * Count files in a directory (including files in all subdirectories)
+ *
+ * @param directory
+ * the directory to start in
+ * @return the total number of files
+ */
+ public static int countFilesInDirectory(File directory) {
int count = 0;
for (File file : directory.listFiles()) {
if (file.isFile()) {
@@ -106,280 +106,280 @@ public static int countFilesInDirectory(File directory) {
return count;
}
- /**
- * Copy in stream to an out stream
- *
- * @param in
- * @param out
- * @throws IOException
- */
- public static void copyInputStream(InputStream in, OutputStream out)
- throws IOException {
- // simply use the fastCopy method
- fastCopy(in, out);
- }
+ /**
+ * Copy in stream to an out stream
+ *
+ * @param in
+ * @param out
+ * @throws IOException
+ */
+ public static void copyInputStream(InputStream in, OutputStream out)
+ throws IOException {
+ // simply use the fastCopy method
+ fastCopy(in, out);
+ }
- /**
- * Unpack a zip file
- *
- * @param theFile
- * @param targetDir
- * @return the file
- * @throws IOException
- */
- public static File unpackArchive(File theFile, File targetDir)
- throws IOException {
- if (!theFile.exists()) {
- throw new IOException(theFile.getAbsolutePath() + " does not exist");
- }
- if (!buildDirectory(targetDir)) {
- throw new IOException("Could not create directory: " + targetDir);
- }
- ZipFile zipFile;
- zipFile = new ZipFile(theFile);
- for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- File file = new File(targetDir, File.separator + entry.getName());
- // Take the sledgehammer approach to creating directories
- // to work around ZIP's that incorrectly miss directories
- if (!buildDirectory(file.getParentFile())) {
- throw new IOException("Could not create directory: "
- + file.getParentFile());
- }
- if (!entry.isDirectory()) {
- copyInputStream(zipFile.getInputStream(entry),
- new BufferedOutputStream(new FileOutputStream(file)));
- } else {
- if (!buildDirectory(file)) {
- throw new IOException("Could not create directory: " + file);
- }
- }
- }
- zipFile.close();
- return theFile;
- }
+ /**
+ * Unpack a zip file
+ *
+ * @param theFile
+ * @param targetDir
+ * @return the file
+ * @throws IOException
+ */
+ public static File unpackArchive(File theFile, File targetDir)
+ throws IOException {
+ if (!theFile.exists()) {
+ throw new IOException(theFile.getAbsolutePath() + " does not exist");
+ }
+ if (!buildDirectory(targetDir)) {
+ throw new IOException("Could not create directory: " + targetDir);
+ }
+ ZipFile zipFile;
+ zipFile = new ZipFile(theFile);
+ for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) {
+ ZipEntry entry = (ZipEntry) entries.nextElement();
+ File file = new File(targetDir, File.separator + entry.getName());
+ // Take the sledgehammer approach to creating directories
+ // to work around ZIP's that incorrectly miss directories
+ if (!buildDirectory(file.getParentFile())) {
+ throw new IOException("Could not create directory: "
+ + file.getParentFile());
+ }
+ if (!entry.isDirectory()) {
+ copyInputStream(zipFile.getInputStream(entry),
+ new BufferedOutputStream(new FileOutputStream(file)));
+ } else {
+ if (!buildDirectory(file)) {
+ throw new IOException("Could not create directory: " + file);
+ }
+ }
+ }
+ zipFile.close();
+ return theFile;
+ }
- /**
- * Unpack an archive from a URL
- *
- * @param url
- * @param targetDir
- * @return the file to the url
- * @throws IOException
- */
- public static File unpackArchive(URL url, File targetDir)
- throws IOException {
- if (!targetDir.exists()) {
- targetDir.mkdirs();
- }
- InputStream in = new BufferedInputStream(url.openStream());
- // make sure we get the actual file
- File zip = File.createTempFile("arc", ".zip", targetDir);
- OutputStream out = new BufferedOutputStream(new FileOutputStream(zip));
- copyInputStream(in, out);
- out.close();
- return unpackArchive(zip, targetDir);
- }
+ /**
+ * Unpack an archive from a URL
+ *
+ * @param url
+ * @param targetDir
+ * @return the file to the url
+ * @throws IOException
+ */
+ public static File unpackArchive(URL url, File targetDir)
+ throws IOException {
+ if (!targetDir.exists()) {
+ targetDir.mkdirs();
+ }
+ InputStream in = new BufferedInputStream(url.openStream());
+ // make sure we get the actual file
+ File zip = File.createTempFile("arc", ".zip", targetDir);
+ OutputStream out = new BufferedOutputStream(new FileOutputStream(zip));
+ copyInputStream(in, out);
+ out.close();
+ return unpackArchive(zip, targetDir);
+ }
- /**
- * Validate that an archive contains a named entry
- *
- * @param theFile
- * @param name
- * @return true if the entry exists
- * @throws IOException
- */
- public static boolean archiveContainsEntry(File theFile, String name)
- throws IOException {
- boolean result = false;
- ZipFile zipFile;
- zipFile = new ZipFile(theFile);
- for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- if (entry.getName().equals(name)) {
- result = true;
- break;
- }
- }
- zipFile.close();
- return result;
- }
+ /**
+ * Validate that an archive contains a named entry
+ *
+ * @param theFile
+ * @param name
+ * @return true if the entry exists
+ * @throws IOException
+ */
+ public static boolean archiveContainsEntry(File theFile, String name)
+ throws IOException {
+ boolean result = false;
+ ZipFile zipFile;
+ zipFile = new ZipFile(theFile);
+ for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) {
+ ZipEntry entry = (ZipEntry) entries.nextElement();
+ if (entry.getName().equals(name)) {
+ result = true;
+ break;
+ }
+ }
+ zipFile.close();
+ return result;
+ }
- /**
- * Create a unique directory within a directory 'root'
- *
- * @param rootDir
- * @param seed
- * @return unique directory
- * @throws IOException
- */
- public static synchronized File createUniqueDirectory(File rootDir,
- String seed) throws IOException {
- int index = seed.lastIndexOf('.');
- if (index > 0) {
- seed = seed.substring(0, index);
- }
- File result = null;
- int count = 0;
- while (result == null) {
- String name = seed + "." + count + ".tmp";
- File file = new File(rootDir, name);
- if (!file.exists()) {
- file.mkdirs();
- result = file;
- }
- count++;
- }
- return result;
- }
+ /**
+ * Create a unique directory within a directory 'root'
+ *
+ * @param rootDir
+ * @param seed
+ * @return unique directory
+ * @throws IOException
+ */
+ public static synchronized File createUniqueDirectory(File rootDir,
+ String seed) throws IOException {
+ int index = seed.lastIndexOf('.');
+ if (index > 0) {
+ seed = seed.substring(0, index);
+ }
+ File result = null;
+ int count = 0;
+ while (result == null) {
+ String name = seed + "." + count + ".tmp";
+ File file = new File(rootDir, name);
+ if (!file.exists()) {
+ file.mkdirs();
+ result = file;
+ }
+ count++;
+ }
+ return result;
+ }
- /**
- * Delete a file
- *
- * @param fileToDelete
- * @return true if the File is deleted
- */
- public static boolean deleteFile(File fileToDelete) {
- if (fileToDelete == null || !fileToDelete.exists()) {
- return true;
- }
- boolean result = true;
- if (fileToDelete.isDirectory()) {
- File[] files = fileToDelete.listFiles();
- if (files == null) {
- result = false;
- } else {
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (file.getName().equals(".")
- || file.getName().equals("..")) {
- continue;
- }
- if (file.isDirectory()) {
- result &= deleteFile(file);
- } else {
- result &= file.delete();
- }
- }
- }
- }
- result &= fileToDelete.delete();
- return result;
- }
+ /**
+ * Delete a file
+ *
+ * @param fileToDelete
+ * @return true if the File is deleted
+ */
+ public static boolean deleteFile(File fileToDelete) {
+ if (fileToDelete == null || !fileToDelete.exists()) {
+ return true;
+ }
+ boolean result = true;
+ if (fileToDelete.isDirectory()) {
+ File[] files = fileToDelete.listFiles();
+ if (files == null) {
+ result = false;
+ } else {
+ for (int i = 0; i < files.length; i++) {
+ File file = files[i];
+ if (file.getName().equals(".")
+ || file.getName().equals("..")) {
+ continue;
+ }
+ if (file.isDirectory()) {
+ result &= deleteFile(file);
+ } else {
+ result &= file.delete();
+ }
+ }
+ }
+ }
+ result &= fileToDelete.delete();
+ return result;
+ }
- /**
- * Zip up a directory
- *
- * @param directory
- * @param zipName
- * @throws IOException
- */
- public static void zipDir(String directory, String zipName)
- throws IOException {
- // create a ZipOutputStream to zip the data to
- ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipName));
- String path = "";
- zipDir(directory, zos, path);
- // close the stream
- zos.close();
- }
+ /**
+ * Zip up a directory
+ *
+ * @param directory
+ * @param zipName
+ * @throws IOException
+ */
+ public static void zipDir(String directory, String zipName)
+ throws IOException {
+ // create a ZipOutputStream to zip the data to
+ ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipName));
+ String path = "";
+ zipDir(directory, zos, path);
+ // close the stream
+ zos.close();
+ }
- /**
- * Zip up a directory path
- *
- * @param directory
- * @param zos
- * @param path
- * @throws IOException
- */
- public static void zipDir(String directory, ZipOutputStream zos, String path)
- throws IOException {
- File zipDir = new File(directory);
- // get a listing of the directory content
- String[] dirList = zipDir.list();
- byte[] readBuffer = new byte[2156];
- int bytesIn = 0;
- // loop through dirList, and zip the files
- for (int i = 0; i < dirList.length; i++) {
- File f = new File(zipDir, dirList[i]);
- if (f.isDirectory()) {
- String filePath = f.getPath();
- zipDir(filePath, zos, path + f.getName() + "/");
- continue;
- }
- FileInputStream fis = new FileInputStream(f);
- try {
- ZipEntry anEntry = new ZipEntry(path + f.getName());
- zos.putNextEntry(anEntry);
- bytesIn = fis.read(readBuffer);
- while (bytesIn != -1) {
- zos.write(readBuffer, 0, bytesIn);
- bytesIn = fis.read(readBuffer);
- }
- } finally {
- fis.close();
- }
- }
- }
+ /**
+ * Zip up a directory path
+ *
+ * @param directory
+ * @param zos
+ * @param path
+ * @throws IOException
+ */
+ public static void zipDir(String directory, ZipOutputStream zos, String path)
+ throws IOException {
+ File zipDir = new File(directory);
+ // get a listing of the directory content
+ String[] dirList = zipDir.list();
+ byte[] readBuffer = new byte[2156];
+ int bytesIn = 0;
+ // loop through dirList, and zip the files
+ for (int i = 0; i < dirList.length; i++) {
+ File f = new File(zipDir, dirList[i]);
+ if (f.isDirectory()) {
+ String filePath = f.getPath();
+ zipDir(filePath, zos, path + f.getName() + "/");
+ continue;
+ }
+ FileInputStream fis = new FileInputStream(f);
+ try {
+ ZipEntry anEntry = new ZipEntry(path + f.getName());
+ zos.putNextEntry(anEntry);
+ bytesIn = fis.read(readBuffer);
+ while (bytesIn != -1) {
+ zos.write(readBuffer, 0, bytesIn);
+ bytesIn = fis.read(readBuffer);
+ }
+ } finally {
+ fis.close();
+ }
+ }
+ }
- /**
- * checks whether a file is fully transmitted or still being copied
- *
- * @param path
- * the full file path
- * @returns true if the file size didn't change for 100 millis
- */
- public static boolean isFileFullyAvailable(String path) {
- return isFileFullyAvailable(new File(path));
- }
+ /**
+ * checks whether a file is fully transmitted or still being copied
+ *
+ * @param path
+ * the full file path
+ * @returns true if the file size didn't change for 100 millis
+ */
+ public static boolean isFileFullyAvailable(String path) {
+ return isFileFullyAvailable(new File(path));
+ }
- /**
- * checks whether a file is fully transmitted or still being copied
- *
- * @param file
- * the file to check
- * @returns true if the file size didn't change for 100 millis
- */
- public static boolean isFileFullyAvailable(File file) {
- // First check to see if the file is still growing
- long targetLength = file.length();
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- // Do nothing
- }
- long target2Length = file.length();
+ /**
+ * checks whether a file is fully transmitted or still being copied
+ *
+ * @param file
+ * the file to check
+ * @returns true if the file size didn't change for 100 millis
+ */
+ public static boolean isFileFullyAvailable(File file) {
+ // First check to see if the file is still growing
+ long targetLength = file.length();
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ // Do nothing
+ }
+ long target2Length = file.length();
- if (targetLength != target2Length) {
- return false;
- }
+ if (targetLength != target2Length) {
+ return false;
+ }
- return true;
- }
+ return true;
+ }
- /**
- * Copies the whole content from the input stream to the output stream using
- * nio channels to speed it up.
- *
- * @param input the input stream
- * @param output the output stream
- * @throws IOException if any IO error occurs during read/write
- */
- public static void fastCopy(final InputStream input, final OutputStream output) throws IOException {
- final ReadableByteChannel src = Channels.newChannel(input);
- final WritableByteChannel dest = Channels.newChannel(output);
- final ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024);
+ /**
+ * Copies the whole content from the input stream to the output stream using
+ * nio channels to speed it up.
+ *
+ * @param input the input stream
+ * @param output the output stream
+ * @throws IOException if any IO error occurs during read/write
+ */
+ public static void fastCopy(final InputStream input, final OutputStream output) throws IOException {
+ final ReadableByteChannel src = Channels.newChannel(input);
+ final WritableByteChannel dest = Channels.newChannel(output);
+ final ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024);
- while (src.read(buffer) != -1) {
- buffer.flip();
- dest.write(buffer);
- buffer.compact();
- }
- buffer.flip();
- while (buffer.hasRemaining()) {
- dest.write(buffer);
- }
- src.close();
- dest.close();
- }
-}
+ while (src.read(buffer) != -1) {
+ buffer.flip();
+ dest.write(buffer);
+ buffer.compact();
+ }
+ buffer.flip();
+ while (buffer.hasRemaining()) {
+ dest.write(buffer);
+ }
+ src.close();
+ dest.close();
+ }
+}
View
2  src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java
@@ -65,4 +65,4 @@ public String getName() {
public void setName(String name) {
this.name = name;
}
-}
+}
View
32 src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java
@@ -89,27 +89,27 @@ private MessageExchange createMockExchange() throws MessagingException {
}
public void testTempFileNameFromNmsg() throws Exception {
- String tmp = "tmp_filename.ext_123";
- MessageExchange exchange = createMockExchange();
- exchange.getMessage("in").setContent(new StringSource(MESSAGE));
- exchange.getMessage("in").setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp);
- String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
- assertEquals("The temp file name was not extracted correctly", tmp, tempName);
+ String tmp = "tmp_filename.ext_123";
+ MessageExchange exchange = createMockExchange();
+ exchange.getMessage("in").setContent(new StringSource(MESSAGE));
+ exchange.getMessage("in").setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp);
+ String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
+ assertEquals("The temp file name was not extracted correctly", tmp, tempName);
}
public void testTempFileNameFromExchange() throws Exception {
- String tmp = "tmp_filename.ext_123";
- MessageExchange exchange = createMockExchange();
- exchange.getMessage("in").setContent(new StringSource(MESSAGE));
- exchange.setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp);
- String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
- assertEquals("The temp file name was not extracted correctly", tmp, tempName);
+ String tmp = "tmp_filename.ext_123";
+ MessageExchange exchange = createMockExchange();
+ exchange.getMessage("in").setContent(new StringSource(MESSAGE));
+ exchange.setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp);
+ String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
+ assertEquals("The temp file name was not extracted correctly", tmp, tempName);
}
public void testTempFileNameNull() throws Exception {
- MessageExchange exchange = createMockExchange();
- exchange.getMessage("in").setContent(new StringSource(MESSAGE));
- String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
- assertNull("The temp file name was not null", tempName);
+ MessageExchange exchange = createMockExchange();
+ exchange.getMessage("in").setContent(new StringSource(MESSAGE));
+ String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in"));
+ assertNull("The temp file name was not null", tempName);
}
}
View
2  src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java
@@ -81,4 +81,4 @@ public void testDistributesStoreAndLoad() throws Exception {
assertNotNull(data);
assertEquals(data, result);
}
-}
+}
View
2  src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java
@@ -70,4 +70,4 @@ public void testCreateRobustInOnlyExchange() throws Exception {
assertNotNull(exchange.getExchangeId());
assertEquals(MockExchangeFactory.ROBUST_IN_ONLY,exchange.getPattern());
}
-}
+}
View
2  src/test/resources/org/apache/servicemix/components/util/encoding.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<test>l'élève est à l'école</test>
+<test>l'élève est à l'école</test>
View
6 src/test/resources/org/apache/servicemix/expression/expression-editor.xml
@@ -20,7 +20,7 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
- <bean id="ExpressionTestSupport" class="org.apache.servicemix.expression.ExpressionTestSupport">
- <property name="expression"><value>test</value></property>
- </bean>
+ <bean id="ExpressionTestSupport" class="org.apache.servicemix.expression.ExpressionTestSupport">
+ <property name="expression"><value>test</value></property>
+ </bean>
</beans>
Please sign in to comment.
Something went wrong with that request. Please try again.