You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-commits@incubator.apache.org by to...@apache.org on 2013/03/28 11:12:58 UTC
svn commit: r1462040 - in
/incubator/droids/branches/0.2.x-cleanup/droids-core/src:
main/java/org/apache/droids/filter/FragmentFilter.java
test/java/org/apache/droids/delay/TestDelay.java
test/java/org/apache/droids/filter/FragmentsFilterTest.java
Author: tobr
Date: Thu Mar 28 11:12:57 2013
New Revision: 1462040
URL: http://svn.apache.org/r1462040
Log:
added licence header
removed deprecated junit calls
Modified:
incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/filter/FragmentFilter.java
incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/delay/TestDelay.java
incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/filter/FragmentsFilterTest.java
Modified: incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/filter/FragmentFilter.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/filter/FragmentFilter.java?rev=1462040&r1=1462039&r2=1462040&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/filter/FragmentFilter.java (original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/filter/FragmentFilter.java Thu Mar 28 11:12:57 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.droids.filter;
import org.apache.droids.core.Filter;
Modified: incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/delay/TestDelay.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/delay/TestDelay.java?rev=1462040&r1=1462039&r2=1462040&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/delay/TestDelay.java (original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/delay/TestDelay.java Thu Mar 28 11:12:57 2013
@@ -16,10 +16,9 @@
*/
package org.apache.droids.delay;
+import static org.junit.Assert.*;
import org.junit.Test;
-import junit.framework.Assert;
-
public class TestDelay {
@Test
@@ -30,8 +29,8 @@ public class TestDelay {
RandomDelayTimer timer = new RandomDelayTimer(min, spread);
for (i = 0; i < 100; i++) {
long delay = timer.getDelayMillis();
- Assert.assertTrue(delay >= min);
- Assert.assertTrue(delay < (min + spread));
+ assertTrue(delay >= min);
+ assertTrue(delay < (min + spread));
}
min = 300;
spread = 20;
@@ -39,23 +38,23 @@ public class TestDelay {
timer.setMinimumDelay(min);
for (i = 0; i < 100; i++) {
long delay = timer.getDelayMillis();
- Assert.assertTrue(delay >= min);
- Assert.assertTrue(delay < (min + spread));
+ assertTrue(delay >= min);
+ assertTrue(delay < (min + spread));
}
timer = new GaussianRandomDelayTimer(min, spread);
for (i = 0; i < 100; i++) {
long delay = timer.getDelayMillis();
- Assert.assertTrue("DELAY:" + delay, delay >= min);
- Assert.assertTrue("DELAY:" + delay, delay < (min + (spread * 4)));
+ assertTrue("DELAY:" + delay, delay >= min);
+ assertTrue("DELAY:" + delay, delay < (min + (spread * 4)));
}
DelayTimer t = new SimpleDelayTimer(1000);
- Assert.assertTrue(1000 == t.getDelayMillis());
+ assertTrue(1000 == t.getDelayMillis());
// default timers all have time zero
- Assert.assertEquals(0, new SimpleDelayTimer().getDelayMillis());
- Assert.assertEquals(0, new RandomDelayTimer().getDelayMillis());
- Assert.assertEquals(0, new GaussianRandomDelayTimer().getDelayMillis());
+ assertEquals(0, new SimpleDelayTimer().getDelayMillis());
+ assertEquals(0, new RandomDelayTimer().getDelayMillis());
+ assertEquals(0, new GaussianRandomDelayTimer().getDelayMillis());
}
}
Modified: incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/filter/FragmentsFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/filter/FragmentsFilterTest.java?rev=1462040&r1=1462039&r2=1462040&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/filter/FragmentsFilterTest.java (original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-core/src/test/java/org/apache/droids/filter/FragmentsFilterTest.java Thu Mar 28 11:12:57 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.droids.filter;
import org.apache.droids.core.BasicTask;
@@ -19,7 +35,6 @@ public class FragmentsFilterTest {
private String scheme = "http";
private String host = "incubator.apache.org";
private String path = "/droids/";
- private String fragment = "top";
private Filter<BasicTask> fragmentFilter = new FragmentFilter<BasicTask>();
@@ -31,6 +46,7 @@ public class FragmentsFilterTest {
@Test
public void testFilterFragment() {
+ String fragment = "top";
try {
URI uri = new URI(scheme, host, path, fragment);