Fixed Spring.ServiceModel.ServiceExporter (SPRNET-1416)

This commit is contained in:
bbaia
2011-03-30 08:40:04 +00:00
parent d1b05216ab
commit d180df8a12
2 changed files with 16 additions and 12 deletions

View File

@@ -109,8 +109,8 @@ namespace Spring.ServiceModel
return objectFactory.GetObject(serviceName) as Type;
}
return new ServiceProxyTypeBuilder(serviceName, objectFactory.GetType(serviceName), useServiceProxyTypeCache)
.BuildProxyType(objectFactory);
return new ServiceProxyTypeBuilder(serviceName, objectFactory, useServiceProxyTypeCache)
.BuildProxyType();
}
#endregion

View File

@@ -66,16 +66,8 @@ namespace Spring.ServiceModel
se = new ServiceExporter();
se.ObjectFactory = objectFactory;
}
}
[Test]
//SPRNET-1262
public void ProxiesDeclarativeAttributeWithConstructorArguments()
@@ -98,7 +90,6 @@ namespace Spring.ServiceModel
</object>
</objects>";
using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
{
objectFactory = new XmlObjectFactory(new InputStreamResource(stream, string.Empty));
@@ -131,6 +122,20 @@ namespace Spring.ServiceModel
se.AfterPropertiesSet();
}
[Test] // SPRNET-1416
public void CallProxy()
{
se.ObjectName = "ProxiesContractInterface";
se.TargetName = "service";
se.AfterPropertiesSet();
Type proxyType = se.GetObject() as Type;
Assert.IsNotNull(proxyType);
IContract proxy = Activator.CreateInstance(proxyType) as IContract;
Assert.IsNotNull(proxyType);
Assert.AreEqual("1979", proxy.SomeMethod(1979));
}
[Test]
public void ProxiesContractInterface()
{
@@ -355,7 +360,6 @@ namespace Spring.ServiceModel
//}
#endregion
}
}
#endif