You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/02/14 09:49:36 UTC
[31/51] [partial] cxf git commit: Remove all trailing whitespaces
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java b/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
index 1a3c1b8..9f87e84 100644
--- a/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
+++ b/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
@@ -48,14 +48,14 @@ public class ResourceInjectorTest extends Assert {
private static final String RESOURCE_ONE = "resource one";
private static final String RESOURCE_TWO = "resource two";
private static final String RESOURCE_THREE = "resource three";
-
- private ResourceInjector injector;
-
- public void setUpResourceManager(String pfx) {
+
+ private ResourceInjector injector;
+
+ public void setUpResourceManager(String pfx) {
ResourceManager resMgr = EasyMock.createMock(ResourceManager.class);
List<ResourceResolver> resolvers = new ArrayList<>();
-
+
resMgr.getResourceResolvers();
EasyMock.expectLastCall().andReturn(resolvers);
resMgr.resolveResource(pfx + "resource1", String.class, resolvers);
@@ -65,44 +65,44 @@ public class ResourceInjectorTest extends Assert {
resMgr.resolveResource("resource3", CharSequence.class, resolvers);
EasyMock.expectLastCall().andReturn(RESOURCE_THREE);
EasyMock.replay(resMgr);
-
- injector = new ResourceInjector(resMgr);
- }
+
+ injector = new ResourceInjector(resMgr);
+ }
@Test
- public void testFieldInjection() {
+ public void testFieldInjection() {
setUpResourceManager(FieldTarget.class.getCanonicalName() + "/");
- doInjectTest(new FieldTarget());
+ doInjectTest(new FieldTarget());
}
-
-
+
+
@Test
- public void testFieldInSuperClassInjection() {
+ public void testFieldInSuperClassInjection() {
setUpResourceManager("org.apache.cxf.common.injection.FieldTarget/");
- doInjectTest(new SubFieldTarget());
+ doInjectTest(new SubFieldTarget());
}
-
+
@Test
public void testSetterInSuperClassInjection() {
setUpResourceManager("org.apache.cxf.common.injection.SetterTarget/");
- doInjectTest(new SubSetterTarget());
+ doInjectTest(new SubSetterTarget());
}
@Test
public void testSetterInjection() {
setUpResourceManager(SetterTarget.class.getCanonicalName() + "/");
- doInjectTest(new SetterTarget());
+ doInjectTest(new SetterTarget());
}
-
+
@Test
public void testProxyInjection() {
setUpResourceManager(SetterTarget.class.getCanonicalName() + "/");
doInjectTest(getProxyObject(), SetterTarget.class);
}
-
+
@Test
public void testEnhancedInjection() {
- setUpResourceManager(FieldTarget.class.getCanonicalName() + "/");
+ setUpResourceManager(FieldTarget.class.getCanonicalName() + "/");
doInjectTest(getEnhancedObject());
}
@@ -115,75 +115,75 @@ public class ResourceInjectorTest extends Assert {
@Test
public void testResourcesContainer() {
setUpResourceManager("");
- doInjectTest(new ResourcesContainerTarget());
+ doInjectTest(new ResourcesContainerTarget());
}
@Test
- public void testPostConstruct() {
+ public void testPostConstruct() {
setUpResourceManager(SetterTarget.class.getCanonicalName() + "/");
- SetterTarget target = new SetterTarget();
- doInjectTest(target);
- assertTrue(target.injectionCompleteCalled());
+ SetterTarget target = new SetterTarget();
+ doInjectTest(target);
+ assertTrue(target.injectionCompleteCalled());
}
@Test
- public void testPreDestroy() {
+ public void testPreDestroy() {
injector = new ResourceInjector(null, null);
- SetterTarget target = new SetterTarget();
- injector.destroy(target);
- assertTrue(target.preDestroyCalled());
+ SetterTarget target = new SetterTarget();
+ injector.destroy(target);
+ assertTrue(target.preDestroyCalled());
}
private void doInjectTest(Target target) {
doInjectTest(target, target.getClass());
}
-
+
private void doInjectTest(Target target, Class<?> clazz) {
injector.inject(target, clazz);
injector.construct(target);
- assertNotNull(target.getResource1());
- assertEquals(RESOURCE_ONE, target.getResource1());
+ assertNotNull(target.getResource1());
+ assertEquals(RESOURCE_ONE, target.getResource1());
- assertNotNull(target.getResource2());
+ assertNotNull(target.getResource2());
assertEquals(RESOURCE_TWO, target.getResource2());
-
+
assertNotNull(target.getResource3());
assertEquals(RESOURCE_THREE, target.getResource3());
}
-
+
private Target getProxyObject() {
Target t = (Target)Proxy.newProxyInstance(ISetterTarget.class.getClassLoader(),
new Class[] {ISetterTarget.class},
new ProxyClass(new SetterTarget()));
return t;
}
-
+
private FieldTarget getEnhancedObject() {
Enhancer e = new Enhancer();
- e.setSuperclass(FieldTarget.class);
+ e.setSuperclass(FieldTarget.class);
e.setCallback(new CallInterceptor());
- return (FieldTarget)e.create();
+ return (FieldTarget)e.create();
}
}
interface Target {
- String getResource1();
- String getResource2();
+ String getResource1();
+ String getResource2();
CharSequence getResource3();
}
class CallInterceptor implements MethodInterceptor {
-
+
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
Object retValFromSuper = null;
if (!Modifier.isAbstract(method.getModifiers())) {
retValFromSuper = proxy.invokeSuper(obj, args);
- }
- return retValFromSuper;
+ }
+ return retValFromSuper;
}
}
@@ -191,27 +191,27 @@ class CallInterceptor implements MethodInterceptor {
class FieldTarget implements Target {
@Resource
- private String resource1;
+ private String resource1;
@Resource(name = "resource2")
private String resource2foo;
-
+
@Resource(name = "resource3")
private CharSequence resource3foo;
- public String getResource1() {
- return resource1;
- }
+ public String getResource1() {
+ return resource1;
+ }
- public String getResource2() {
+ public String getResource2() {
return resource2foo;
- }
-
+ }
+
public CharSequence getResource3() {
return resource3foo;
}
- public String toString() {
+ public String toString() {
return "[" + resource1 + ":" + resource2foo + ":" + resource3foo + "]";
}
@@ -221,11 +221,11 @@ class SubFieldTarget extends FieldTarget {
}
class SubSetterTarget extends SetterTarget {
-
+
}
-interface ISetterTarget extends Target {
- void setResource1(String argResource1);
+interface ISetterTarget extends Target {
+ void setResource1(String argResource1);
void setResource2(String argResource2);
void setResource3(CharSequence argResource3);
}
@@ -249,7 +249,7 @@ class ProxyClass implements InvocationHandler {
types[i] = CharSequence.class;
}
}
- }
+ }
Method target = obj.getClass().getMethod(m.getName(), types);
result = target.invoke(obj, args);
} catch (InvocationTargetException e) {
@@ -260,15 +260,15 @@ class ProxyClass implements InvocationHandler {
return result;
}
}
-class SetterTarget implements Target {
+class SetterTarget implements Target {
private String resource1;
private String resource2;
private CharSequence resource3;
- private boolean injectionCompletePublic;
- private boolean injectionCompletePrivate;
- private boolean preDestroy;
- private boolean preDestroyPrivate;
+ private boolean injectionCompletePublic;
+ private boolean injectionCompletePrivate;
+ private boolean preDestroy;
+ private boolean preDestroyPrivate;
public final String getResource1() {
return this.resource1;
@@ -278,56 +278,56 @@ class SetterTarget implements Target {
public final void setResource1(final String argResource1) {
this.resource1 = argResource1;
}
-
+
public final String getResource2() {
return this.resource2;
}
-
+
@Resource(name = "resource2")
public void setResource2(final String argResource2) {
this.resource2 = argResource2;
}
-
+
public final CharSequence getResource3() {
return this.resource3;
}
-
+
@Resource(name = "resource3")
public void setResource3(final CharSequence argResource3) {
this.resource3 = argResource3;
}
@PostConstruct
- public void injectionIsAllFinishedNowThankYouVeryMuch() {
+ public void injectionIsAllFinishedNowThankYouVeryMuch() {
injectionCompletePublic = true;
// stick this here to keep PMD happy...
injectionIsAllFinishedNowThankYouVeryMuchPrivate();
- }
-
+ }
+
@PostConstruct
- private void injectionIsAllFinishedNowThankYouVeryMuchPrivate() {
+ private void injectionIsAllFinishedNowThankYouVeryMuchPrivate() {
injectionCompletePrivate = true;
- }
-
+ }
+
@PreDestroy
- public void preDestroyMethod() {
+ public void preDestroyMethod() {
preDestroy = true;
- }
-
+ }
+
@PreDestroy
- private void preDestroyMethodPrivate() {
+ private void preDestroyMethodPrivate() {
preDestroyPrivate = true;
- }
-
- public boolean injectionCompleteCalled() {
+ }
+
+ public boolean injectionCompleteCalled() {
return injectionCompletePrivate && injectionCompletePublic;
}
- public boolean preDestroyCalled() {
+ public boolean preDestroyCalled() {
return preDestroy && preDestroyPrivate;
}
-
+
// dummy method to access the private methods to avoid compile warnings
public void dummyMethod() {
preDestroyMethodPrivate();
@@ -339,15 +339,15 @@ class SetterTarget implements Target {
@Resource(name = "resource1")
class ClassTarget implements Target {
- @Resource(name = "resource3")
+ @Resource(name = "resource3")
public CharSequence resource3foo;
- @Resource(name = "resource2")
- public String resource2foo;
- private String res1;
+ @Resource(name = "resource2")
+ public String resource2foo;
+ private String res1;
- public final void setResource1(String res) {
- res1 = res;
- }
+ public final void setResource1(String res) {
+ res1 = res;
+ }
public final String getResource1() {
return res1;
@@ -356,7 +356,7 @@ class ClassTarget implements Target {
public final String getResource2() {
return resource2foo;
}
-
+
public final CharSequence getResource3() {
return resource3foo;
}
@@ -364,18 +364,18 @@ class ClassTarget implements Target {
-@Resources({@Resource(name = "resource1"),
+@Resources({@Resource(name = "resource1"),
@Resource(name = "resource2"),
@Resource(name = "resource3") })
class ResourcesContainerTarget implements Target {
- private String res1;
- private String resource2;
+ private String res1;
+ private String resource2;
private CharSequence resource3;
- public final void setResource1(String res) {
- res1 = res;
- }
+ public final void setResource1(String res) {
+ res1 = res;
+ }
public final String getResource1() {
return res1;
@@ -384,7 +384,7 @@ class ResourcesContainerTarget implements Target {
public final String getResource2() {
return resource2;
}
-
+
public final CharSequence getResource3() {
return resource3;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/logging/LogUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/logging/LogUtilsTest.java b/core/src/test/java/org/apache/cxf/common/logging/LogUtilsTest.java
index 10c517f..b900065 100644
--- a/core/src/test/java/org/apache/cxf/common/logging/LogUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/logging/LogUtilsTest.java
@@ -63,7 +63,7 @@ public class LogUtilsTest extends Assert {
EasyMock.verify(handler);
log.removeHandler(handler);
}
-
+
@Test
public void testLogNoParamsOrThrowable() {
Logger log = LogUtils.getL7dLogger(LogUtilsTest.class, null, "testLogNoParamsOrThrowable");
@@ -78,7 +78,7 @@ public class LogUtilsTest extends Assert {
EasyMock.verify(handler);
log.removeHandler(handler);
}
-
+
@Test
public void testLogNoParamsWithThrowable() {
Logger log = LogUtils.getL7dLogger(LogUtilsTest.class, null, "testLogNoParamsWithThrowable");
@@ -138,7 +138,7 @@ public class LogUtilsTest extends Assert {
public void testCXF1420() throws Exception {
Logger log = LogUtils.getL7dLogger(LogUtilsTest.class, null, "testCXF1420");
LogUtils.log(log, Level.SEVERE, "SQLException for SQL [{call FOO.ping(?, ?)}]");
- }
+ }
@Test
public void testClassMethodNames() throws Exception {
Logger log = LogUtils.getL7dLogger(LogUtilsTest.class, null, "testClassMethodNames");
@@ -147,17 +147,17 @@ public class LogUtilsTest extends Assert {
// logger called directly
log.warning("hello");
-
+
String cname = handler.cname;
String mname = handler.mname;
-
+
// logger called through LogUtils
LogUtils.log(log, Level.WARNING, "FOOBAR_MSG");
-
+
assertEquals(cname, handler.cname);
assertEquals(mname, handler.mname);
}
-
+
private static final class TestLogHandler extends Handler {
String cname;
String mname;
@@ -170,9 +170,9 @@ public class LogUtilsTest extends Assert {
public void publish(LogRecord record) {
cname = record.getSourceClassName();
mname = record.getSourceMethodName();
- }
+ }
}
-
+
private static final class LogRecordMatcher implements IArgumentMatcher {
private final LogRecord record;
@@ -187,16 +187,16 @@ public class LogUtilsTest extends Assert {
if (record.getResourceBundle() != null) {
l7dString = record.getResourceBundle().getString(record.getMessage());
}
- return (record.getMessage().equals(other.getMessage())
+ return (record.getMessage().equals(other.getMessage())
|| l7dString.equals(other.getMessage()))
&& record.getLevel().equals(other.getLevel())
&& record.getThrown() == other.getThrown();
}
return false;
- }
+ }
public void appendTo(StringBuffer buffer) {
buffer.append("log records did not match");
}
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/security/SimpleGroupTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/security/SimpleGroupTest.java b/core/src/test/java/org/apache/cxf/common/security/SimpleGroupTest.java
index 16d03de..13ab378 100644
--- a/core/src/test/java/org/apache/cxf/common/security/SimpleGroupTest.java
+++ b/core/src/test/java/org/apache/cxf/common/security/SimpleGroupTest.java
@@ -32,25 +32,25 @@ public class SimpleGroupTest extends Assert {
assertEquals("group", new SimpleGroup("group", "friend").getName());
assertEquals("group", new SimpleGroup("group", new SimplePrincipal("friend")).getName());
}
-
+
@Test
public void testIsMember() {
assertTrue(new SimpleGroup("group", "friend").isMember(new SimplePrincipal("friend")));
assertFalse(new SimpleGroup("group", "friend").isMember(new SimplePrincipal("frogs")));
}
-
+
@Test
public void testAddRemoveMembers() {
-
- Group group = new SimpleGroup("group");
+
+ Group group = new SimpleGroup("group");
assertFalse(group.members().hasMoreElements());
-
+
group.addMember(new SimpleGroup("group", "friend"));
-
+
Enumeration<? extends Principal> members = group.members();
assertEquals(new SimpleGroup("group", "friend"), members.nextElement());
assertFalse(members.hasMoreElements());
-
+
group.removeMember(new SimpleGroup("group", "friend"));
assertFalse(group.members().hasMoreElements());
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/security/SimplePrincipalTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/security/SimplePrincipalTest.java b/core/src/test/java/org/apache/cxf/common/security/SimplePrincipalTest.java
index 5e7a753..ee3c620 100644
--- a/core/src/test/java/org/apache/cxf/common/security/SimplePrincipalTest.java
+++ b/core/src/test/java/org/apache/cxf/common/security/SimplePrincipalTest.java
@@ -28,11 +28,11 @@ public class SimplePrincipalTest extends Assert {
public void testNullName() {
new SimplePrincipal(null);
}
-
+
public void testEquals() {
assertEquals(new SimplePrincipal("barry"), new SimplePrincipal("barry"));
}
-
+
public void testNotEquals() {
assertFalse(new SimplePrincipal("barry").equals(new SimplePrincipal("john")));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/Base64UtilityTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/Base64UtilityTest.java b/core/src/test/java/org/apache/cxf/common/util/Base64UtilityTest.java
index a05ffaf..93adf53 100644
--- a/core/src/test/java/org/apache/cxf/common/util/Base64UtilityTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/Base64UtilityTest.java
@@ -40,7 +40,7 @@ public class Base64UtilityTest extends Assert {
assertEquals(b1[x], b2[x]);
}
}
-
+
@Test
public void testEncodeMultipleChunks() throws Exception {
final String text = "The true sign of intelligence is not knowledge but imagination.";
@@ -48,7 +48,7 @@ public class Base64UtilityTest extends Assert {
// multiple of 3 octets
assertEquals(63, bytes.length);
String s1 = new String(Base64Utility.encodeChunk(bytes, 0, bytes.length));
-
+
StringBuilder sb = new StringBuilder();
int off = 0;
for (; off + 21 < bytes.length; off += 21) {
@@ -60,7 +60,7 @@ public class Base64UtilityTest extends Assert {
String s2 = sb.toString();
assertEquals(s1, s2);
}
-
+
@Test
public void testEncodeAndStream() throws Exception {
final String text = "The true sign of intelligence is not knowledge but imagination.";
@@ -70,14 +70,14 @@ public class Base64UtilityTest extends Assert {
String decodedText = new String(Base64Utility.decode(bos.toString()));
assertEquals(decodedText, text);
}
-
+
@Test
public void testEncodeDecodeChunk() throws Exception {
byte bytes[] = new byte[100];
for (int x = 0; x < bytes.length; x++) {
bytes[x] = (byte)x;
}
-
+
char encodedChars[] = Base64Utility.encodeChunk(bytes, 0, -2);
assertNull(encodedChars);
encodedChars = Base64Utility.encodeChunk(bytes, 0, bytes.length);
@@ -94,7 +94,7 @@ public class Base64UtilityTest extends Assert {
assertNotNull(encodedChars);
bytesDecoded = Base64Utility.decodeChunk(encodedChars, 0, encodedChars.length);
assertEquals(bytes, bytesDecoded);
-
+
//require padding
bytes = new byte[98];
for (int x = 0; x < bytes.length; x++) {
@@ -104,7 +104,7 @@ public class Base64UtilityTest extends Assert {
assertNotNull(encodedChars);
bytesDecoded = Base64Utility.decodeChunk(encodedChars, 0, encodedChars.length);
assertEquals(bytes, bytesDecoded);
-
+
//require padding
bytes = new byte[97];
for (int x = 0; x < bytes.length; x++) {
@@ -114,8 +114,8 @@ public class Base64UtilityTest extends Assert {
assertNotNull(encodedChars);
bytesDecoded = Base64Utility.decodeChunk(encodedChars, 0, encodedChars.length);
assertEquals(bytes, bytesDecoded);
-
-
+
+
bytesDecoded = Base64Utility.decodeChunk(new char[3], 0, 3);
assertNull(bytesDecoded);
}
@@ -155,8 +155,8 @@ public class Base64UtilityTest extends Assert {
encodedString.length(),
bout2);
assertEquals(bytes, bout2.toByteArray());
-
-
+
+
String in = "QWxhZGRpbjpvcGVuIHNlc2FtZQ==";
bout.reset();
bout2.reset();
@@ -166,7 +166,7 @@ public class Base64UtilityTest extends Assert {
StringWriter writer = new StringWriter();
Base64Utility.encode(bytes, 0, bytes.length, writer);
assertEquals(in, writer.toString());
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/CollectionUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/CollectionUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/CollectionUtilsTest.java
index 8c1c1b3..4947573 100644
--- a/core/src/test/java/org/apache/cxf/common/util/CollectionUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/CollectionUtilsTest.java
@@ -28,7 +28,7 @@ import org.junit.Assert;
import org.junit.Test;
public class CollectionUtilsTest extends Assert {
-
+
@Test
public void testDiff() throws Exception {
List<String> l1 = Arrays.asList(new String[]{"1", "2", "3"});
@@ -37,17 +37,17 @@ public class CollectionUtilsTest extends Assert {
assertTrue(l3.size() == 2);
assertTrue(l3.contains("1"));
assertTrue(l3.contains("3"));
-
+
l3 = CollectionUtils.diff(l1, null);
assertTrue(l3.size() == 3);
assertTrue(l3.contains("1"));
assertTrue(l3.contains("2"));
assertTrue(l3.contains("3"));
-
+
l3 = CollectionUtils.diff(null, null);
- assertNull(l3);
+ assertNull(l3);
}
-
+
@Test
public void testIsEmpty() throws Exception {
List<String> l = Arrays.asList(new String[]{null, null});
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
index 03ad66d..fb8f279 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
@@ -31,66 +31,66 @@ import org.junit.Test;
public class PackageUtilsTest extends Assert {
@Test
public void testGetClassPackageName() throws Exception {
- String packageName = PackageUtils.getPackageName(this.getClass());
+ String packageName = PackageUtils.getPackageName(this.getClass());
assertEquals("Should get same packageName", this.getClass().getPackage().getName(), packageName);
}
-
+
@Test
public void testGetEmptyPackageName() throws Exception {
String className = "HelloWorld";
assertEquals("Should return empty string", "", PackageUtils.getPackageName(className));
}
-
+
@Test
public void testSharedPackageNameSingleClass() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Collections.singletonList(this.getClass()));
+ Collections.singletonList(this.getClass()));
assertEquals(this.getClass().getPackage().getName(), packageName);
}
@Test
public void testSharedPackageNameManyClassesInSamePackage() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(Integer.class, Number.class));
+ Arrays.asList(Integer.class, Number.class));
assertEquals("java.lang", packageName);
}
@Test
public void testSharedPackageNameManyClassesInDiffPackages() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(Integer.class, this.getClass()));
+ Arrays.asList(Integer.class, this.getClass()));
assertEquals("", packageName);
}
@Test
public void testSharedPackageNameManyClassesCommonRoot() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(Integer.class, Annotation.class));
+ Arrays.asList(Integer.class, Annotation.class));
assertEquals("java.lang", packageName);
}
@Test
public void testSharedPackageNameManyClassesCommonRoot2() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(Annotation.class, Integer.class));
+ Arrays.asList(Annotation.class, Integer.class));
assertEquals("java.lang", packageName);
}
@Test
public void testSharedPackageNameManyClassesCommonRoot3() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(Annotation.class, Array.class));
+ Arrays.asList(Annotation.class, Array.class));
assertEquals("java.lang", packageName);
}
@Test
public void testSharedPackageNameManyClassesCommonRoot4() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(org.apache.cxf.common.util.PackageUtils.class,
+ Arrays.asList(org.apache.cxf.common.util.PackageUtils.class,
org.apache.cxf.bus.CXFBusFactory.class,
- org.apache.cxf.common.jaxb.JAXBContextCache.class));
+ org.apache.cxf.common.jaxb.JAXBContextCache.class));
assertEquals("org.apache.cxf", packageName);
}
@Test
public void testSharedPackageNameManyClassesCommonRoot5() throws Exception {
String packageName = PackageUtils.getSharedPackageName(
- Arrays.asList(java.lang.annotation.Annotation.class,
+ Arrays.asList(java.lang.annotation.Annotation.class,
org.apache.cxf.bus.CXFBusFactory.class,
- org.apache.cxf.common.jaxb.JAXBContextCache.class));
+ org.apache.cxf.common.jaxb.JAXBContextCache.class));
assertEquals("", packageName);
}
@Test
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/PropertiesLoaderUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/PropertiesLoaderUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PropertiesLoaderUtilsTest.java
index 53de031..6f356df 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PropertiesLoaderUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PropertiesLoaderUtilsTest.java
@@ -29,14 +29,14 @@ public class PropertiesLoaderUtilsTest extends Assert {
Properties properties;
String soapBindingFactory = "org.apache.cxf.bindings.soap.SOAPBindingFactory";
-
+
@Before
public void setUp() throws Exception {
properties = PropertiesLoaderUtils.
loadAllProperties("org/apache/cxf/common/util/resources/bindings.properties.xml",
Thread.currentThread().getContextClassLoader());
- assertNotNull(properties);
-
+ assertNotNull(properties);
+
}
@Test
public void testLoadBindings() throws Exception {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/PropertyUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/PropertyUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PropertyUtilsTest.java
index f7dbd0a..ea4e30b 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PropertyUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PropertyUtilsTest.java
@@ -27,50 +27,50 @@ import org.junit.Test;
public class PropertyUtilsTest extends Assert {
private static final String TEST_KEY = "my.key";
-
+
@Test
public void testIsTrueWithMap() {
Map<String, Object> props = new HashMap<String, Object>();
assertFalse(PropertyUtils.isTrue(props, TEST_KEY));
-
+
props.put(TEST_KEY, "false");
assertFalse(PropertyUtils.isTrue(props, TEST_KEY));
-
+
props.put(TEST_KEY, Boolean.FALSE);
assertFalse(PropertyUtils.isTrue(props, TEST_KEY));
-
+
props.put(TEST_KEY, "true");
assertTrue(PropertyUtils.isTrue(props, TEST_KEY));
-
+
props.put(TEST_KEY, Boolean.TRUE);
assertTrue(PropertyUtils.isTrue(props, TEST_KEY));
}
-
+
@Test
public void testIsFalseWithMap() {
Map<String, Object> props = new HashMap<String, Object>();
assertFalse(PropertyUtils.isFalse(props, TEST_KEY));
-
+
props.put(TEST_KEY, "true");
assertFalse(PropertyUtils.isFalse(props, TEST_KEY));
-
+
props.put(TEST_KEY, Boolean.TRUE);
assertFalse(PropertyUtils.isFalse(props, TEST_KEY));
-
+
props.put(TEST_KEY, "false");
assertTrue(PropertyUtils.isFalse(props, TEST_KEY));
-
+
props.put(TEST_KEY, Boolean.FALSE);
assertTrue(PropertyUtils.isFalse(props, TEST_KEY));
}
-
+
@Test
public void testTrue() {
assertTrue(PropertyUtils.isTrue(Boolean.TRUE));
assertTrue(PropertyUtils.isTrue("true"));
assertTrue(PropertyUtils.isTrue("TRUE"));
assertTrue(PropertyUtils.isTrue("TrUe"));
-
+
assertFalse(PropertyUtils.isTrue(Boolean.FALSE));
assertFalse(PropertyUtils.isTrue("false"));
assertFalse(PropertyUtils.isTrue("FALSE"));
@@ -86,7 +86,7 @@ public class PropertyUtilsTest extends Assert {
assertTrue(PropertyUtils.isFalse("false"));
assertTrue(PropertyUtils.isFalse("FALSE"));
assertTrue(PropertyUtils.isFalse("FaLSE"));
-
+
assertFalse(PropertyUtils.isFalse(Boolean.TRUE));
assertFalse(PropertyUtils.isFalse("true"));
assertFalse(PropertyUtils.isFalse("TRUE"));
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
index 7480135..a346e96 100644
--- a/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
@@ -25,7 +25,7 @@ import org.junit.Assert;
import org.junit.Test;
public class StringUtilsTest extends Assert {
-
+
@Test
public void testDiff() throws Exception {
String str1 = "http://local/SoapContext/SoapPort/greetMe/me/CXF";
@@ -35,13 +35,13 @@ public class StringUtilsTest extends Assert {
assertEquals("greetMe/me/CXF", StringUtils.diff(str1, str3));
assertEquals("http://local/SoapContext/SoapPort/", StringUtils.diff(str3, str1));
}
-
+
@Test
- public void testGetFirstNotEmpty() throws Exception {
+ public void testGetFirstNotEmpty() throws Exception {
assertEquals("greetMe", StringUtils.getFirstNotEmpty("/greetMe/me/CXF", "/"));
assertEquals("greetMe", StringUtils.getFirstNotEmpty("greetMe/me/CXF", "/"));
}
-
+
@Test
public void testGetParts() throws Exception {
String str = "/greetMe/me/CXF";
@@ -51,7 +51,7 @@ public class StringUtilsTest extends Assert {
assertEquals("me", parts.get(1));
assertEquals("CXF", parts.get(2));
}
-
+
@Test
public void testGetPartsWithSingleSpace() throws Exception {
String str = "a b";
@@ -60,7 +60,7 @@ public class StringUtilsTest extends Assert {
assertEquals("a", parts.get(0));
assertEquals("b", parts.get(1));
}
-
+
@Test
public void testGetPartsWithManySpaces() throws Exception {
String str = "a b";
@@ -69,7 +69,7 @@ public class StringUtilsTest extends Assert {
assertEquals("a", parts.get(0));
assertEquals("b", parts.get(1));
}
-
+
@Test
public void testSplitWithDot() throws Exception {
String str = "a.b.c";
@@ -79,11 +79,11 @@ public class StringUtilsTest extends Assert {
assertEquals("b", parts[1]);
assertEquals("c", parts[2]);
}
-
+
@Test
public void testGetFound() throws Exception {
String regex = "velocity-\\d+\\.\\d+\\.jar";
-
+
assertTrue(StringUtils.isEmpty(StringUtils.getFound("velocity-dep-1.4.jar", regex)));
assertFalse(StringUtils.isEmpty(StringUtils.getFound("velocity-1.4.jar", regex)));
assertTrue(StringUtils.isEmpty(StringUtils.getFound(null, regex)));
@@ -95,8 +95,8 @@ public class StringUtilsTest extends Assert {
assertEquals("http://localhost:80/", StringUtils.addDefaultPortIfMissing("http://localhost/"));
assertEquals("http://localhost:80/abc", StringUtils.addDefaultPortIfMissing("http://localhost/abc"));
assertEquals("http://localhost:80", StringUtils.addDefaultPortIfMissing("http://localhost:80"));
-
- assertEquals("http://localhost:9090",
+
+ assertEquals("http://localhost:9090",
StringUtils.addDefaultPortIfMissing("http://localhost", "9090"));
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/URIParserUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/URIParserUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/URIParserUtilsTest.java
index 2d92315..adf3f23 100644
--- a/core/src/test/java/org/apache/cxf/common/util/URIParserUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/URIParserUtilsTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class URIParserUtilsTest extends Assert {
-
+
@Test
public void testRelativize() throws URISyntaxException {
assertNull(URIParserUtil.relativize(null, "foo"));
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/UrlUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/UrlUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/UrlUtilsTest.java
index 7ae4015..ff409de 100644
--- a/core/src/test/java/org/apache/cxf/common/util/UrlUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/UrlUtilsTest.java
@@ -24,19 +24,19 @@ import org.junit.Test;
public class UrlUtilsTest extends Assert {
-
+
@Test
public void testUrlDecode() {
assertEquals("+ ", UrlUtils.urlDecode("%2B+"));
}
-
+
@Test
public void testUrlDecodeSingleCharMultipleEscapes() {
String s = "�";
String encoded = UrlUtils.urlEncode(s);
assertEquals(s, UrlUtils.urlDecode(encoded));
}
-
+
@Test
public void testUrlDecodeReserved() {
assertEquals("!$&'()*,;=", UrlUtils.urlDecode("!$&'()*,;="));
@@ -88,7 +88,7 @@ public class UrlUtilsTest extends Assert {
assertTrue(e.getMessage().startsWith("Invalid URL encoding"));
}
}
-
+
@Test
public void testPathDecode() {
assertEquals("+++", UrlUtils.pathDecode("+%2B+"));
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/util/XmlSchemaPrimitiveUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/XmlSchemaPrimitiveUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/XmlSchemaPrimitiveUtilsTest.java
index 5c5ea3e..a3ea8ab 100644
--- a/core/src/test/java/org/apache/cxf/common/util/XmlSchemaPrimitiveUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/XmlSchemaPrimitiveUtilsTest.java
@@ -28,11 +28,11 @@ public class XmlSchemaPrimitiveUtilsTest extends Assert {
assertEquals("xs:int", XmlSchemaPrimitiveUtils.getSchemaRepresentation(Integer.class));
assertEquals("xs:int", XmlSchemaPrimitiveUtils.getSchemaRepresentation(int.class));
}
-
+
@Test
public void testXsdRepresentation() {
assertEquals("xsd:int", XmlSchemaPrimitiveUtils.getSchemaRepresentation(Integer.class, "xsd"));
assertEquals("xsd:int", XmlSchemaPrimitiveUtils.getSchemaRepresentation(int.class, "xsd"));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/xmlschema/DOMErrorException.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/xmlschema/DOMErrorException.java b/core/src/test/java/org/apache/cxf/common/xmlschema/DOMErrorException.java
index ba79117..1db9188 100644
--- a/core/src/test/java/org/apache/cxf/common/xmlschema/DOMErrorException.java
+++ b/core/src/test/java/org/apache/cxf/common/xmlschema/DOMErrorException.java
@@ -22,12 +22,12 @@ package org.apache.cxf.common.xmlschema;
import org.w3c.dom.DOMError;
/**
- *
+ *
*/
public class DOMErrorException extends RuntimeException {
private static final long serialVersionUID = -4350285749042450625L;
private DOMError error;
-
+
public DOMErrorException(DOMError error) {
this.error = error;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/xmlschema/DOMLSInput.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/xmlschema/DOMLSInput.java b/core/src/test/java/org/apache/cxf/common/xmlschema/DOMLSInput.java
index 231cea9..4aab56c 100644
--- a/core/src/test/java/org/apache/cxf/common/xmlschema/DOMLSInput.java
+++ b/core/src/test/java/org/apache/cxf/common/xmlschema/DOMLSInput.java
@@ -32,18 +32,18 @@ import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.staxutils.StaxUtils;
/**
- *
+ *
*/
class DOMLSInput implements LSInput {
private static final Logger LOG = LogUtils.getL7dLogger(DOMLSInput.class);
private String systemId;
private String data;
-
+
DOMLSInput(Document doc, String systemId) throws TransformerException {
this.systemId = systemId;
data = StaxUtils.toString(doc);
LOG.fine(systemId + ": " + data);
-
+
}
/** {@inheritDoc}*/
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/xmlschema/ImportRepairTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/xmlschema/ImportRepairTest.java b/core/src/test/java/org/apache/cxf/common/xmlschema/ImportRepairTest.java
index d00abfe..028208f 100644
--- a/core/src/test/java/org/apache/cxf/common/xmlschema/ImportRepairTest.java
+++ b/core/src/test/java/org/apache/cxf/common/xmlschema/ImportRepairTest.java
@@ -135,7 +135,7 @@ public class ImportRepairTest extends Assert {
collection.addCrossImports();
tryToParseSchemas();
}
-
+
Method findMethod(Object o, String name) {
for (Method m: o.getClass().getMethods()) {
if (m.getName() == name) {
@@ -164,18 +164,18 @@ public class ImportRepairTest extends Assert {
DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
DOMImplementation impl = registry.getDOMImplementation("XS-Loader");
-
+
try {
Object schemaLoader = findMethod(impl, "createXSLoader").invoke(impl, new Object[1]);
DOMConfiguration config = (DOMConfiguration)findMethod(schemaLoader, "getConfig").invoke(schemaLoader);
-
+
config.setParameter("validate", Boolean.TRUE);
try {
- //bug in the JDK doesn't set this, but accesses it
+ //bug in the JDK doesn't set this, but accesses it
config.setParameter("http://www.oracle.com/xml/jaxp/properties/xmlSecurityPropertyManager",
Class.forName("com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager")
.newInstance());
-
+
config.setParameter("http://apache.org/xml/properties/security-manager",
Class.forName("com.sun.org.apache.xerces.internal.utils.XMLSecurityManager")
.newInstance());
@@ -183,7 +183,7 @@ public class ImportRepairTest extends Assert {
//ignore
}
config.setParameter("error-handler", new DOMErrorHandler() {
-
+
public boolean handleError(DOMError error) {
LOG.info("Schema parsing error: " + error.getMessage()
+ " " + error.getType()
@@ -194,20 +194,20 @@ public class ImportRepairTest extends Assert {
}
});
config.setParameter("resource-resolver", new LSResourceResolver() {
-
+
public LSInput resolveResource(String type, String namespaceURI, String publicId,
String systemId, String baseURI) {
return resolverMap.get(namespaceURI);
}
});
-
+
Method m = findMethod(schemaLoader, "loadInputList");
String name = m.getParameterTypes()[0].getName() + "Impl";
name = name.replace("xs.LS", "impl.xs.util.LS");
Class<?> c = Class.forName(name);
Object inputList = c.getConstructor(LSInput[].class, Integer.TYPE)
.newInstance(inputs.toArray(new LSInput[inputs.size()]), inputs.size());
-
+
findMethod(schemaLoader, "loadInputList").invoke(schemaLoader, inputList);
} catch (InvocationTargetException ite) {
throw (Exception)ite.getTargetException();
@@ -218,7 +218,7 @@ public class ImportRepairTest extends Assert {
if (!dumpSchemas) {
return;
}
-
+
XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(System.err);
xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2);
StaxUtils.copy(new DOMSource(document), xwriter);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/configuration/foo/Address.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/foo/Address.java b/core/src/test/java/org/apache/cxf/configuration/foo/Address.java
index 6bf5fde..07c9dc0 100644
--- a/core/src/test/java/org/apache/cxf/configuration/foo/Address.java
+++ b/core/src/test/java/org/apache/cxf/configuration/foo/Address.java
@@ -28,9 +28,9 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for address complex type.
- *
+ *
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* <complexType name="address">
* <complexContent>
@@ -45,8 +45,8 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "address",
@@ -67,11 +67,11 @@ public class Address {
/**
* Gets the value of the city property.
- *
+ *
* @return
* possible object is
* {@link String }
- *
+ *
*/
public String getCity() {
return city;
@@ -79,11 +79,11 @@ public class Address {
/**
* Sets the value of the city property.
- *
+ *
* @param value
* allowed object is
* {@link String }
- *
+ *
*/
public void setCity(String value) {
this.city = value;
@@ -91,7 +91,7 @@ public class Address {
/**
* Gets the value of the zip property.
- *
+ *
*/
public int getZip() {
return zip;
@@ -99,7 +99,7 @@ public class Address {
/**
* Sets the value of the zip property.
- *
+ *
*/
public void setZip(int value) {
this.zip = value;
@@ -107,11 +107,11 @@ public class Address {
/**
* Gets the value of the street property.
- *
+ *
* @return
* possible object is
* {@link String }
- *
+ *
*/
public String getStreet() {
return street;
@@ -119,11 +119,11 @@ public class Address {
/**
* Sets the value of the street property.
- *
+ *
* @param value
* allowed object is
* {@link String }
- *
+ *
*/
public void setStreet(String value) {
this.street = value;
@@ -131,11 +131,11 @@ public class Address {
/**
* Gets the value of the nr property.
- *
+ *
* @return
* possible object is
* {@link Integer }
- *
+ *
*/
public Integer getNr() {
return nr;
@@ -143,11 +143,11 @@ public class Address {
/**
* Sets the value of the nr property.
- *
+ *
* @param value
* allowed object is
* {@link Integer }
- *
+ *
*/
public void setNr(Integer value) {
this.nr = value;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/configuration/foo/Foo.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/foo/Foo.java b/core/src/test/java/org/apache/cxf/configuration/foo/Foo.java
index 03c1e74..33d93e9 100644
--- a/core/src/test/java/org/apache/cxf/configuration/foo/Foo.java
+++ b/core/src/test/java/org/apache/cxf/configuration/foo/Foo.java
@@ -26,9 +26,9 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for foo complex type.
- *
+ *
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* <complexType name="foo">
* <complexContent>
@@ -44,8 +44,8 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "foo",
@@ -67,11 +67,11 @@ public class Foo {
/**
* Gets the value of the position property.
- *
+ *
* @return
* possible object is
* {@link Point }
- *
+ *
*/
public Point getPosition() {
return position;
@@ -79,11 +79,11 @@ public class Foo {
/**
* Sets the value of the position property.
- *
+ *
* @param value
* allowed object is
* {@link Point }
- *
+ *
*/
public void setPosition(Point value) {
this.position = value;
@@ -91,11 +91,11 @@ public class Foo {
/**
* Gets the value of the address property.
- *
+ *
* @return
* possible object is
* {@link Address }
- *
+ *
*/
public Address getAddress() {
return address;
@@ -103,11 +103,11 @@ public class Foo {
/**
* Sets the value of the address property.
- *
+ *
* @param value
* allowed object is
* {@link Address }
- *
+ *
*/
public void setAddress(Address value) {
this.address = value;
@@ -115,11 +115,11 @@ public class Foo {
/**
* Gets the value of the name property.
- *
+ *
* @return
* possible object is
* {@link String }
- *
+ *
*/
public String getName() {
return name;
@@ -127,11 +127,11 @@ public class Foo {
/**
* Sets the value of the name property.
- *
+ *
* @param value
* allowed object is
* {@link String }
- *
+ *
*/
public void setName(String value) {
this.name = value;
@@ -139,11 +139,11 @@ public class Foo {
/**
* Gets the value of the intDefault property.
- *
+ *
* @return
* possible object is
* {@link Integer }
- *
+ *
*/
public Integer getIntDefault() {
return intDefault;
@@ -151,11 +151,11 @@ public class Foo {
/**
* Sets the value of the intDefault property.
- *
+ *
* @param value
* allowed object is
* {@link Integer }
- *
+ *
*/
public void setIntDefault(Integer value) {
this.intDefault = value;
@@ -163,11 +163,11 @@ public class Foo {
/**
* Gets the value of the intNoDefault property.
- *
+ *
* @return
* possible object is
* {@link Integer }
- *
+ *
*/
public Integer getIntNoDefault() {
return intNoDefault;
@@ -175,11 +175,11 @@ public class Foo {
/**
* Sets the value of the intNoDefault property.
- *
+ *
* @param value
* allowed object is
* {@link Integer }
- *
+ *
*/
public void setIntNoDefault(Integer value) {
this.intNoDefault = value;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java b/core/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
index 8abc089..24321d0 100644
--- a/core/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
+++ b/core/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
@@ -26,18 +26,18 @@ import javax.xml.namespace.QName;
/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.apache.cxf.configuration.foo package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.apache.cxf.configuration.foo package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
* provided in this class.
- *
+ *
*/
@XmlRegistry
public class ObjectFactory {
@@ -52,14 +52,14 @@ public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived
* classes for package: org.apache.cxf.configuration.foo
- *
+ *
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link Address }
- *
+ *
*/
public Address createAddress() {
return new Address();
@@ -67,7 +67,7 @@ public class ObjectFactory {
/**
* Create an instance of {@link Foo }
- *
+ *
*/
public Foo createFoo() {
return new Foo();
@@ -75,7 +75,7 @@ public class ObjectFactory {
/**
* Create an instance of {@link Point }
- *
+ *
*/
public Point createPoint() {
return new Point();
@@ -83,7 +83,7 @@ public class ObjectFactory {
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Point }{@code >}}
- *
+ *
*/
@XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "point")
public JAXBElement<Point> createPoint(Point value) {
@@ -92,7 +92,7 @@ public class ObjectFactory {
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Address }{@code >}}
- *
+ *
*/
@XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "address")
public JAXBElement<Address> createAddress(Address value) {
@@ -101,7 +101,7 @@ public class ObjectFactory {
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Foo }{@code >}}
- *
+ *
*/
@XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "foo")
public JAXBElement<Foo> createFoo(Foo value) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/configuration/foo/Point.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/foo/Point.java b/core/src/test/java/org/apache/cxf/configuration/foo/Point.java
index 8a505f9..36b08f0 100644
--- a/core/src/test/java/org/apache/cxf/configuration/foo/Point.java
+++ b/core/src/test/java/org/apache/cxf/configuration/foo/Point.java
@@ -26,9 +26,9 @@ import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for point complex type.
- *
+ *
* <p>The following schema fragment specifies the expected content contained within this class.
- *
+ *
* <pre>
* <complexType name="point">
* <complexContent>
@@ -41,8 +41,8 @@ import javax.xml.bind.annotation.XmlType;
* </complexContent>
* </complexType>
* </pre>
- *
- *
+ *
+ *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "point",
@@ -57,7 +57,7 @@ public class Point {
/**
* Gets the value of the x property.
- *
+ *
*/
public int getX() {
return x;
@@ -65,7 +65,7 @@ public class Point {
/**
* Sets the value of the x property.
- *
+ *
*/
public void setX(int value) {
this.x = value;
@@ -73,7 +73,7 @@ public class Point {
/**
* Gets the value of the y property.
- *
+ *
*/
public int getY() {
return y;
@@ -81,7 +81,7 @@ public class Point {
/**
* Sets the value of the y property.
- *
+ *
*/
public void setY(int value) {
this.y = value;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java b/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
index 6abcbf4..49dac5f 100644
--- a/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
+++ b/core/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
@@ -41,7 +41,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
public class ConfigurerImplTest extends Assert {
-
+
static {
Class<?> cls;
try {
@@ -57,40 +57,40 @@ public class ConfigurerImplTest extends Assert {
//ignore;
}
}
-
+
@Test
public void testConfigureSimpleNoMatchingBean() {
SimpleBean sb = new SimpleBean("unknown");
-
- BusApplicationContext ac =
+
+ BusApplicationContext ac =
new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
false);
ConfigurerImpl configurer = new ConfigurerImpl(ac);
configurer.configureBean(sb);
- assertEquals("Unexpected value for attribute stringAttr",
+ assertEquals("Unexpected value for attribute stringAttr",
"hello", sb.getStringAttr());
- assertTrue("Unexpected value for attribute booleanAttr",
+ assertTrue("Unexpected value for attribute booleanAttr",
sb.getBooleanAttr());
- assertEquals("Unexpected value for attribute integerAttr",
+ assertEquals("Unexpected value for attribute integerAttr",
BigInteger.ONE, sb.getIntegerAttr());
- assertEquals("Unexpected value for attribute intAttr",
+ assertEquals("Unexpected value for attribute intAttr",
Integer.valueOf(2), sb.getIntAttr());
- assertEquals("Unexpected value for attribute longAttr",
+ assertEquals("Unexpected value for attribute longAttr",
Long.valueOf(3L), sb.getLongAttr());
- assertEquals("Unexpected value for attribute shortAttr",
+ assertEquals("Unexpected value for attribute shortAttr",
Short.valueOf((short)4), sb.getShortAttr());
- assertEquals("Unexpected value for attribute decimalAttr",
+ assertEquals("Unexpected value for attribute decimalAttr",
new BigDecimal("5"), sb.getDecimalAttr());
- assertEquals("Unexpected value for attribute floatAttr",
+ assertEquals("Unexpected value for attribute floatAttr",
new Float(6F), sb.getFloatAttr());
- assertEquals("Unexpected value for attribute doubleAttr",
+ assertEquals("Unexpected value for attribute doubleAttr",
Double.valueOf(7.0D), sb.getDoubleAttr());
- assertEquals("Unexpected value for attribute byteAttr",
+ assertEquals("Unexpected value for attribute byteAttr",
Byte.valueOf((byte)8), sb.getByteAttr());
-
+
QName qn = sb.getQnameAttr();
- assertEquals("Unexpected value for attribute qnameAttrNoDefault",
+ assertEquals("Unexpected value for attribute qnameAttrNoDefault",
"schema", qn.getLocalPart());
assertEquals("Unexpected value for attribute qnameAttrNoDefault",
"http://www.w3.org/2001/XMLSchema", qn.getNamespaceURI());
@@ -106,100 +106,100 @@ public class ConfigurerImplTest extends Assert {
for (int i = 0; i < expected.length; i++) {
assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected[i], val[i]);
}
-
- assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
+
+ assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
Long.valueOf(9L), sb.getUnsignedIntAttr());
- assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
+ assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
Integer.valueOf(10), sb.getUnsignedShortAttr());
- assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
+ assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
Short.valueOf((short)11), sb.getUnsignedByteAttr());
}
-
+
@Test
public void testConfigureSimple() {
- // Try to configure the bean with id
+ // Try to configure the bean with id
verifyConfigureSimple("simple");
// Try to configure the bean with an alias name
verifyConfigureSimple("simpleValueBean");
}
-
-
+
+
public void verifyConfigureSimple(String beanName) {
-
+
SimpleBean sb = new SimpleBean(beanName);
- BusApplicationContext ac =
+ BusApplicationContext ac =
new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
false);
ConfigurerImpl configurer = new ConfigurerImpl();
configurer.setApplicationContext(ac);
-
+
configurer.configureBean(sb);
- assertEquals("Unexpected value for attribute stringAttr",
+ assertEquals("Unexpected value for attribute stringAttr",
"hallo", sb.getStringAttr());
- assertTrue("Unexpected value for attribute booleanAttr",
+ assertTrue("Unexpected value for attribute booleanAttr",
!sb.getBooleanAttr());
- assertEquals("Unexpected value for attribute integerAttr",
+ assertEquals("Unexpected value for attribute integerAttr",
BigInteger.TEN, sb.getIntegerAttr());
- assertEquals("Unexpected value for attribute intAttr",
+ assertEquals("Unexpected value for attribute intAttr",
Integer.valueOf(12), sb.getIntAttr());
- assertEquals("Unexpected value for attribute longAttr",
+ assertEquals("Unexpected value for attribute longAttr",
Long.valueOf(13L), sb.getLongAttr());
- assertEquals("Unexpected value for attribute shortAttr",
+ assertEquals("Unexpected value for attribute shortAttr",
Short.valueOf((short)14), sb.getShortAttr());
- assertEquals("Unexpected value for attribute decimalAttr",
+ assertEquals("Unexpected value for attribute decimalAttr",
new BigDecimal("15"), sb.getDecimalAttr());
- assertEquals("Unexpected value for attribute floatAttr",
+ assertEquals("Unexpected value for attribute floatAttr",
new Float(16F), sb.getFloatAttr());
- assertEquals("Unexpected value for attribute doubleAttr",
+ assertEquals("Unexpected value for attribute doubleAttr",
Double.valueOf(17D), sb.getDoubleAttr());
- assertEquals("Unexpected value for attribute byteAttr",
+ assertEquals("Unexpected value for attribute byteAttr",
Byte.valueOf((byte)18), sb.getByteAttr());
-
- assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
+
+ assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
Long.valueOf(19L), sb.getUnsignedIntAttr());
- assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
+ assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
Integer.valueOf(20), sb.getUnsignedShortAttr());
- assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
+ assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
Short.valueOf((short)21), sb.getUnsignedByteAttr());
}
-
+
@Test
public void testConfigureSimpleMatchingStarBeanId() {
SimpleBean sb = new SimpleBean("simple2");
- BusApplicationContext ac =
+ BusApplicationContext ac =
new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
false);
ConfigurerImpl configurer = new ConfigurerImpl();
configurer.setApplicationContext(ac);
configurer.configureBean(sb);
- assertTrue("Unexpected value for attribute booleanAttr",
+ assertTrue("Unexpected value for attribute booleanAttr",
!sb.getBooleanAttr());
- assertEquals("Unexpected value for attribute integerAttr",
+ assertEquals("Unexpected value for attribute integerAttr",
BigInteger.TEN, sb.getIntegerAttr());
- assertEquals("Unexpected value for attribute stringAttr",
+ assertEquals("Unexpected value for attribute stringAttr",
"StarHallo", sb.getStringAttr());
}
-
+
@Test
public void testConfigureSimpleMatchingStarBeanIdWithChildInstance() {
SimpleBean sb = new ChildBean("simple2");
- BusApplicationContext ac =
+ BusApplicationContext ac =
new BusApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml",
false);
ConfigurerImpl configurer = new ConfigurerImpl();
configurer.setApplicationContext(ac);
configurer.configureBean(sb);
- assertTrue("Unexpected value for attribute booleanAttr",
+ assertTrue("Unexpected value for attribute booleanAttr",
!sb.getBooleanAttr());
- assertEquals("Unexpected value for attribute integerAttr",
+ assertEquals("Unexpected value for attribute integerAttr",
BigInteger.TEN, sb.getIntegerAttr());
- assertEquals("Unexpected value for attribute stringAttr",
+ assertEquals("Unexpected value for attribute stringAttr",
"StarHallo", sb.getStringAttr());
}
-
+
@Test
public void testGetBeanName() {
ConfigurerImpl configurer = new ConfigurerImpl();
@@ -216,12 +216,12 @@ public class ConfigurerImplTest extends Assert {
return "b";
}
}
- beanInstance = new NamedBean();
+ beanInstance = new NamedBean();
assertEquals("b", configurer.getBeanName(beanInstance));
beanInstance = this;
assertNull(configurer.getBeanName(beanInstance));
}
-
+
@Test
public void testAddApplicationContext() {
ConfigurableApplicationContext context1 =
@@ -230,7 +230,7 @@ public class ConfigurerImplTest extends Assert {
configurer.setApplicationContext(context1);
// Just to simulate the OSGi's uninstall command
context1.close();
-
+
ConfigurableApplicationContext context2 =
new ClassPathXmlApplicationContext("/org/apache/cxf/configuration/spring/test-beans.xml");
configurer.addApplicationContext(context2);
@@ -238,11 +238,11 @@ public class ConfigurerImplTest extends Assert {
assertEquals("The Context's size is wrong", 1, contexts.size());
assertTrue("The conetxts' contains a wrong application context", contexts.contains(context2));
}
-
+
class SimpleBean implements Configurable {
-
+
private String beanName;
-
+
private String stringAttr = "hello";
private Boolean booleanAttr = Boolean.TRUE;
private BigInteger integerAttr = BigInteger.ONE;
@@ -259,12 +259,12 @@ public class ConfigurerImplTest extends Assert {
private Long unsignedIntAttr = Long.valueOf(9);
private Integer unsignedShortAttr = Integer.valueOf(10);
private Short unsignedByteAttr = Short.valueOf((short)11);
-
-
+
+
SimpleBean(String bn) {
beanName = bn;
}
-
+
public String getBeanName() {
return beanName;
}
@@ -399,14 +399,14 @@ public class ConfigurerImplTest extends Assert {
public void setBeanName(String beanName) {
this.beanName = beanName;
- }
+ }
}
-
+
class ChildBean extends SimpleBean {
ChildBean(String bn) {
super(bn);
}
-
+
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/continuations/SuspendedInvocationExceptionTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/continuations/SuspendedInvocationExceptionTest.java b/core/src/test/java/org/apache/cxf/continuations/SuspendedInvocationExceptionTest.java
index 2be4854..273e715 100644
--- a/core/src/test/java/org/apache/cxf/continuations/SuspendedInvocationExceptionTest.java
+++ b/core/src/test/java/org/apache/cxf/continuations/SuspendedInvocationExceptionTest.java
@@ -25,25 +25,25 @@ import org.junit.Test;
public class SuspendedInvocationExceptionTest extends Assert {
-
+
@Test
public void testValidRuntimeException() {
-
+
Throwable t = new UncheckedException(new Throwable());
SuspendedInvocationException ex = new SuspendedInvocationException(t);
-
+
assertSame(t, ex.getRuntimeException());
assertSame(t, ex.getCause());
-
+
}
-
+
@Test
public void testNoRuntimeException() {
-
+
SuspendedInvocationException ex = new SuspendedInvocationException(
new Throwable());
-
+
assertNull(ex.getRuntimeException());
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java b/core/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
index 0eaeb7b..61f797f 100644
--- a/core/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
+++ b/core/src/test/java/org/apache/cxf/databinding/AbstractDataBindingTest.java
@@ -26,7 +26,7 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class AbstractDataBindingTest extends Assert {
@Test(expected = IllegalArgumentException.class)
@@ -36,7 +36,7 @@ public class AbstractDataBindingTest extends Assert {
testMap.put("urn:high.temperature", "ht");
AbstractDataBinding.checkNamespaceMap(testMap);
}
-
+
@Test
public void testNamespaceMapOK() {
Map<String, String> testMap = new HashMap<String, String>();
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java b/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
index 942d2e8..6210a06 100755
--- a/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
+++ b/core/src/test/java/org/apache/cxf/databinding/source/XMLStreamDataReaderTest.java
@@ -34,36 +34,36 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class XMLStreamDataReaderTest extends Assert {
private static final byte[] DUMMY_DATA = "<ns:dummy xmlns:ns='http://www.apache.org/cxf'/>".getBytes();
-
+
@Test
public void testCloseOriginalInputStream() throws Exception {
XMLStreamDataReader reader = new XMLStreamDataReader();
Message msg = new MessageImpl();
-
+
TestInputStream in1 = new TestInputStream(DUMMY_DATA);
-
+
msg.setContent(InputStream.class, in1);
-
+
reader.setProperty(Message.class.getName(), msg);
-
- Object obj = reader.read(new QName("http://www.apache.org/cxf", "dummy"),
+
+ Object obj = reader.read(new QName("http://www.apache.org/cxf", "dummy"),
StaxUtils.createXMLStreamReader(in1), XMLStreamReader.class);
assertTrue(obj instanceof XMLStreamReader);
-
+
assertFalse(in1.isClosed());
((XMLStreamReader)obj).close();
-
+
assertTrue(in1.isClosed());
}
-
+
private static class TestInputStream extends ByteArrayInputStream {
private boolean closed;
-
+
TestInputStream(byte[] buf) {
super(buf);
}
@@ -73,7 +73,7 @@ public class XMLStreamDataReaderTest extends Assert {
closed = true;
super.close();
}
-
+
public boolean isClosed() {
return closed;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/endpoint/DummyServer.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/endpoint/DummyServer.java b/core/src/test/java/org/apache/cxf/endpoint/DummyServer.java
index 3e4079a..1c44ab8 100644
--- a/core/src/test/java/org/apache/cxf/endpoint/DummyServer.java
+++ b/core/src/test/java/org/apache/cxf/endpoint/DummyServer.java
@@ -24,7 +24,7 @@ import org.apache.cxf.transport.MessageObserver;
public class DummyServer implements Server {
private ServerRegistryImpl serverRegistry;
-
+
public DummyServer(ServerRegistryImpl sri) {
serverRegistry = sri;
}
@@ -40,18 +40,18 @@ public class DummyServer implements Server {
}
public void start() {
- serverRegistry.register(this);
+ serverRegistry.register(this);
}
public void stop() {
serverRegistry.unregister(this);
-
+
}
-
+
public void destroy() {
stop();
}
-
+
public MessageObserver getMessageObserver() {
return null;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/endpoint/EndpointImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/endpoint/EndpointImplTest.java b/core/src/test/java/org/apache/cxf/endpoint/EndpointImplTest.java
index e68596f..2824457 100755
--- a/core/src/test/java/org/apache/cxf/endpoint/EndpointImplTest.java
+++ b/core/src/test/java/org/apache/cxf/endpoint/EndpointImplTest.java
@@ -29,10 +29,10 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class EndpointImplTest extends Assert {
-
+
@Test
public void testEqualsAndHashCode() throws Exception {
Bus bus = new ExtensionManagerBus();
@@ -41,26 +41,26 @@ public class EndpointImplTest extends Assert {
ei.setAddress("http://nowhere.com/bar/foo");
EndpointInfo ei2 = new EndpointInfo();
ei2.setAddress("http://nowhere.com/foo/bar");
-
+
Endpoint ep = new EndpointImpl(bus, svc, ei);
Endpoint ep1 = new EndpointImpl(bus, svc, ei);
Endpoint ep2 = new EndpointImpl(bus, svc, ei2);
-
+
int hashcode = ep.hashCode();
int hashcode1 = ep1.hashCode();
int hashcode2 = ep2.hashCode();
-
+
assertTrue("hashcodes must be equal", hashcode == hashcode1);
assertTrue("hashcodes must not be equal", hashcode != hashcode2);
assertTrue("reflexivity violated", ep.equals(ep));
assertFalse("two objects must not be equal", ep.equals(ep1));
assertFalse("two objects must not be equal", ep.equals(ep2));
-
+
ep.put("custom", Boolean.TRUE);
-
+
assertTrue("hashcode must remain equal", hashcode == ep.hashCode());
}
-
+
//TODO add other tests
}