# HG changeset patch # User Jaroslav Tulach # Date 1213429972 -7200 # Node ID 02e05defc6a03ace97445b91149c278a17762664 # Parent be49ca0fff337253e9621e30649a2b0cb4a75665 URLs in apifest chapter replaced with code snippets diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java --- a/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day2/elementbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit.java Sat Jun 14 09:52:52 2008 +0200 @@ -19,8 +19,7 @@ package org.netbeans.apifest.boolcircuit; -/** - */ +// BEGIN: apifest.day2.elementbasedsolution.Circuit public final class Circuit { private Circuit() { } @@ -113,3 +112,4 @@ public double computeResult(double... values); } } +// END: apifest.day2.elementbasedsolution.Circuit diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java --- a/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Element.java Sat Jun 14 09:52:52 2008 +0200 @@ -96,9 +96,9 @@ }; } + // BEGIN: apifest.day2.pinbasedsolution.FunctionFactory /** * Creates an Element with user-defined transfer function. - * */ public static Element createGate(final Element source1, final Element source2, final Function function) { return new Element() { @@ -115,5 +115,5 @@ } }; } - + // END: apifest.day2.pinbasedsolution.FunctionFactory } diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java --- a/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day2/pinbasedsolution/src/org/netbeans/apifest/boolcircuit/Function.java Sat Jun 14 09:52:52 2008 +0200 @@ -1,19 +1,10 @@ -/* - * Function.java - * - * Created on 13. Ĩervenec 2006, 14:40 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - package org.netbeans.apifest.boolcircuit; +// BEGIN: apifest.day2.pinbasedsolution.Function /** * An abstract transfer function of a gate. - * @author nenik */ public abstract class Function { - public abstract double evaluate(double input1, double input2); } +// END: apifest.day2.pinbasedsolution.Function diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java --- a/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 @@ -6,6 +6,7 @@ /** Write a test that works with version from day A and fails with version B. */ +// BEGIN: apifest.day3.against-alwayscreatenewcircuit public class CircuitTest extends TestCase { public CircuitTest(String n) { super(n); @@ -16,3 +17,4 @@ assertEquals(null, Circuit.or(false, false).getClass().getSuperclass().getSuperclass().getSuperclass()); } } +// END: apifest.day3.against-alwayscreatenewcircuit diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java --- a/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 @@ -46,6 +46,7 @@ /** Write a test that works with version from day A and fails with version B. */ +// BEGIN: apifest.day3.against-elementbasedsolution public class CircuitTest extends TestCase { public CircuitTest(String n) { super(n); @@ -61,3 +62,6 @@ assertTrue (circuit.result()); } } +// END: apifest.day3.against-elementbasedsolution + + diff -r be49ca0fff33 -r 02e05defc6a0 samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java --- a/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:52 2008 +0200 @@ -1,43 +1,3 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ package apifest; import junit.framework.TestCase; @@ -46,6 +6,7 @@ /** Write a test that works with version from day A and fails with version B. */ +// BEGIN: apifest.day3.against-welltestedsolution public class CircuitTest extends TestCase { public CircuitTest(String n) { super(n); @@ -65,3 +26,4 @@ return base.substring(last+1); } } +// END: apifest.day3.against-welltestedsolution