Skip to Content.
Sympa Menu

notify-dpml - r1795 - in trunk/tutorials/components/unit/src: main/acme test/acme/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1795 - in trunk/tutorials/components/unit/src: main/acme test/acme/test
  • Date: Sun, 3 Dec 2006 08:10:31 +0100

Author: mcconnell
Date: 2006-12-03 08:10:30 +0100 (Sun, 03 Dec 2006)
New Revision: 1795

Modified:
trunk/tutorials/components/unit/src/main/acme/Child.java
trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
trunk/tutorials/components/unit/src/main/acme/Container.java
trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
Log:
Update unit test example to include copyright attribution and formalization
with respect to style guidelines.

Modified: trunk/tutorials/components/unit/src/main/acme/Child.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03
06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/Child.java 2006-12-03
07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim�nez.
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * 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.
+ */
package acme;

import java.net.URI;

Modified: trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/ChildImpl.java
2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim�nez.
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * 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.
+ */
package acme;

import java.net.URI;
@@ -5,31 +23,37 @@

public class ChildImpl implements Child
{
- private boolean started;
- private Logger logger;
+ private boolean m_started;
+ private Logger m_logger;

- public ChildImpl( Logger logger )
+ public ChildImpl( final Logger logger )
{
- this.started = false;
- this.logger = logger;
+ m_started = false;
+ m_logger = logger;
}

- public void start( URI configurationURI ) throws Exception {
- if ( !this.started ){
- this.started = true;
- this.logger.info( "starting with: " + configurationURI );
- } else {
+ public void start( final URI uri ) throws Exception
+ {
+ if( !m_started )
+ {
+ m_started = true;
+ m_logger.info( "starting with: " + uri );
+ }
+ else
+ {
throw new Exception( "already started!" );
}
}

- public void stop() throws Exception {
- if ( this.started ){
- this.started = false;
- this.logger.info( "stopping" );
- } else {
- throw new Exception("not started!" );
+ public void stop() throws Exception
+ {
+ if ( m_started ){
+ m_started = false;
+ m_logger.info( "stopping" );
+ }
+ else
+ {
+ throw new Exception( "Not started!" );
}
}
-
}

Modified: trunk/tutorials/components/unit/src/main/acme/Container.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/Container.java
2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/Container.java
2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim�nez.
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * 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.
+ */
package acme;

public interface Container

Modified: trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
===================================================================
--- trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/main/acme/ContainerImpl.java
2006-12-03 07:10:30 UTC (rev 1795)
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2006 Juan Pablo Rojas Jim�nez.
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * 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.
+ */
package acme;

import java.net.URI;

Modified: trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
===================================================================
--- trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
2006-12-03 06:00:20 UTC (rev 1794)
+++ trunk/tutorials/components/unit/src/test/acme/test/ExampleTest.java
2006-12-03 07:10:30 UTC (rev 1795)
@@ -45,11 +45,10 @@
m_logger.info( "decommissioning" );
Disposable disposable = (Disposable) m_component;
disposable.dispose();
- System.gc();
}

/**
- * The Component instance exposes a buch of management operations. One
+ * The Component instance exposes a bunch of management operations. One
* of these is the operation getProvider() which gives us access to
* the manager of one instance of the class specificed by the component
* type. The provider exposes the operation getValue( boolean ) which
@@ -66,7 +65,7 @@
Provider provider = m_component.getProvider();
ContainerImpl container = (ContainerImpl) provider.getValue( false );

- // Any tests dealing with the instance would go here.
+ // Any test assertions go here.
}

/**




  • r1795 - in trunk/tutorials/components/unit/src: main/acme test/acme/test, mcconnell at BerliOS, 12/03/2006

Archive powered by MHonArc 2.6.24.

Top of Page