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:37 UTC
[32/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/attachment/AttachmentSerializerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
index b68e012..d2d4f98 100644
--- a/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
+++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
@@ -42,41 +42,41 @@ import org.junit.Assert;
import org.junit.Test;
public class AttachmentSerializerTest extends Assert {
-
+
@Test
public void testMessageWriteXopOn1() throws Exception {
doTestMessageWrite(true, "text/xml");
}
-
+
@Test
public void testMessageWriteXopOn2() throws Exception {
doTestMessageWrite(true, "application/soap+xml; action=\"urn:foo\"");
}
-
+
@Test
public void testMessageWriteXopOff1() throws Exception {
doTestMessageWrite(false, "text/xml");
}
-
+
@Test
public void testMessageWriteXopOff2() throws Exception {
doTestMessageWrite(false, "application/soap+xml; action=\"urn:foo\"");
}
-
+
private void doTestMessageWrite(boolean xop, String soapContentType) throws Exception {
MessageImpl msg = new MessageImpl();
-
+
Collection<Attachment> atts = new ArrayList<>();
AttachmentImpl a = new AttachmentImpl("test.xml");
-
+
InputStream is = getClass().getResourceAsStream("my.wav");
ByteArrayDataSource ds = new ByteArrayDataSource(is, "application/octet-stream");
a.setDataHandler(new DataHandler(ds));
-
+
atts.add(a);
-
+
msg.setAttachments(atts);
-
+
// Set the SOAP content type
msg.put(Message.CONTENT_TYPE, soapContentType);
String soapCtType = null;
@@ -94,13 +94,13 @@ public class AttachmentSerializerTest extends Assert {
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
msg.setContent(OutputStream.class, out);
-
+
AttachmentSerializer serializer = new AttachmentSerializer(msg);
if (!xop) {
// default is "on"
serializer.setXop(xop);
}
-
+
serializer.writeProlog();
// we expect the following rules at the package header level
@@ -109,7 +109,7 @@ public class AttachmentSerializerTest extends Assert {
// value must contain the content type associated with the root content's xml serialization,
// including its parameters as appropriate.
// - the action property should not appear directly in the package header level
- // - the type property must contain the media type type/subtype of the root content part.
+ // - the type property must contain the media type type/subtype of the root content part.
// namely application/xop+xml for mtom but otherwise text/xml or application/soap+xml
// depending on the soap version 1.1 or 1.2, respectively.
String ct = (String) msg.get(Message.CONTENT_TYPE);
@@ -123,120 +123,120 @@ public class AttachmentSerializerTest extends Assert {
assertTrue(ct.indexOf("type=\"" + soapCtType + "\"") > -1);
}
out.write("<soap:Body/>".getBytes());
-
+
serializer.writeAttachments();
-
+
out.flush();
-
+
DataSource source = new ByteArrayDataSource(new ByteArrayInputStream(out.toByteArray()), ct);
MimeMultipart mpart = new MimeMultipart(source);
Session session = Session.getDefaultInstance(new Properties());
MimeMessage inMsg = new MimeMessage(session);
inMsg.setContent(mpart);
inMsg.addHeaderLine("Content-Type: " + ct);
-
+
MimeMultipart multipart = (MimeMultipart) inMsg.getContent();
-
+
MimeBodyPart part = (MimeBodyPart) multipart.getBodyPart(0);
// we expect the following rules at the root content level
- // - the envelope header must have type application/xop+xml for mtom but otherwise the content's
+ // - the envelope header must have type application/xop+xml for mtom but otherwise the content's
// serialization type.
// - the type property must be present for mtom and it must contain the content's serialization type
- // including its parameters if appropriate.
+ // including its parameters if appropriate.
// - the action must appear if it was present in the original message (i.e., for soap 1.2)
if (xop) {
assertEquals("application/xop+xml; charset=UTF-8; type=\"" + soapCtType + soapCtParamsEscaped + "\"",
part.getHeader("Content-Type")[0]);
} else {
- assertEquals(soapCtType + "; charset=UTF-8" + soapCtParams,
+ assertEquals(soapCtType + "; charset=UTF-8" + soapCtParams,
part.getHeader("Content-Type")[0]);
}
-
+
assertEquals("binary", part.getHeader("Content-Transfer-Encoding")[0]);
assertEquals("<ro...@cxf.apache.org>", part.getHeader("Content-ID")[0]);
-
+
InputStream in = part.getDataHandler().getInputStream();
ByteArrayOutputStream bodyOut = new ByteArrayOutputStream();
IOUtils.copy(in, bodyOut);
out.close();
in.close();
-
+
assertEquals("<soap:Body/>", bodyOut.toString());
-
+
MimeBodyPart part2 = (MimeBodyPart) multipart.getBodyPart(1);
assertEquals("application/octet-stream", part2.getHeader("Content-Type")[0]);
assertEquals("binary", part2.getHeader("Content-Transfer-Encoding")[0]);
assertEquals("<test.xml>", part2.getHeader("Content-ID")[0]);
}
-
+
@Test
public void testMessageMTOM() throws Exception {
MessageImpl msg = new MessageImpl();
-
+
Collection<Attachment> atts = new ArrayList<>();
AttachmentImpl a = new AttachmentImpl("test.xml");
-
+
InputStream is = getClass().getResourceAsStream("my.wav");
ByteArrayDataSource ds = new ByteArrayDataSource(is, "application/octet-stream");
a.setDataHandler(new DataHandler(ds));
-
+
atts.add(a);
-
+
msg.setAttachments(atts);
-
+
// Set the SOAP content type
msg.put(Message.CONTENT_TYPE, "application/soap+xml");
-
+
ByteArrayOutputStream out = new ByteArrayOutputStream();
msg.setContent(OutputStream.class, out);
-
+
AttachmentSerializer serializer = new AttachmentSerializer(msg);
-
+
serializer.writeProlog();
String ct = (String) msg.get(Message.CONTENT_TYPE);
assertTrue(ct.indexOf("multipart/related;") == 0);
assertTrue(ct.indexOf("start=\"<ro...@cxf.apache.org>\"") > -1);
assertTrue(ct.indexOf("start-info=\"application/soap+xml\"") > -1);
-
+
out.write("<soap:Body/>".getBytes());
-
+
serializer.writeAttachments();
-
+
out.flush();
DataSource source = new ByteArrayDataSource(new ByteArrayInputStream(out.toByteArray()), ct);
MimeMultipart mpart = new MimeMultipart(source);
Session session = Session.getDefaultInstance(new Properties());
MimeMessage inMsg = new MimeMessage(session);
inMsg.setContent(mpart);
-
+
inMsg.addHeaderLine("Content-Type: " + ct);
-
+
MimeMultipart multipart = (MimeMultipart) inMsg.getContent();
-
+
MimeBodyPart part = (MimeBodyPart) multipart.getBodyPart(0);
- assertEquals("application/xop+xml; charset=UTF-8; type=\"application/soap+xml\"",
+ assertEquals("application/xop+xml; charset=UTF-8; type=\"application/soap+xml\"",
part.getHeader("Content-Type")[0]);
assertEquals("binary", part.getHeader("Content-Transfer-Encoding")[0]);
assertEquals("<ro...@cxf.apache.org>", part.getHeader("Content-ID")[0]);
-
+
InputStream in = part.getDataHandler().getInputStream();
ByteArrayOutputStream bodyOut = new ByteArrayOutputStream();
IOUtils.copy(in, bodyOut);
out.close();
in.close();
-
+
assertEquals("<soap:Body/>", bodyOut.toString());
-
+
MimeBodyPart part2 = (MimeBodyPart) multipart.getBodyPart(1);
assertEquals("application/octet-stream", part2.getHeader("Content-Type")[0]);
assertEquals("binary", part2.getHeader("Content-Transfer-Encoding")[0]);
assertEquals("<test.xml>", part2.getHeader("Content-ID")[0]);
-
+
}
private static String escapeQuotes(String s) {
- return s.indexOf('"') != 0 ? s.replace("\"", "\\\"") : s;
+ return s.indexOf('"') != 0 ? s.replace("\"", "\\\"") : s;
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java b/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
index 1c93eb2..10c8ad6 100644
--- a/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
@@ -52,40 +52,40 @@ public class CXFBusImplTest extends Assert {
}
@Test
public void testConstructionWithoutExtensions() throws BusException {
-
+
Bus bus = new ExtensionManagerBus();
assertNotNull(bus.getExtension(BindingFactoryManager.class));
- assertNotNull(bus.getExtension(ConduitInitiatorManager.class));
+ assertNotNull(bus.getExtension(ConduitInitiatorManager.class));
assertNotNull(bus.getExtension(DestinationFactoryManager.class));
assertNotNull(bus.getExtension(PhaseManager.class));
bus.shutdown(true);
}
-
+
@Test
public void testConstructionWithExtensions() throws BusException {
-
+
IMocksControl control;
BindingFactoryManager bindingFactoryManager;
InstrumentationManager instrumentationManager;
PhaseManager phaseManager;
-
+
control = EasyMock.createNiceControl();
-
+
Map<Class<?>, Object> extensions = new HashMap<Class<?>, Object>();
bindingFactoryManager = control.createMock(BindingFactoryManager.class);
instrumentationManager = control.createMock(InstrumentationManager.class);
phaseManager = control.createMock(PhaseManager.class);
-
+
extensions.put(BindingFactoryManager.class, bindingFactoryManager);
extensions.put(InstrumentationManager.class, instrumentationManager);
extensions.put(PhaseManager.class, phaseManager);
-
+
Bus bus = new ExtensionManagerBus(extensions);
-
+
assertSame(bindingFactoryManager, bus.getExtension(BindingFactoryManager.class));
assertSame(instrumentationManager, bus.getExtension(InstrumentationManager.class));
assertSame(phaseManager, bus.getExtension(PhaseManager.class));
-
+
}
@Test
@@ -96,7 +96,7 @@ public class CXFBusImplTest extends Assert {
assertSame(extension, bus.getExtension(String.class));
bus.shutdown(true);
}
-
+
@Test
public void testBusID() {
Bus bus = new ExtensionManagerBus();
@@ -106,7 +106,7 @@ public class CXFBusImplTest extends Assert {
assertEquals("The bus id should be changed", "test", bus.getId());
bus.shutdown(true);
}
-
+
@Test
public void testShutdownWithBusLifecycle() {
final Bus bus = new ExtensionManagerBus();
@@ -116,12 +116,12 @@ public class CXFBusImplTest extends Assert {
listener.preShutdown();
EasyMock.expectLastCall();
listener.postShutdown();
- EasyMock.expectLastCall();
- EasyMock.replay(listener);
+ EasyMock.expectLastCall();
+ EasyMock.replay(listener);
lifeCycleManager.registerLifeCycleListener(listener);
bus.shutdown(true);
EasyMock.verify(listener);
- bus.shutdown(true);
+ bus.shutdown(true);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java b/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
index 057200d..6a71200 100644
--- a/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/extension/ExtensionManagerTest.java
@@ -35,27 +35,27 @@ public class ExtensionManagerTest extends Assert {
private static final String EXTENSIONMANAGER_TEST_RESOURECE_NAME = "extensionManagerTest";
private ExtensionManagerImpl manager;
private Map<Class<?>, Object> extensions;
-
+
@Before
public void setUp() {
ResourceResolver resolver = new SinglePropertyResolver(EXTENSIONMANAGER_TEST_RESOURECE_NAME, this);
ResourceManager rm = new DefaultResourceManager(resolver);
-
+
extensions = new HashMap<Class<?>, Object>();
extensions.put(Integer.class, Integer.valueOf(0));
-
- manager = new ExtensionManagerImpl("test-extension.xml",
- Thread.currentThread().getContextClassLoader(), extensions, rm, null);
+
+ manager = new ExtensionManagerImpl("test-extension.xml",
+ Thread.currentThread().getContextClassLoader(), extensions, rm, null);
}
-
+
@Test
public void testLoadAndRegister() {
Extension e = new Extension();
e.setClassname("java.lang.String");
- e.setDeferred(false);
+ e.setDeferred(false);
manager.loadAndRegister(e);
-
-
+
+
String interfaceName = "java.lang.Runnable";
e.setDeferred(false);
e.setClassname("java.lang.Thread");
@@ -63,7 +63,7 @@ public class ExtensionManagerTest extends Assert {
assertNull("Object is registered.", extensions.get(Runnable.class));
manager.loadAndRegister(e);
assertNotNull("Object was not registered.", extensions.get(Runnable.class));
-
+
interfaceName = "java.lang.Integer";
e.setInterfaceName(interfaceName);
e.setClassname("no.such.Class");
@@ -71,9 +71,9 @@ public class ExtensionManagerTest extends Assert {
assertNotNull("Object is not registered.", obj);
manager.loadAndRegister(e);
assertSame("Registered object was replaced.", obj, extensions.get(Integer.class));
-
+
}
-
-
+
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/extension/ExtensionTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/extension/ExtensionTest.java b/core/src/test/java/org/apache/cxf/bus/extension/ExtensionTest.java
index a0a7c90..85b01b1 100644
--- a/core/src/test/java/org/apache/cxf/bus/extension/ExtensionTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/extension/ExtensionTest.java
@@ -27,30 +27,30 @@ public class ExtensionTest extends Assert {
@Test
public void testMutators() {
Extension e = new Extension();
-
+
String className = "org.apache.cxf.bindings.soap.SoapBinding";
e.setClassname(className);
assertEquals("Unexpected class name.", className, e.getClassname());
assertNull("Unexpected interface name.", e.getInterfaceName());
-
+
String interfaceName = "org.apache.cxf.bindings.Binding";
e.setInterfaceName(interfaceName);
assertEquals("Unexpected interface name.", interfaceName, e.getInterfaceName());
-
+
assertTrue("Extension is deferred.", !e.isDeferred());
e.setDeferred(true);
assertTrue("Extension is not deferred.", e.isDeferred());
-
+
assertEquals("Unexpected size of namespace list.", 0, e.getNamespaces().size());
}
-
+
@Test
public void testLoad() throws ExtensionException {
Extension e = new Extension();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- e.setClassname("no.such.Extension");
+ e.setClassname("no.such.Extension");
try {
- e.load(cl, null);
+ e.load(cl, null);
} catch (ExtensionException ex) {
assertTrue("ExtensionException does not wrap ClassNotFoundException",
ex.getCause() instanceof ClassNotFoundException);
@@ -58,44 +58,44 @@ public class ExtensionTest extends Assert {
e.setClassname("java.lang.System");
try {
- e.load(cl, null);
+ e.load(cl, null);
} catch (ExtensionException ex) {
assertTrue("ExtensionException does not wrap NoSuchMethodException " + ex.getCause(),
ex.getCause() instanceof NoSuchMethodException);
- }
+ }
e.setClassname(MyServiceConstructorThrowsException.class.getName());
try {
- e.load(cl, null);
+ e.load(cl, null);
} catch (ExtensionException ex) {
assertTrue("ExtensionException does not wrap IllegalArgumentException",
ex.getCause() instanceof IllegalArgumentException);
- }
+ }
e.setClassname("java.lang.String");
Object obj = e.load(cl, null);
- assertTrue("Object is not type String", obj instanceof String);
+ assertTrue("Object is not type String", obj instanceof String);
}
-
+
@Test
public void testLoadInterface() {
Extension e = new Extension();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- e.setInterfaceName("no.such.Extension");
+ e.setInterfaceName("no.such.Extension");
try {
- e.loadInterface(cl);
+ e.loadInterface(cl);
} catch (ExtensionException ex) {
assertTrue("ExtensionException does not wrap ClassNotFoundException",
ex.getCause() instanceof ClassNotFoundException);
}
-
+
e.setInterfaceName(Assert.class.getName());
Class<?> cls = e.loadInterface(cl);
assertNotNull(cls);
}
-
+
public static class MyServiceConstructorThrowsException {
public MyServiceConstructorThrowsException() {
throw new IllegalArgumentException();
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/extension/TextExtensionFragmentParserTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/extension/TextExtensionFragmentParserTest.java b/core/src/test/java/org/apache/cxf/bus/extension/TextExtensionFragmentParserTest.java
index e715051..86371df 100644
--- a/core/src/test/java/org/apache/cxf/bus/extension/TextExtensionFragmentParserTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/extension/TextExtensionFragmentParserTest.java
@@ -33,15 +33,15 @@ public class TextExtensionFragmentParserTest extends Assert {
InputStream is = TextExtensionFragmentParserTest.class.getResourceAsStream("extension2.txt");
List<Extension> extensions = new TextExtensionFragmentParser(null).getExtensions(is);
assertEquals("Unexpected number of Extension elements.", 3, extensions.size());
-
+
Extension e = extensions.get(0);
assertTrue("Extension is deferred.", !e.isDeferred());
- assertEquals("Unexpected class name.",
+ assertEquals("Unexpected class name.",
"org.apache.cxf.foo.FooImpl", e.getClassname());
assertEquals("Unexpected number of namespace elements.", 0, e.getNamespaces().size());
e = extensions.get(1);
assertTrue("Extension is not deferred.", e.isDeferred());
- assertEquals("Unexpected implementation class name.",
+ assertEquals("Unexpected implementation class name.",
"java.lang.Boolean", e.getClassname());
assertNull("Interface should be null", e.getInterfaceName());
assertEquals("Unexpected number of namespace elements.", 0, e.getNamespaces().size());
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/managers/EndpointResolverRegistryImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/managers/EndpointResolverRegistryImplTest.java b/core/src/test/java/org/apache/cxf/bus/managers/EndpointResolverRegistryImplTest.java
index 25c6163..a8cae96 100644
--- a/core/src/test/java/org/apache/cxf/bus/managers/EndpointResolverRegistryImplTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/managers/EndpointResolverRegistryImplTest.java
@@ -68,26 +68,26 @@ public class EndpointResolverRegistryImplTest extends Assert {
assertEquals("unexpected resolver count",
0,
registry.getResolvers().size());
-
+
registry.register(resolver1);
-
+
assertEquals("unexpected resolver count",
1,
registry.getResolvers().size());
assertTrue("expected resolver to be registered",
registry.getResolvers().contains(resolver1));
-
+
registry.unregister(resolver1);
-
+
assertEquals("unexpected resolver count",
0,
registry.getResolvers().size());
assertFalse("expected resolver to be registered",
registry.getResolvers().contains(resolver1));
-
+
registry.register(resolver2);
registry.register(resolver1);
-
+
assertEquals("unexpected resolver count",
2,
registry.getResolvers().size());
@@ -95,9 +95,9 @@ public class EndpointResolverRegistryImplTest extends Assert {
registry.getResolvers().contains(resolver1));
assertTrue("expected resolver to be registered",
registry.getResolvers().contains(resolver2));
-
+
registry.unregister(resolver2);
-
+
assertEquals("unexpected resolver count",
1,
registry.getResolvers().size());
@@ -106,7 +106,7 @@ public class EndpointResolverRegistryImplTest extends Assert {
assertFalse("expected resolver to be registered",
registry.getResolvers().contains(resolver2));
}
-
+
@Test
public void testResolve() {
registry.register(resolver1);
@@ -114,21 +114,21 @@ public class EndpointResolverRegistryImplTest extends Assert {
resolver1.resolve(logical);
EasyMock.expectLastCall().andReturn(physical);
control.replay();
-
+
EndpointReferenceType resolved = registry.resolve(logical);
-
+
control.verify();
assertSame("unexpected physical EPR", physical, resolved);
-
+
control.reset();
resolver1.resolve(logical);
EasyMock.expectLastCall().andReturn(null);
resolver2.resolve(logical);
EasyMock.expectLastCall().andReturn(physical);
control.replay();
-
+
resolved = registry.resolve(logical);
-
+
control.verify();
assertSame("unexpected physical EPR", physical, resolved);
@@ -144,7 +144,7 @@ public class EndpointResolverRegistryImplTest extends Assert {
control.verify();
assertNull("unexpected physical EPR", resolved);
}
-
+
@Test
public void testRenew() {
registry.register(resolver1);
@@ -152,21 +152,21 @@ public class EndpointResolverRegistryImplTest extends Assert {
resolver1.renew(logical, physical);
EasyMock.expectLastCall().andReturn(fresh);
control.replay();
-
+
EndpointReferenceType renewed = registry.renew(logical, physical);
-
+
control.verify();
assertSame("unexpected physical EPR", fresh, renewed);
-
+
control.reset();
resolver1.renew(logical, physical);
EasyMock.expectLastCall().andReturn(null);
resolver2.renew(logical, physical);
EasyMock.expectLastCall().andReturn(physical);
control.replay();
-
+
renewed = registry.renew(logical, physical);
-
+
control.verify();
assertSame("unexpected physical EPR", physical, renewed);
@@ -182,7 +182,7 @@ public class EndpointResolverRegistryImplTest extends Assert {
control.verify();
assertNull("unexpected physical EPR", renewed);
}
-
+
@Test
public void testMintFromServiceName() {
registry.register(resolver1);
@@ -190,21 +190,21 @@ public class EndpointResolverRegistryImplTest extends Assert {
resolver1.mint(serviceName);
EasyMock.expectLastCall().andReturn(logical);
control.replay();
-
+
EndpointReferenceType minted = registry.mint(serviceName);
-
+
control.verify();
assertSame("unexpected minted EPR", logical, minted);
-
+
control.reset();
resolver1.mint(serviceName);
EasyMock.expectLastCall().andReturn(null);
resolver2.mint(serviceName);
EasyMock.expectLastCall().andReturn(logical);
control.replay();
-
+
minted = registry.mint(serviceName);
-
+
control.verify();
assertSame("unexpected minted EPR", logical, minted);
@@ -220,7 +220,7 @@ public class EndpointResolverRegistryImplTest extends Assert {
control.verify();
assertNull("unexpected minted EPR", minted);
}
-
+
@Test
public void testMintFromPhysical() {
registry.register(resolver1);
@@ -228,21 +228,21 @@ public class EndpointResolverRegistryImplTest extends Assert {
resolver1.mint(physical);
EasyMock.expectLastCall().andReturn(logical);
control.replay();
-
+
EndpointReferenceType minted = registry.mint(physical);
-
+
control.verify();
assertSame("unexpected minted EPR", logical, minted);
-
+
control.reset();
resolver1.mint(physical);
EasyMock.expectLastCall().andReturn(null);
resolver2.mint(physical);
EasyMock.expectLastCall().andReturn(logical);
control.replay();
-
+
minted = registry.mint(physical);
-
+
control.verify();
assertSame("unexpected minted EPR", logical, minted);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/managers/ServerRegistryImpTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/managers/ServerRegistryImpTest.java b/core/src/test/java/org/apache/cxf/bus/managers/ServerRegistryImpTest.java
index f069cc9..ab85e24 100644
--- a/core/src/test/java/org/apache/cxf/bus/managers/ServerRegistryImpTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/managers/ServerRegistryImpTest.java
@@ -26,10 +26,10 @@ import org.junit.Assert;
import org.junit.Test;
public class ServerRegistryImpTest extends Assert {
-
+
@Test
public void testServerRegistryPreShutdown() {
- ServerRegistryImpl serverRegistryImpl = new ServerRegistryImpl();
+ ServerRegistryImpl serverRegistryImpl = new ServerRegistryImpl();
Server server = new DummyServer(serverRegistryImpl);
server.start();
assertEquals("The serverList should have one service", serverRegistryImpl.serversList.size(), 1);
@@ -37,8 +37,8 @@ public class ServerRegistryImpTest extends Assert {
assertEquals("The serverList should be clear ", serverRegistryImpl.serversList.size(), 0);
serverRegistryImpl.postShutdown();
assertEquals("The serverList should be clear ", serverRegistryImpl.serversList.size(), 0);
- }
-
-
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/managers/ServiceContractResolverRegistryImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/managers/ServiceContractResolverRegistryImplTest.java b/core/src/test/java/org/apache/cxf/bus/managers/ServiceContractResolverRegistryImplTest.java
index 836ec65..5bb9f68 100644
--- a/core/src/test/java/org/apache/cxf/bus/managers/ServiceContractResolverRegistryImplTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/managers/ServiceContractResolverRegistryImplTest.java
@@ -58,32 +58,32 @@ public class ServiceContractResolverRegistryImplTest extends Assert {
resolver2 = null;
serviceName = null;
}
-
+
@Test
public void testRegister() {
assertEquals("unexpected resolver count",
0,
registry.getResolvers().size());
-
+
registry.register(resolver1);
-
+
assertEquals("unexpected resolver count",
1,
registry.getResolvers().size());
assertTrue("expected resolver to be registered",
registry.getResolvers().contains(resolver1));
-
+
registry.unregister(resolver1);
-
+
assertEquals("unexpected resolver count",
0,
registry.getResolvers().size());
assertFalse("expected resolver to be registered",
registry.getResolvers().contains(resolver1));
-
+
registry.register(resolver2);
registry.register(resolver1);
-
+
assertEquals("unexpected resolver count",
2,
registry.getResolvers().size());
@@ -91,9 +91,9 @@ public class ServiceContractResolverRegistryImplTest extends Assert {
registry.getResolvers().contains(resolver1));
assertTrue("expected resolver to be registered",
registry.getResolvers().contains(resolver2));
-
+
registry.unregister(resolver2);
-
+
assertEquals("unexpected resolver count",
1,
registry.getResolvers().size());
@@ -102,7 +102,7 @@ public class ServiceContractResolverRegistryImplTest extends Assert {
assertFalse("expected resolver to be registered",
registry.getResolvers().contains(resolver2));
}
-
+
@Test
public void testGetContactLocation() {
registry.register(resolver1);
@@ -110,21 +110,21 @@ public class ServiceContractResolverRegistryImplTest extends Assert {
resolver1.getContractLocation(serviceName);
EasyMock.expectLastCall().andReturn(uri1);
control.replay();
-
+
URI resolved = registry.getContractLocation(serviceName);
-
+
control.verify();
assertSame("unexpected physical EPR", uri1, resolved);
-
+
control.reset();
resolver1.getContractLocation(serviceName);
EasyMock.expectLastCall().andReturn(null);
resolver2.getContractLocation(serviceName);
EasyMock.expectLastCall().andReturn(uri2);
control.replay();
-
+
resolved = registry.getContractLocation(serviceName);
-
+
control.verify();
assertSame("unexpected physical EPR", uri2, resolved);
assertNotSame("unexpected physical EPR", uri1, resolved);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/osgi/OSGiBusListenerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/osgi/OSGiBusListenerTest.java b/core/src/test/java/org/apache/cxf/bus/osgi/OSGiBusListenerTest.java
index 21c3e99..4b2c55a 100644
--- a/core/src/test/java/org/apache/cxf/bus/osgi/OSGiBusListenerTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/osgi/OSGiBusListenerTest.java
@@ -1,210 +1,210 @@
-/**
- * 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.cxf.bus.osgi;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.buslifecycle.BusLifeCycleManager;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.endpoint.ClientLifeCycleListener;
-import org.apache.cxf.endpoint.ClientLifeCycleManager;
-import org.apache.cxf.endpoint.ServerLifeCycleListener;
-import org.apache.cxf.endpoint.ServerLifeCycleManager;
-import org.apache.cxf.feature.Feature;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- *
- */
-public class OSGiBusListenerTest extends Assert {
- private static final String[] SERVICE_BUNDLE_NAMES = new String[]{"me.temp.foo.test", "me.temp.bar.sample"};
- private static final String EXCLUDES = "me\\.temp\\.bar\\..*";
- private static final String RESTRICTED = "me\\.my\\.app\\..*";
- private static final String BUNDLE_NAME = "me.my.app";
-
- private IMocksControl control;
- private Bus bus;
- private BundleContext bundleContext;
- private Bundle bundle;
-
-
- @Before
- public void setUp() {
- control = EasyMock.createNiceControl();
- bus = control.createMock(Bus.class);
- BusLifeCycleManager blcManager = control.createMock(BusLifeCycleManager.class);
- EasyMock.expect(bus.getExtension(BusLifeCycleManager.class)).andReturn(blcManager).anyTimes();
-
- blcManager.registerLifeCycleListener(EasyMock.isA(OSGIBusListener.class));
- EasyMock.expectLastCall();
- bundleContext = control.createMock(BundleContext.class);
-
- BundleContext app = control.createMock(BundleContext.class);
- EasyMock.expect(bus.getExtension(BundleContext.class)).andReturn(app).anyTimes();
- bundle = control.createMock(Bundle.class);
- EasyMock.expect(app.getBundle()).andReturn(bundle).anyTimes();
- EasyMock.expect(bundle.getSymbolicName()).andReturn(BUNDLE_NAME).anyTimes();
- }
-
- @Test
- public void testRegistratioWithNoServices() throws Exception {
- control.replay();
- new OSGIBusListener(bus, new Object[]{bundleContext});
-
- control.verify();
- }
-
- @Test
- public void testRegistratioWithServices() throws Exception {
- setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null);
- setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null);
- Collection<Feature> lst = new ArrayList<>();
- setFeatures(SERVICE_BUNDLE_NAMES, new String[]{null, null}, lst);
-
- control.replay();
- new OSGIBusListener(bus, new Object[]{bundleContext});
-
- assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null), lst.size());
-
- control.verify();
- }
-
- @Test
- public void testRegistratioWithServicesExcludes() throws Exception {
- setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES);
- setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES);
- Collection<Feature> lst = new ArrayList<>();
- setFeatures(SERVICE_BUNDLE_NAMES, new String[]{null, null}, lst);
- EasyMock.expect(bus.getProperty("bus.extension.bundles.excludes")).andReturn(EXCLUDES);
- control.replay();
- new OSGIBusListener(bus, new Object[]{bundleContext});
-
- assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES), lst.size());
-
- control.verify();
- }
-
- @Test
- public void testRegistratioWithServicesExcludesAndRestricted() throws Exception {
- setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES);
- setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES);
- Collection<Feature> lst = new ArrayList<>();
- setFeatures(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, lst);
- EasyMock.expect(bus.getProperty("bus.extension.bundles.excludes")).andReturn(EXCLUDES);
- control.replay();
- new OSGIBusListener(bus, new Object[]{bundleContext});
-
- assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES), lst.size());
-
- control.verify();
- }
-
- private void setUpClientLifeCycleListeners(String[] names, String[] restricted, String excludes) throws Exception {
- ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
- EasyMock.expect(bundleContext.getServiceReferences(ClientLifeCycleListener.class.getName(), null))
- .andReturn(svcrefs);
- ClientLifeCycleManager lcmanager = control.createMock(ClientLifeCycleManager.class);
- EasyMock.expect(bus.getExtension(ClientLifeCycleManager.class)).andReturn(lcmanager).anyTimes();
- for (int i = 0; i < names.length; i++) {
- ClientLifeCycleListener cl = control.createMock(ClientLifeCycleListener.class);
- EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(cl).anyTimes();
- if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excludes)) {
- lcmanager.registerListener(cl);
- EasyMock.expectLastCall();
- }
- }
- }
-
- private void setUpServerLifeCycleListeners(String[] names, String[] restricted, String excludes) throws Exception {
- ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
- EasyMock.expect(bundleContext.getServiceReferences(ServerLifeCycleListener.class.getName(), null))
- .andReturn(svcrefs);
- ServerLifeCycleManager lcmanager = control.createMock(ServerLifeCycleManager.class);
- EasyMock.expect(bus.getExtension(ServerLifeCycleManager.class)).andReturn(lcmanager).anyTimes();
- for (int i = 0; i < names.length; i++) {
- ServerLifeCycleListener cl = control.createMock(ServerLifeCycleListener.class);
- EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(cl).anyTimes();
- if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excludes)) {
- lcmanager.registerListener(cl);
- EasyMock.expectLastCall();
- }
- }
- }
-
- private void setFeatures(String[] names, String[] restricted,
- Collection<Feature> lst) throws Exception {
- ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
- EasyMock.expect(bundleContext.getServiceReferences(Feature.class.getName(), null))
- .andReturn(svcrefs);
- for (int i = 0; i < names.length; i++) {
- Feature f = control.createMock(Feature.class);
- EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(f).anyTimes();
- }
- EasyMock.expect(bus.getFeatures()).andReturn(lst).anyTimes();
-
- }
-
- // Creates test service references with the specified symbolic names and the restricted extension properties.
- private ServiceReference[] createTestServiceReferences(String[] names, String[] restricted) {
- ServiceReference[] refs = new ServiceReference[names.length];
- for (int i = 0; i < names.length; i++) {
- refs[i] = createTestServiceReference(names[i], restricted[i]);
- }
- return refs;
- }
-
-
- // Creates a test service reference with the specified symbolic name and the restricted extension property.
- private ServiceReference createTestServiceReference(String name, String rst) {
- ServiceReference ref = control.createMock(ServiceReference.class);
- Bundle b = control.createMock(Bundle.class);
- EasyMock.expect(b.getSymbolicName()).andReturn(name).anyTimes();
- EasyMock.expect(ref.getBundle()).andReturn(b).anyTimes();
- EasyMock.expect(ref.getProperty("org.apache.cxf.bus.restricted.extension")).andReturn(rst).anyTimes();
- return ref;
- }
-
- private static boolean isExcluded(String aname, String sname, String rst, String exc) {
- if (!StringUtils.isEmpty(rst) && !aname.matches(rst)) {
- return true;
- }
- return exc != null && sname.matches(exc);
- }
-
- private static int countServices(String[] names, String[] restricted, String excluded) {
- int c = 0;
- for (int i = 0; i < names.length; i++) {
- if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excluded)) {
- c++;
- }
- }
- return c;
- }
-}
+/**
+ * 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.cxf.bus.osgi;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.endpoint.ClientLifeCycleListener;
+import org.apache.cxf.endpoint.ClientLifeCycleManager;
+import org.apache.cxf.endpoint.ServerLifeCycleListener;
+import org.apache.cxf.endpoint.ServerLifeCycleManager;
+import org.apache.cxf.feature.Feature;
+import org.easymock.EasyMock;
+import org.easymock.IMocksControl;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ *
+ */
+public class OSGiBusListenerTest extends Assert {
+ private static final String[] SERVICE_BUNDLE_NAMES = new String[]{"me.temp.foo.test", "me.temp.bar.sample"};
+ private static final String EXCLUDES = "me\\.temp\\.bar\\..*";
+ private static final String RESTRICTED = "me\\.my\\.app\\..*";
+ private static final String BUNDLE_NAME = "me.my.app";
+
+ private IMocksControl control;
+ private Bus bus;
+ private BundleContext bundleContext;
+ private Bundle bundle;
+
+
+ @Before
+ public void setUp() {
+ control = EasyMock.createNiceControl();
+ bus = control.createMock(Bus.class);
+ BusLifeCycleManager blcManager = control.createMock(BusLifeCycleManager.class);
+ EasyMock.expect(bus.getExtension(BusLifeCycleManager.class)).andReturn(blcManager).anyTimes();
+
+ blcManager.registerLifeCycleListener(EasyMock.isA(OSGIBusListener.class));
+ EasyMock.expectLastCall();
+ bundleContext = control.createMock(BundleContext.class);
+
+ BundleContext app = control.createMock(BundleContext.class);
+ EasyMock.expect(bus.getExtension(BundleContext.class)).andReturn(app).anyTimes();
+ bundle = control.createMock(Bundle.class);
+ EasyMock.expect(app.getBundle()).andReturn(bundle).anyTimes();
+ EasyMock.expect(bundle.getSymbolicName()).andReturn(BUNDLE_NAME).anyTimes();
+ }
+
+ @Test
+ public void testRegistratioWithNoServices() throws Exception {
+ control.replay();
+ new OSGIBusListener(bus, new Object[]{bundleContext});
+
+ control.verify();
+ }
+
+ @Test
+ public void testRegistratioWithServices() throws Exception {
+ setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null);
+ setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null);
+ Collection<Feature> lst = new ArrayList<>();
+ setFeatures(SERVICE_BUNDLE_NAMES, new String[]{null, null}, lst);
+
+ control.replay();
+ new OSGIBusListener(bus, new Object[]{bundleContext});
+
+ assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{null, null}, null), lst.size());
+
+ control.verify();
+ }
+
+ @Test
+ public void testRegistratioWithServicesExcludes() throws Exception {
+ setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES);
+ setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES);
+ Collection<Feature> lst = new ArrayList<>();
+ setFeatures(SERVICE_BUNDLE_NAMES, new String[]{null, null}, lst);
+ EasyMock.expect(bus.getProperty("bus.extension.bundles.excludes")).andReturn(EXCLUDES);
+ control.replay();
+ new OSGIBusListener(bus, new Object[]{bundleContext});
+
+ assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{null, null}, EXCLUDES), lst.size());
+
+ control.verify();
+ }
+
+ @Test
+ public void testRegistratioWithServicesExcludesAndRestricted() throws Exception {
+ setUpClientLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES);
+ setUpServerLifeCycleListeners(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES);
+ Collection<Feature> lst = new ArrayList<>();
+ setFeatures(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, lst);
+ EasyMock.expect(bus.getProperty("bus.extension.bundles.excludes")).andReturn(EXCLUDES);
+ control.replay();
+ new OSGIBusListener(bus, new Object[]{bundleContext});
+
+ assertEquals(countServices(SERVICE_BUNDLE_NAMES, new String[]{RESTRICTED, null}, EXCLUDES), lst.size());
+
+ control.verify();
+ }
+
+ private void setUpClientLifeCycleListeners(String[] names, String[] restricted, String excludes) throws Exception {
+ ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
+ EasyMock.expect(bundleContext.getServiceReferences(ClientLifeCycleListener.class.getName(), null))
+ .andReturn(svcrefs);
+ ClientLifeCycleManager lcmanager = control.createMock(ClientLifeCycleManager.class);
+ EasyMock.expect(bus.getExtension(ClientLifeCycleManager.class)).andReturn(lcmanager).anyTimes();
+ for (int i = 0; i < names.length; i++) {
+ ClientLifeCycleListener cl = control.createMock(ClientLifeCycleListener.class);
+ EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(cl).anyTimes();
+ if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excludes)) {
+ lcmanager.registerListener(cl);
+ EasyMock.expectLastCall();
+ }
+ }
+ }
+
+ private void setUpServerLifeCycleListeners(String[] names, String[] restricted, String excludes) throws Exception {
+ ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
+ EasyMock.expect(bundleContext.getServiceReferences(ServerLifeCycleListener.class.getName(), null))
+ .andReturn(svcrefs);
+ ServerLifeCycleManager lcmanager = control.createMock(ServerLifeCycleManager.class);
+ EasyMock.expect(bus.getExtension(ServerLifeCycleManager.class)).andReturn(lcmanager).anyTimes();
+ for (int i = 0; i < names.length; i++) {
+ ServerLifeCycleListener cl = control.createMock(ServerLifeCycleListener.class);
+ EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(cl).anyTimes();
+ if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excludes)) {
+ lcmanager.registerListener(cl);
+ EasyMock.expectLastCall();
+ }
+ }
+ }
+
+ private void setFeatures(String[] names, String[] restricted,
+ Collection<Feature> lst) throws Exception {
+ ServiceReference[] svcrefs = createTestServiceReferences(names, restricted);
+ EasyMock.expect(bundleContext.getServiceReferences(Feature.class.getName(), null))
+ .andReturn(svcrefs);
+ for (int i = 0; i < names.length; i++) {
+ Feature f = control.createMock(Feature.class);
+ EasyMock.expect(bundleContext.getService(svcrefs[i])).andReturn(f).anyTimes();
+ }
+ EasyMock.expect(bus.getFeatures()).andReturn(lst).anyTimes();
+
+ }
+
+ // Creates test service references with the specified symbolic names and the restricted extension properties.
+ private ServiceReference[] createTestServiceReferences(String[] names, String[] restricted) {
+ ServiceReference[] refs = new ServiceReference[names.length];
+ for (int i = 0; i < names.length; i++) {
+ refs[i] = createTestServiceReference(names[i], restricted[i]);
+ }
+ return refs;
+ }
+
+
+ // Creates a test service reference with the specified symbolic name and the restricted extension property.
+ private ServiceReference createTestServiceReference(String name, String rst) {
+ ServiceReference ref = control.createMock(ServiceReference.class);
+ Bundle b = control.createMock(Bundle.class);
+ EasyMock.expect(b.getSymbolicName()).andReturn(name).anyTimes();
+ EasyMock.expect(ref.getBundle()).andReturn(b).anyTimes();
+ EasyMock.expect(ref.getProperty("org.apache.cxf.bus.restricted.extension")).andReturn(rst).anyTimes();
+ return ref;
+ }
+
+ private static boolean isExcluded(String aname, String sname, String rst, String exc) {
+ if (!StringUtils.isEmpty(rst) && !aname.matches(rst)) {
+ return true;
+ }
+ return exc != null && sname.matches(exc);
+ }
+
+ private static int countServices(String[] names, String[] restricted, String excluded) {
+ int c = 0;
+ for (int i = 0; i < names.length; i++) {
+ if (!isExcluded(BUNDLE_NAME, names[i], restricted[i], excluded)) {
+ c++;
+ }
+ }
+ return c;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
index 60d6101..7d69da9 100644
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
@@ -25,12 +25,12 @@ import org.junit.Test;
import org.springframework.beans.BeansException;
public class BusApplicationContextTest extends Assert {
-
+
@Test
public void testGetResources() {
BusApplicationContext ctx = null;
- try {
+ try {
ctx = new BusApplicationContext("nowhere.xml", false);
fail("Bus creation should have thrown exception.");
} catch (BeansException bex) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
index 9b0b7a3..8ebdcbb 100644
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationListenerTest.java
@@ -30,7 +30,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BusApplicationListenerTest extends Assert {
-
+
@Test
public void testParentApplicationEvent() {
AbstractRefreshableApplicationContext parent = new ClassPathXmlApplicationContext();
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java b/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
index 2c63150..7377566 100644
--- a/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
@@ -40,12 +40,12 @@ import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BusDefinitionParserTest extends Assert {
-
+
@Test
public void testFeatures() {
String cfgFile = "org/apache/cxf/bus/spring/bus.xml";
Bus bus = new SpringBusFactory().createBus(cfgFile, true);
-
+
List<Interceptor<? extends Message>> in = bus.getInInterceptors();
boolean found = false;
for (Interceptor<? extends Message> i : in) {
@@ -54,7 +54,7 @@ public class BusDefinitionParserTest extends Assert {
}
}
assertTrue("could not find logging interceptor.", found);
-
+
Collection<Feature> features = bus.getFeatures();
TestFeature tf = null;
for (Feature f : features) {
@@ -63,23 +63,23 @@ public class BusDefinitionParserTest extends Assert {
break;
}
}
-
+
assertNotNull(tf);
assertTrue("test feature has not been initialised", tf.initialised);
assertNotNull("test feature has not been injected", tf.testBean);
assertTrue("bean injected into test feature has not been initialised", tf.testBean.initialised);
}
-
+
@Test
public void testBusConfigure() {
ClassPathXmlApplicationContext context = null;
try {
context = new ClassPathXmlApplicationContext("org/apache/cxf/bus/spring/customerBus.xml");
Bus cxf1 = (Bus)context.getBean("cxf1");
-
+
assertTrue(cxf1.getOutInterceptors().size() == 1);
assertTrue(cxf1.getInInterceptors().size() == 0);
-
+
Bus cxf2 = (Bus)context.getBean("cxf2");
assertTrue(cxf2.getInInterceptors().size() == 1);
assertTrue(cxf2.getOutInterceptors().size() == 0);
@@ -96,15 +96,15 @@ public class BusDefinitionParserTest extends Assert {
try {
context = new ClassPathXmlApplicationContext("org/apache/cxf/bus/spring/customerBus2.xml");
Bus cxf1 = (Bus)context.getBean("cxf1");
-
+
assertTrue(cxf1.getOutInterceptors().size() == 1);
assertTrue(cxf1.getInInterceptors().size() == 0);
-
+
Bus cxf2 = (Bus)context.getBean("cxf2");
-
+
assertTrue(cxf2.getInInterceptors().size() == 1);
assertTrue(cxf2.getOutInterceptors().size() == 0);
-
+
cxf2.getExtension(BusLifeCycleManager.class)
.registerLifeCycleListener(new BusLifeCycleListener() {
public void initComplete() {
@@ -116,7 +116,7 @@ public class BusDefinitionParserTest extends Assert {
public void postShutdown() {
b.set(true);
}
-
+
});
} finally {
if (context != null) {
@@ -143,18 +143,18 @@ public class BusDefinitionParserTest extends Assert {
static class TestBean {
boolean initialised;
-
+
@PostConstruct
public void initialise() {
initialised = true;
}
}
-
+
static class TestFeature extends AbstractFeature {
-
+
boolean initialised;
TestBean testBean;
-
+
@PostConstruct
public void initialise() {
initialised = true;
@@ -164,5 +164,5 @@ public class BusDefinitionParserTest extends Assert {
testBean = tb;
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java b/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
index bf4a96a..d366dbf 100644
--- a/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
+++ b/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
@@ -59,12 +59,12 @@ public class SpringBusFactoryTest extends Assert {
public void tearDown() {
BusFactory.setDefaultBus(null);
}
-
+
@Test
public void testDefault() {
Bus bus = new SpringBusFactory().createBus();
assertNotNull(bus);
- BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
+ BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
assertNotNull("No binding factory manager", bfm);
assertNotNull("No configurer", bus.getExtension(Configurer.class));
assertNotNull("No resource manager", bus.getExtension(ResourceManager.class));
@@ -74,27 +74,27 @@ public class SpringBusFactoryTest extends Assert {
assertNotNull("No workqueue manager", bus.getExtension(WorkQueueManager.class));
assertNotNull("No lifecycle manager", bus.getExtension(BusLifeCycleManager.class));
assertNotNull("No service registry", bus.getExtension(ServerRegistry.class));
-
+
try {
bfm.getBindingFactory("http://cxf.apache.org/unknown");
} catch (BusException ex) {
// expected
}
-
+
assertEquals("Unexpected interceptors", 0, bus.getInInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getInFaultInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutFaultInterceptors().size());
}
-
+
@Test
public void testCustomFileName() {
String cfgFile = "org/apache/cxf/bus/spring/resources/bus-overwrite.xml";
Bus bus = new SpringBusFactory().createBus(cfgFile, true);
checkCustomerConfiguration(bus);
}
-
+
@Test
public void testCustomerBusShutdown() {
String cfgFile = "org/apache/cxf/bus/spring/customerBus.xml";
@@ -102,23 +102,23 @@ public class SpringBusFactoryTest extends Assert {
// We have three bus here, which should be closed rightly
bus.shutdown(true);
}
-
+
@Test
public void testCustomFileURLFromSystemProperty() {
- URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");
+ URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");
System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_URL, cfgFileURL.toString());
Bus bus = new SpringBusFactory().createBus((String)null, true);
checkCustomerConfiguration(bus);
System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
}
-
+
@Test
public void testCustomFileURL() {
URL cfgFileURL = this.getClass().getResource("resources/bus-overwrite.xml");
Bus bus = new SpringBusFactory().createBus(cfgFileURL, true);
checkCustomerConfiguration(bus);
}
-
+
private void checkCustomerConfiguration(Bus bus) {
assertNotNull(bus);
List<Interceptor<? extends Message>> interceptors = bus.getInInterceptors();
@@ -135,7 +135,7 @@ public class SpringBusFactoryTest extends Assert {
assertEquals("Unexpected number of interceptors", 1, interceptors.size());
assertEquals("Unexpected interceptor", "out", interceptors.get(0).toString());
}
-
+
@Test
public void testForLifeCycle() {
BusLifeCycleListener bl = EasyMock.createMock(BusLifeCycleListener.class);
@@ -150,7 +150,7 @@ public class SpringBusFactoryTest extends Assert {
EasyMock.replay(bl);
bus.shutdown(true);
EasyMock.verify(bl);
-
+
}
@Test
@@ -176,42 +176,42 @@ public class SpringBusFactoryTest extends Assert {
assertTrue("@PreDestroy annoated method has been called already.", !te.preDestroyMethodCalled);
bus.shutdown(true);
assertTrue("@PreDestroy annotated method has not been called.", te.preDestroyMethodCalled);
-
+
}
@Test
public void testInitialisation() {
Bus bus = new SpringBusFactory().createBus("org/apache/cxf/bus/spring/init.xml");
- assertNotNull(bus.getExtension(TestListener.class));
+ assertNotNull(bus.getExtension(TestListener.class));
assertSame(bus, bus.getExtension(BusApplicationContext.class).getBean("cxf"));
}
-
+
static class TestInterceptor implements Interceptor<Message> {
private String name;
-
- TestInterceptor() {
+
+ TestInterceptor() {
}
-
+
public void setName(String n) {
name = n;
}
-
+
@Override
public String toString() {
return name;
}
-
- public void handleFault(Message message) {
+
+ public void handleFault(Message message) {
}
- public void handleMessage(Message message) throws Fault {
+ public void handleMessage(Message message) throws Fault {
}
-
- public void postHandleMessage(Message message) throws Fault {
+
+ public void postHandleMessage(Message message) throws Fault {
}
-
+
}
static class TestExtension {
@@ -222,7 +222,7 @@ public class SpringBusFactoryTest extends Assert {
TestExtension(Bus bus) {
bus.setExtension(this, TestExtension.class);
}
-
+
@PostConstruct
void postConstructMethod() {
postConstructMethodCalled = true;
@@ -233,7 +233,7 @@ public class SpringBusFactoryTest extends Assert {
preDestroyMethodCalled = true;
}
}
-
+
static class TestFeature extends AbstractFeature {
boolean initialised;
TestFeature() {
@@ -243,30 +243,30 @@ public class SpringBusFactoryTest extends Assert {
@Override
public void initialize(Bus bus) {
initialised = true;
- }
+ }
}
-
+
static class TestListener implements BusLifeCycleListener {
Bus bus;
-
+
@Resource
- public void setBus(Bus b) {
- bus = b;
+ public void setBus(Bus b) {
+ bus = b;
}
-
+
@PostConstruct
public void register() {
- bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
+ bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
}
-
+
public void initComplete() {
assertNull(bus.getExtension(TestFeature.class));
Collection<Feature> features = bus.getFeatures();
assertEquals(1, features.size());
TestFeature tf = (TestFeature)features.iterator().next();
assertTrue(tf.initialised);
- bus.setExtension(this, TestListener.class);
+ bus.setExtension(this, TestListener.class);
}
public void postShutdown() {
@@ -274,6 +274,6 @@ public class SpringBusFactoryTest extends Assert {
public void preShutdown() {
}
-
- }
+
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManagerTest.java b/core/src/test/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManagerTest.java
index cd68169..6e65590 100644
--- a/core/src/test/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManagerTest.java
+++ b/core/src/test/java/org/apache/cxf/buslifecycle/CXFBusLifeCycleManagerTest.java
@@ -48,13 +48,13 @@ public class CXFBusLifeCycleManagerTest extends Assert {
mgr.postShutdown();
EasyMock.verify(listener1);
}
-
+
@Test
public void testSingleListenerRegistration() {
BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();
-
+
mgr.registerLifeCycleListener(listener1);
EasyMock.reset(listener1);
@@ -73,35 +73,35 @@ public class CXFBusLifeCycleManagerTest extends Assert {
listener1.postShutdown();
EasyMock.replay(listener1);
mgr.postShutdown();
- EasyMock.verify(listener1);
+ EasyMock.verify(listener1);
}
-
+
@Test
public void testMultipleListeners() {
-
+
IMocksControl ctrl = EasyMock.createStrictControl();
-
+
BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();
mgr.registerLifeCycleListener(listener1);
mgr.registerLifeCycleListener(listener2);
-
+
ctrl.reset();
listener1.initComplete();
listener2.initComplete();
ctrl.replay();
mgr.initComplete();
ctrl.verify();
-
+
ctrl.reset();
listener2.preShutdown();
listener1.preShutdown();
ctrl.replay();
mgr.preShutdown();
ctrl.verify();
-
+
ctrl.reset();
listener2.postShutdown();
listener1.postShutdown();
@@ -109,12 +109,12 @@ public class CXFBusLifeCycleManagerTest extends Assert {
mgr.postShutdown();
ctrl.verify();
}
-
+
@Test
public void testDeregistration() {
-
+
IMocksControl ctrl = EasyMock.createStrictControl();
-
+
BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();
@@ -122,19 +122,19 @@ public class CXFBusLifeCycleManagerTest extends Assert {
mgr.registerLifeCycleListener(listener2);
mgr.registerLifeCycleListener(listener1);
mgr.unregisterLifeCycleListener(listener2);
-
+
ctrl.reset();
listener1.initComplete();
ctrl.replay();
mgr.initComplete();
ctrl.verify();
-
+
ctrl.reset();
listener1.preShutdown();
ctrl.replay();
mgr.preShutdown();
ctrl.verify();
-
+
ctrl.reset();
listener1.postShutdown();
ctrl.replay();
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/annotation/AnnotatedGreeterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/annotation/AnnotatedGreeterImpl.java b/core/src/test/java/org/apache/cxf/common/annotation/AnnotatedGreeterImpl.java
index fca985f..8390e51 100644
--- a/core/src/test/java/org/apache/cxf/common/annotation/AnnotatedGreeterImpl.java
+++ b/core/src/test/java/org/apache/cxf/common/annotation/AnnotatedGreeterImpl.java
@@ -33,16 +33,16 @@ import javax.xml.ws.WebServiceContext;
import org.apache.cxf.common.logging.LogUtils;
-@javax.jws.WebService(name = "Greeter", serviceName = "SOAPService",
+@javax.jws.WebService(name = "Greeter", serviceName = "SOAPService",
targetNamespace = "http://apache.org/hello_world_soap_http")
@HandlerChain(name = "TestHandlerChain", file = "handlers.xml")
public class AnnotatedGreeterImpl {
- private static final Logger LOG =
+ private static final Logger LOG =
LogUtils.getL7dLogger(AnnotatedGreeterImpl.class);
@Resource
- private int foo;
+ private int foo;
private WebServiceContext context;
@@ -106,7 +106,7 @@ public class AnnotatedGreeterImpl {
incrementInvocationCount("greetMe");
return "Bonjour " + me + "!";
}
-
+
@WebMethod
@RequestWrapper(className = "org.apache.hello_world_soap_http.types.GreetMeOneWay",
localName = "greetMeOneWay",
@@ -117,11 +117,11 @@ public class AnnotatedGreeterImpl {
System.out.println("That was OneWay to say hello");
}
- public void testDocLitFault(String faultType) {
+ public void testDocLitFault(String faultType) {
}
@Resource
- public void setContext(WebServiceContext ctx) {
+ public void setContext(WebServiceContext ctx) {
context = ctx;
}
@@ -130,12 +130,12 @@ public class AnnotatedGreeterImpl {
}
/**
- * stop eclipse from whinging
+ * stop eclipse from whinging
*/
- public int getFoo() {
+ public int getFoo() {
return foo;
}
-
+
private void incrementInvocationCount(String method) {
LOG.info("Executing " + method);
int n = invocationCount.get(method);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/annotation/AnnotationProcessorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/annotation/AnnotationProcessorTest.java b/core/src/test/java/org/apache/cxf/common/annotation/AnnotationProcessorTest.java
index 28335b6..7967cbe 100644
--- a/core/src/test/java/org/apache/cxf/common/annotation/AnnotationProcessorTest.java
+++ b/core/src/test/java/org/apache/cxf/common/annotation/AnnotationProcessorTest.java
@@ -38,79 +38,79 @@ import org.junit.Test;
public class AnnotationProcessorTest extends Assert {
- AnnotatedGreeterImpl greeterImpl = new AnnotatedGreeterImpl();
- AnnotationProcessor processor = new AnnotationProcessor(greeterImpl);
- List<Class<? extends Annotation>> expectedAnnotations = new ArrayList<Class<? extends Annotation>>();
+ AnnotatedGreeterImpl greeterImpl = new AnnotatedGreeterImpl();
+ AnnotationProcessor processor = new AnnotationProcessor(greeterImpl);
+ List<Class<? extends Annotation>> expectedAnnotations = new ArrayList<Class<? extends Annotation>>();
AnnotationVisitor visitor = EasyMock.createMock(AnnotationVisitor.class);
-
+
@Before
- public void setUp() {
- EasyMock.checkOrder(visitor, false);
- }
+ public void setUp() {
+ EasyMock.checkOrder(visitor, false);
+ }
@Test
- public void testVisitClass() {
+ public void testVisitClass() {
expectedAnnotations.add(WebService.class);
prepareCommonExpectations(visitor);
- visitor.visitClass(EasyMock.eq(AnnotatedGreeterImpl.class),
+ visitor.visitClass(EasyMock.eq(AnnotatedGreeterImpl.class),
EasyMock.isA(WebService.class));
runProcessor(visitor);
- }
+ }
@Test
- public void testVisitField() throws Exception {
+ public void testVisitField() throws Exception {
- Field expectedField = AnnotatedGreeterImpl.class.getDeclaredField("foo");
+ Field expectedField = AnnotatedGreeterImpl.class.getDeclaredField("foo");
expectedAnnotations.add(Resource.class);
prepareCommonExpectations(visitor);
- visitor.visitField(EasyMock.eq(expectedField),
+ visitor.visitField(EasyMock.eq(expectedField),
EasyMock.isA(Resource.class));
visitor.visitMethod((Method)EasyMock.anyObject(), (Annotation)EasyMock.anyObject());
runProcessor(visitor);
-
- }
+
+ }
@Test
public void testVisitMethod() throws Exception {
- Field expectedField = AnnotatedGreeterImpl.class.getDeclaredField("foo");
- Method expectedMethod1 = AnnotatedGreeterImpl.class.getDeclaredMethod("sayHi");
- Method expectedMethod2 = AnnotatedGreeterImpl.class.getDeclaredMethod("sayHi", String.class);
- Method expectedMethod3 = AnnotatedGreeterImpl.class.getDeclaredMethod("greetMe", String.class);
- Method expectedMethod4 =
- AnnotatedGreeterImpl.class.getDeclaredMethod("setContext", WebServiceContext.class);
+ Field expectedField = AnnotatedGreeterImpl.class.getDeclaredField("foo");
+ Method expectedMethod1 = AnnotatedGreeterImpl.class.getDeclaredMethod("sayHi");
+ Method expectedMethod2 = AnnotatedGreeterImpl.class.getDeclaredMethod("sayHi", String.class);
+ Method expectedMethod3 = AnnotatedGreeterImpl.class.getDeclaredMethod("greetMe", String.class);
+ Method expectedMethod4 =
+ AnnotatedGreeterImpl.class.getDeclaredMethod("setContext", WebServiceContext.class);
Method expectedMethod5 = AnnotatedGreeterImpl.class.getDeclaredMethod("greetMeOneWay", String.class);
expectedAnnotations.add(WebMethod.class);
- expectedAnnotations.add(Resource.class);
+ expectedAnnotations.add(Resource.class);
prepareCommonExpectations(visitor);
- visitor.visitField(EasyMock.eq(expectedField),
+ visitor.visitField(EasyMock.eq(expectedField),
EasyMock.isA(Resource.class));
- visitor.visitMethod(EasyMock.eq(expectedMethod1),
+ visitor.visitMethod(EasyMock.eq(expectedMethod1),
EasyMock.isA(WebMethod.class));
- visitor.visitMethod(EasyMock.eq(expectedMethod2),
+ visitor.visitMethod(EasyMock.eq(expectedMethod2),
EasyMock.isA(WebMethod.class));
- visitor.visitMethod(EasyMock.eq(expectedMethod3),
+ visitor.visitMethod(EasyMock.eq(expectedMethod3),
EasyMock.isA(WebMethod.class));
- visitor.visitMethod(EasyMock.eq(expectedMethod4),
+ visitor.visitMethod(EasyMock.eq(expectedMethod4),
EasyMock.isA(Resource.class));
- visitor.visitMethod(EasyMock.eq(expectedMethod5),
+ visitor.visitMethod(EasyMock.eq(expectedMethod5),
EasyMock.isA(WebMethod.class));
runProcessor(visitor);
}
@Test
- public void testProcessorInvalidConstructorArgs() {
-
+ public void testProcessorInvalidConstructorArgs() {
+
try {
- new AnnotationProcessor(null);
+ new AnnotationProcessor(null);
fail("did not get expected argument");
} catch (IllegalArgumentException e) {
// happy
@@ -119,7 +119,7 @@ public class AnnotationProcessorTest extends Assert {
}
@Test
- public void testProcessorInvalidAcceptArg() {
+ public void testProcessorInvalidAcceptArg() {
try {
processor.accept(null);
@@ -128,7 +128,7 @@ public class AnnotationProcessorTest extends Assert {
// happy
}
- }
+ }
private void prepareCommonExpectations(AnnotationVisitor v) {
@@ -137,10 +137,10 @@ public class AnnotationProcessorTest extends Assert {
v.setTarget(greeterImpl);
}
- private void runProcessor(AnnotationVisitor v) {
- EasyMock.replay(v);
+ private void runProcessor(AnnotationVisitor v) {
+ EasyMock.replay(v);
processor.accept(v);
- EasyMock.verify(v);
- }
+ EasyMock.verify(v);
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/i18n/BundleUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/i18n/BundleUtilsTest.java b/core/src/test/java/org/apache/cxf/common/i18n/BundleUtilsTest.java
index 1ee7305..1c4019f 100644
--- a/core/src/test/java/org/apache/cxf/common/i18n/BundleUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/i18n/BundleUtilsTest.java
@@ -40,13 +40,13 @@ public class BundleUtilsTest extends Assert {
public void testGetBundle() throws Exception {
ResourceBundle bundle = BundleUtils.getBundle(getClass());
assertNotNull("expected resource bundle", bundle);
- assertEquals("unexpected resource",
+ assertEquals("unexpected resource",
"localized message",
bundle.getString("I18N_MSG"));
ResourceBundle nonDefaultBundle = BundleUtils.getBundle(getClass(), "Messages");
assertNotNull("expected resource bundle", nonDefaultBundle);
- assertEquals("unexpected resource",
+ assertEquals("unexpected resource",
"localized message",
- nonDefaultBundle.getString("I18N_MSG"));
+ nonDefaultBundle.getString("I18N_MSG"));
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/common/i18n/MessageTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/i18n/MessageTest.java b/core/src/test/java/org/apache/cxf/common/i18n/MessageTest.java
index 1fe7428..1585b48 100644
--- a/core/src/test/java/org/apache/cxf/common/i18n/MessageTest.java
+++ b/core/src/test/java/org/apache/cxf/common/i18n/MessageTest.java
@@ -33,16 +33,16 @@ import org.junit.Test;
public class MessageTest extends Assert {
private static final Logger LOG = LogUtils.getL7dLogger(MessageTest.class);
-
+
@Test
public void testMessageWithLoggerBundle() throws Exception {
Message msg = new Message("SUB1_EXC", LOG, new Object[] {1});
assertSame("unexpected resource bundle",
LOG.getResourceBundle(),
msg.bundle);
- assertEquals("unexpected message string",
- "subbed in 1 only",
- msg.toString());
+ assertEquals("unexpected message string",
+ "subbed in 1 only",
+ msg.toString());
}
@Test
@@ -50,11 +50,11 @@ public class MessageTest extends Assert {
ResourceBundle bundle = BundleUtils.getBundle(getClass());
Message msg = new Message("SUB2_EXC", bundle, new Object[] {3, 4});
assertSame("unexpected resource bundle", bundle, msg.bundle);
- assertEquals("unexpected message string",
+ assertEquals("unexpected message string",
"subbed in 4 & 3",
- msg.toString());
+ msg.toString());
}
-
+
@Test
public void testExceptionIO() throws java.lang.Exception {
ResourceBundle bundle = BundleUtils.getBundle(getClass());
@@ -64,13 +64,13 @@ public class MessageTest extends Assert {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bout);
out.writeObject(ex);
-
+
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
ObjectInputStream in = new ObjectInputStream(bin);
Object o = in.readObject();
assertTrue(o instanceof UncheckedException);
UncheckedException ex2 = (UncheckedException)o;
assertEquals("subbed in 4 & 3", ex2.getMessage());
-
+
}
}