Skip to content
Permalink
Browse files
Refactored the NAnt scripts to link in the correct framework assembli…
…es for the given target framework. Several code changes were necessary now that the .NET Compact Framework was actually being compiled. Several code enhancements had been made that were incompatible with .NET CF 2.0.

Fixes [AMQNET-142]. (See https://issues.apache.org/activemq/browse/AMQNET-142)
  • Loading branch information
Jim Gomes committed Feb 20, 2009
1 parent 1554de3 commit ee44286c723cfda15016676cba39ca0cebf22681
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 95 deletions.
@@ -41,6 +41,7 @@
<property name="current.build.framework" value="${framework::get-target-framework()}" overwrite="false"/>
<property name="current.build.defines" value="${build.defines}" />
<property name="build.framework.strings" value="net-1.1,net-2.0,net-3.5,mono-2.0,netcf-2.0"/>
<property name="current.build.framework.assembly.dir" value="${framework::get-assembly-directory(framework::get-target-framework())}" dynamic="true"/>

<if test="${build.skip.release}">
<property name="build.config.strings" value="debug"/>
@@ -48,16 +48,16 @@
<target name="dependency-init" description="Initializes build dependencies">

<assemblyfileset failonempty="true" id="dependencies">
<include name="mscorlib.dll" asis="true"/>
<include name="System.dll" asis="true"/>
<include name="System.Web.dll" asis="true"/>
<include name="System.Xml.dll" asis="true"/>
<include name="${current.build.framework.assembly.dir}/mscorlib.dll"/>
<include name="${current.build.framework.assembly.dir}/System.dll"/>
<include name="${current.build.framework.assembly.dir}/System.Web.dll"/>
<include name="${current.build.framework.assembly.dir}/System.Xml.dll"/>
</assemblyfileset>

<assemblyfileset failonempty="true" id="test.dependencies">
<include name="mscorlib.dll" asis="true"/>
<include name="System.dll" asis="true"/>
<include name="System.Xml.dll" asis="true"/>
<include name="${current.build.framework.assembly.dir}/mscorlib.dll"/>
<include name="${current.build.framework.assembly.dir}/System.dll"/>
<include name="${current.build.framework.assembly.dir}/System.Xml.dll"/>
<include name="${build.bin.dir}/${project.name}.dll"/>
<include name="${nunit.dll}"/>
<include name="${nunit.extensions.dll}"/>
@@ -5,7 +5,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
// Runtime Version:2.0.50727.3082
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -1,18 +1,19 @@
//
// Copyright 2001-2006 The Apache Software Foundation
//
// Licensed 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.
//
/*
* 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.
*/

namespace Apache.NMS
{
@@ -33,7 +34,7 @@ public interface ITrace
void Info(string message);
void Warn(string message);
void Error(string message);
void Fatal(object message);
void Fatal(string message);

bool IsDebugEnabled { get; }
bool IsInfoEnabled { get; }
@@ -20,7 +20,9 @@
using System.Globalization;
using System.Reflection;
using System.Text;
#if !NETCF
using System.Web;
#endif

namespace Apache.NMS.Util
{
@@ -28,14 +28,15 @@ public class AsyncConsumeTest : NMSTestSupport
protected static string DESTINATION_NAME = "AsyncConsumeDestination";
protected static string TEST_CLIENT_ID = "AsyncConsumeClientId";
protected static string RESPONSE_CLIENT_ID = "AsyncConsumeResponseClientId";
protected object semaphore = new object();
protected AutoResetEvent semaphore;
protected bool received;
protected IMessage receivedMsg;

[SetUp]
public override void SetUp()
{
base.SetUp();
semaphore = new AutoResetEvent(false);
received = false;
receivedMsg = null;
}
@@ -246,24 +247,14 @@ protected void OnQueueMessage(IMessage message)

protected void OnMessage(IMessage message)
{
lock(semaphore)
{
receivedMsg = message;
received = true;
Monitor.PulseAll(semaphore);
}
receivedMsg = message;
received = true;
semaphore.Set();
}

protected void WaitForMessageToArrive()
{
lock(semaphore)
{
if(!received)
{
Monitor.Wait(semaphore, receiveTimeout);
}
}

semaphore.WaitOne((int) receiveTimeout.TotalMilliseconds, true);
Assert.IsTrue(received, "Should have received a message by now!");
}
}
@@ -5,7 +5,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
// Runtime Version:2.0.50727.3082
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -92,6 +92,8 @@ public void TestDurableConsumerSelectorChange(bool persistent)
}
}

// The .NET CF does not have the ability to interrupt threads, so this test is impossible.
#if !NETCF
[Test]
public void TestNoTimeoutConsumer()
{
@@ -144,5 +146,6 @@ protected void TimeoutConsumerThreadProc()
Assert.Fail("Test failed with exception: " + e.Message);
}
}
#endif
}
}
@@ -1,61 +1,87 @@
/*
* 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.
*/

using System;
using System.Diagnostics;

namespace Apache.NMS.Test
{
public class NmsTracer : Apache.NMS.ITrace
{
#region ITrace Members
public void Debug(string message)
{
Trace.WriteLine("DEBUG: " + message);
}

public void Error(string message)
{
Trace.WriteLine("ERROR: " + message);
}

public void Fatal(object message)
{
Trace.WriteLine("FATAL: " + message);
}

public void Info(string message)
{
Trace.WriteLine("INFO: " + message);
}

public void Warn(string message)
{
Trace.WriteLine("WARN: " + message);
}

public bool IsDebugEnabled
{
get { return true; }
}

public bool IsErrorEnabled
{
get { return true; }
}

public bool IsFatalEnabled
{
get { return true; }
}

public bool IsInfoEnabled
{
get { return true; }
}

public bool IsWarnEnabled
{
get { return true; }
}

#endregion
}
{
#region ITrace Members
public void Debug(string message)
{
#if !NETCF
System.Diagnostics.Trace.WriteLine(string.Format("DEBUG: {0}", message));
#endif
}

public void Error(string message)
{
#if !NETCF
System.Diagnostics.Trace.WriteLine(string.Format("ERROR: {0}", message));
#endif
}

public void Fatal(string message)
{
#if !NETCF
System.Diagnostics.Trace.WriteLine(string.Format("FATAL: {0}", message));
#endif
}

public void Info(string message)
{
#if !NETCF
System.Diagnostics.Trace.WriteLine(string.Format("INFO: {0}", message));
#endif
}

public void Warn(string message)
{
#if !NETCF
System.Diagnostics.Trace.WriteLine(string.Format("WARN: {0}", message));
#endif
}

public bool IsDebugEnabled
{
get { return true; }
}

public bool IsErrorEnabled
{
get { return true; }
}

public bool IsFatalEnabled
{
get { return true; }
}

public bool IsInfoEnabled
{
get { return true; }
}

public bool IsWarnEnabled
{
get { return true; }
}

#endregion
}
}

0 comments on commit ee44286

Please sign in to comment.