camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r683145 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/language/constant/ test/java/org/apache/camel/component/bean/ test/java/org/apache/camel/component/file/
Date Wed, 06 Aug 2008 07:48:04 GMT
Author: ningjiang
Date: Wed Aug  6 00:48:03 2008
New Revision: 683145

URL: http://svn.apache.org/viewvc?rev=683145&view=rev
Log:
Applied the svn properties for camel-core

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/package.html
  (props changed)
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
  (props changed)
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
  (props changed)
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
  (contents, props changed)
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
  (contents, props changed)

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/constant/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithAnnotationAndExchangeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithHeaderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java?rev=683145&r1=683144&r2=683145&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
Wed Aug  6 00:48:03 2008
@@ -1,99 +1,99 @@
-/**
- * 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.apache.camel.component.file;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileLock;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Unit test to verify exclusive read - that we do not poll files that is in progress of
being written.
- */
-public class FileExclusiveReadTest extends ContextTestSupport {
-
-    private static final Log LOG = LogFactory.getLog(FileExclusiveReadTest.class);
-
-    private String fileUrl = "file://target/exclusiveread/slowfile?consumer.delay=500&consumer.exclusiveRead=true";
-
-    @Override
-    protected void setUp() throws Exception {
-        disableJMX();
-        super.setUp();
-    }
-
-    public void testPoolIn3SecondsButNoFiles() throws Exception {
-        deleteDirectory("./target/exclusiveread");
-        createDirectory("./target/exclusiveread/slowfile");
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(0);
-
-        Thread.sleep(3 * 1000L);
-
-        mock.assertIsSatisfied();
-    }
-
-    // TODO: Not possible to test in the same JVM (see javadoc for FileLock)
-    public void xxxtestPollFileWhileSlowFileIsBeingWritten() throws Exception {
-        deleteDirectory("./target/exclusiveread");
-        createDirectory("./target/exclusiveread/slowfile");
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-        mock.expectedBodiesReceived("Hello WorldLine #0Line #1Line #2Bye Worl");
-
-        createSlowFile();
-
-        mock.assertIsSatisfied();
-    }
-
-    private void createSlowFile() throws Exception {
-        LOG.info("Creating a slow file ...");
-        File file = new File("./target/exclusiveread/slowfile/hello.txt");
-        FileOutputStream fos = new FileOutputStream(file);
-        FileLock lock = fos.getChannel().lock();
-        fos.write("Hello World".getBytes());
-        for (int i = 0; i < 3; i++) {
-            Thread.sleep(1000);
-            fos.write(("Line #" + i).getBytes());
-            LOG.info("Appending to slowfile");
-        }
-        fos.write("Bye World".getBytes());
-        lock.release();
-        fos.close();
-        LOG.info("... done creating slowfile");
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                from(fileUrl).to("mock:result");
-            }
-        };
-    }
-
-    private static void createDirectory(String s) {
-        File file = new File(s);
-        file.mkdirs();
-    }
-
-}
+/**
+ * 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.apache.camel.component.file;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileLock;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Unit test to verify exclusive read - that we do not poll files that is in progress of
being written.
+ */
+public class FileExclusiveReadTest extends ContextTestSupport {
+
+    private static final Log LOG = LogFactory.getLog(FileExclusiveReadTest.class);
+
+    private String fileUrl = "file://target/exclusiveread/slowfile?consumer.delay=500&consumer.exclusiveRead=true";
+
+    @Override
+    protected void setUp() throws Exception {
+        disableJMX();
+        super.setUp();
+    }
+
+    public void testPoolIn3SecondsButNoFiles() throws Exception {
+        deleteDirectory("./target/exclusiveread");
+        createDirectory("./target/exclusiveread/slowfile");
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(0);
+
+        Thread.sleep(3 * 1000L);
+
+        mock.assertIsSatisfied();
+    }
+
+    // TODO: Not possible to test in the same JVM (see javadoc for FileLock)
+    public void xxxtestPollFileWhileSlowFileIsBeingWritten() throws Exception {
+        deleteDirectory("./target/exclusiveread");
+        createDirectory("./target/exclusiveread/slowfile");
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        mock.expectedBodiesReceived("Hello WorldLine #0Line #1Line #2Bye Worl");
+
+        createSlowFile();
+
+        mock.assertIsSatisfied();
+    }
+
+    private void createSlowFile() throws Exception {
+        LOG.info("Creating a slow file ...");
+        File file = new File("./target/exclusiveread/slowfile/hello.txt");
+        FileOutputStream fos = new FileOutputStream(file);
+        FileLock lock = fos.getChannel().lock();
+        fos.write("Hello World".getBytes());
+        for (int i = 0; i < 3; i++) {
+            Thread.sleep(1000);
+            fos.write(("Line #" + i).getBytes());
+            LOG.info("Appending to slowfile");
+        }
+        fos.write("Bye World".getBytes());
+        lock.release();
+        fos.close();
+        LOG.info("... done creating slowfile");
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from(fileUrl).to("mock:result");
+            }
+        };
+    }
+
+    private static void createDirectory(String s) {
+        File file = new File(s);
+        file.mkdirs();
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java?rev=683145&r1=683144&r2=683145&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
Wed Aug  6 00:48:03 2008
@@ -1,51 +1,51 @@
-/**
- * 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.apache.camel.component.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test that tests that the header contains the absolute path to the filename it used.
- */
-public class FileHeaderFileNameProducedTest extends ContextTestSupport {
-
-    public void testHeaderFileNameProduced() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-        // the absolute path to the file written should contain the target folder
-        mock.message(0).header(FileComponent.HEADER_FILE_NAME_PRODUCED).contains("target");
-
-        template.requestBodyAndHeader("direct:in", "Hello World", FileComponent.HEADER_FILE_NAME,
-            "FileHeaderFileNameProducedTest.txt");
-
-        mock.assertIsSatisfied();
-    }
-
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                from("direct:in")
-                    .to("file://target/?append=false")
-                    .to("mock:result");
-            }
-        };
-    }
-
+/**
+ * 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.apache.camel.component.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test that tests that the header contains the absolute path to the filename it used.
+ */
+public class FileHeaderFileNameProducedTest extends ContextTestSupport {
+
+    public void testHeaderFileNameProduced() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        // the absolute path to the file written should contain the target folder
+        mock.message(0).header(FileComponent.HEADER_FILE_NAME_PRODUCED).contains("target");
+
+        template.requestBodyAndHeader("direct:in", "Hello World", FileComponent.HEADER_FILE_NAME,
+            "FileHeaderFileNameProducedTest.txt");
+
+        mock.assertIsSatisfied();
+    }
+
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("direct:in")
+                    .to("file://target/?append=false")
+                    .to("mock:result");
+            }
+        };
+    }
+
 }
\ No newline at end of file

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileHeaderFileNameProducedTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message