Skip to content
Permalink
Browse files
Added packaging script file.
  • Loading branch information
Jim Gomes committed Mar 9, 2009
1 parent 1c6c999 commit cc023ce42e69a0097f90ffdf7d5d55ed4a0170d5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 84 deletions.
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$pkgname = "Apache.NMS"
$pkgver = "1.1.0"
$configurations = "release", "debug"
$frameworks = "mono-2.0", "net-1.1", "net-2.0", "net-3.5", "netcf-2.0"
@@ -36,47 +37,47 @@ $pkgdir = "..\package"
write-progress "Packaging Application files." "Scanning..."
foreach($configuration in $configurations)
{
$zipfile = "$pkgdir\Apache.NMS-$pkgver-bin-$configuration.zip"
$zipfile = "$pkgdir\$pkgname-$pkgver-bin-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.dll"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll"
}
}

write-progress "Packaging PDB files." "Scanning..."
foreach($configuration in $configurations)
{
$zipfile = "$pkgdir\Apache.NMS-$pkgver-PDBs-$configuration.zip"
$zipfile = "$pkgdir\$pkgname-$pkgver-PDBs-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
{
if($framework -ieq "mono-2.0")
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.dll.mdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll.mdb"
}
else
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.pdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.pdb"
}
}
}

write-progress "Packaging Unit test files." "Scanning..."
foreach($configuration in $configurations)
{
$zipfile = "$pkgdir\Apache.NMS-$pkgver-UnitTests-$configuration.zip"
$zipfile = "$pkgdir\$pkgname-$pkgver-UnitTests-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.Test.dll"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll"
if($framework -ieq "mono-2.0")
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.Test.dll.mdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll.mdb"
}
else
{
zip -9 -u "$zipfile" "$framework\$configuration\Apache.NMS.Test.pdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.pdb"
}
}
}
@@ -85,9 +86,9 @@ popd

write-progress "Packaging Source code files." "Scanning..."
$pkgdir = "package"
$zipfile = "$pkgdir\Apache.NMS-$pkgver-src.zip"
$zipfile = "$pkgdir\$pkgname-$pkgver-src.zip"

zip -9 -u "$zipfile" LICENSE.txt NOTICE.txt nant-common.xml nant.build package.ps1 vs2008-nms-test.csproj vs2008-nms.csproj vs2008-nms.sln
zip -9 -u -r "$zipfile" keyfile lib src
zip -9 -u -r "$zipfile" keyfile src

write-progress "Packaging" "Complete."
@@ -14,8 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;
using NUnit.Framework;
using NUnit.Framework;
using NUnit.Framework.Extensions;

namespace Apache.NMS.Test
{
@@ -41,78 +43,54 @@ public void TwoConnections()
}
}

/// <summary>
/// Verify disposing a connection after a consumer has been created and disposed.
/// </summary>
[Test]
public void DisposeConnectionAfterDisposingConsumer()
{
CreateAndDisposeWithConsumer(true);
}

/// <summary>
/// Verify disposing a connection after a consumer has been created but not disposed.
/// </summary>
[Test]
public void DisposeConnectionWithoutDisposingConsumer()
{
CreateAndDisposeWithConsumer(false);
}

/// <summary>
/// Verify disposing a connection after a producer has been created and disposed.
/// </summary>
[Test]
public void DisposeConnectionAfterDisposingProducer()
{
CreateAndDisposeWithProducer(true);
}

/// <summary>
/// Verify disposing a connection after a producer has been created but not disposed.
/// </summary>
[Test]
public void DisposeConnectionWithoutDisposingProducer()
{
CreateAndDisposeWithProducer(false);
}

private void CreateAndDisposeWithConsumer(bool disposeConsumer)
{
IConnection connection = CreateConnection("DisposalTestConnection");
connection.Start();

ISession session = connection.CreateSession();
IQueue queue = session.GetQueue("DisposalTestQueue");

IMessageConsumer consumer = session.CreateConsumer(queue);

connection.Stop();

if (disposeConsumer)
consumer.Dispose();

session.Dispose();
connection.Dispose();
}

private void CreateAndDisposeWithProducer(bool disposeProducer)
{
IConnection connection = CreateConnection("DisposalTestConnection");
connection.Start();

ISession session = connection.CreateSession();
IQueue queue = session.GetQueue("DisposalTestQueue");

IMessageProducer producer = session.CreateProducer(queue);

connection.Stop();

if (disposeProducer)
producer.Dispose();

session.Dispose();
connection.Dispose();
#if !NET_1_1
[RowTest]
[Row(true)]
[Row(false)]
#endif
public void CreateAndDisposeWithConsumer(bool disposeConsumer)
{
using(IConnection connection = CreateConnection("DisposalTestConnection"))
{
connection.Start();

using(ISession session = connection.CreateSession())
{
IQueue queue = session.GetQueue("DisposalTestQueue");
IMessageConsumer consumer = session.CreateConsumer(queue);

connection.Stop();
if(disposeConsumer)
{
consumer.Dispose();
}
}
}
}

#if !NET_1_1
[RowTest]
[Row(true)]
[Row(false)]
#endif
public void CreateAndDisposeWithProducer(bool disposeProducer)
{
using(IConnection connection = CreateConnection("DisposalTestConnection"))
{
connection.Start();

using(ISession session = connection.CreateSession())
{
IQueue queue = session.GetQueue("DisposalTestQueue");
IMessageProducer producer = session.CreateProducer(queue);

connection.Stop();
if(disposeProducer)
{
producer.Dispose();
}
}
}
}
}
}

0 comments on commit cc023ce

Please sign in to comment.