Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10581

Re: Question re testing constructor

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!n6g2000vbg.googlegroups.com!not-for-mail
From Henk van Voorthuijsen <voorth@xs4all.nl>
Newsgroups comp.lang.java.programmer
Subject Re: Question re testing constructor
Date Wed, 7 Dec 2011 00:33:26 -0800 (PST)
Organization http://groups.google.com
Lines 21
Message-ID <f1a7cd27-e8eb-4d63-8f52-5eda7cd0c0a2@n6g2000vbg.googlegroups.com> (permalink)
References <Xns9FB3682A7DBF6jpnasty@94.75.214.39>
NNTP-Posting-Host 62.177.210.148
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1323246806 25090 127.0.0.1 (7 Dec 2011 08:33:26 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 7 Dec 2011 08:33:26 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info n6g2000vbg.googlegroups.com; posting-host=62.177.210.148; posting-account=DLluPQoAAADpLqA-CJJnTqb8oHjtnsVZ
User-Agent G2/1.0
X-HTTP-Via 1.1 PI-PROXY-01
X-Google-Web-Client true
X-Google-Header-Order VCRUHALSNK
X-HTTP-UserAgent Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10581

Show key headers only | View raw


On Dec 6, 4:14 pm, Novice <novice@example..com> wrote:

>
> If that is right, then it seems that this should test the existence of the
> object well enough:
>
>         Set<String> testValues = new HashSet<String>();
>         testValues.add("FF0000");
>         testValues.add("66CC99");
>
>         for (String key : testValues) {
>                 HexColor hexColor = new HexColor(key);
>                 if (hexColor == null) {
>                         assertTrue("The HexColor has been created for input value,
> " + key + ", but has been found to be null.", false);
>                 }
>         }

To assert an objects existence, use assertNotNull().

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Question re testing constructor Novice <novice@example..com> - 2011-12-06 15:14 +0000
  Re: Question re testing constructor markspace <-@.> - 2011-12-06 07:23 -0800
    Re: Question re testing constructor Novice <novice@example..com> - 2011-12-06 17:17 +0000
    Re: Question re testing constructor Tom Anderson <twic@urchin.earth.li> - 2011-12-06 21:25 +0000
    Re: Question re testing constructor Ian Shef <invalid@avoiding.spam> - 2011-12-07 00:29 +0000
      Re: Question re testing constructor Patricia Shanahan <pats@acm.org> - 2011-12-06 19:28 -0800
      Re: Question re testing constructor Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-12-06 22:57 -0600
      Re: Question re testing constructor Lew <lewbloch@gmail.com> - 2011-12-07 07:12 -0800
      Re: Question re testing constructor Lew <lewbloch@gmail.com> - 2011-12-07 07:14 -0800
        Re: Question re testing constructor Ian Shef <invalid@avoiding.spam> - 2011-12-07 15:59 +0000
          Re: Question re testing constructor Ian Shef <invalid@avoiding.spam> - 2011-12-08 19:19 +0000
      Re: Question re testing constructor ilAn <idonot@wantspam.net> - 2011-12-07 20:41 +0200
  Re: Question re testing constructor Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-12-06 07:34 -0800
    Re: Question re testing constructor Novice <novice@example..com> - 2011-12-06 17:15 +0000
  Re: Question re testing constructor Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-12-06 09:49 -0800
  Re: Question re testing constructor Roedy Green <see_website@mindprod.com.invalid> - 2011-12-06 16:40 -0800
  Re: Question re testing constructor Henk van Voorthuijsen <voorth@xs4all.nl> - 2011-12-07 00:33 -0800

csiph-web