'ITWeb/개발일반'에 해당되는 글 489건

  1. 2010.03.15 SiteMesh 매뉴얼 정리본
  2. 2010.03.11 xwork configuration
  3. 2010.02.02 Quirks mode
  4. 2010.01.07 The document tree - Sibling
  5. 2009.10.20 Shell Redirection
  6. 2009.07.27 [PERL] HTML 메일 발송 테스트
  7. 2009.07.22 [PERL] 메일 발송 테스트
  8. 2009.07.13 [PERL] 지정한 경로의 디렉토리 or 파일 검증.
  9. 2009.05.12 [펌] Java Annotation
  10. 2009.05.12 [링크]Eclipse 에서 JUnit 사용하기

SiteMesh 매뉴얼 정리본

ITWeb/개발일반 2010. 3. 15. 17:40
주관적으로 필요한 내용만 발췌해서 정리한 문서 입니다.
원문은 opensymphony 에서 보시면 됩니다.

원문링크 : http://www.opensymphony.com/sitemesh/


SiteMesh Flow Diagram


Character Sets

1. If possible, the web application should be configured to use UTF-8 as the default encoding. Orion allows this to be specific in orion-web.xml, as the default-charset attribute. Weblogic requires a context parameter named weblogic.httpd.inputCharset. See your application server documentation for more details. If the application server of choice does not allow to set the default charset for all web-apps, then every page (including the decorators) will need to specify the content-type. This is done by specifying a page header tag like this:

<%@ page contentType="text/html; charset=utf-8"%>

Note that some older versions of Orion do not respect the contentType page directive in included pages, so to be on the safe side, this directive should be specified in ALL pages, not just the top level one (one could use an include).

2. The next step is to inform the browser that the page contents are of a specific character set. This is done by specifying a meta tag in the HEAD element of the html page, like this:

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">

3. The final step is informing SiteMesh's decorator mechanism that it should use a specific encoding other than the default. This is done by specifying an encoding attribute to the applyDecorator tag with the name of the encoding to use.

<page:applyDecorator name="form" encoding="utf-8">
    ...
</page:applyDecorator>


SiteMesh Tags
원문링크 : http://www.opensymphony.com/sitemesh/tags.html

아래 코드들에 대해서 <page:applyDecorator...></page:applyDecorator> 한 페이지에 포함이 된 값들은 original page's HTML 범주에 포함이 되지 않습니다.
다시 말해 <decorator:TAGS /> 를 사용하기 위해서는 1 depth 까지만 적용 된다는 점을 감안 해셔서 사용하세요.
아래 예는 단순 비교 입니다... ^^;; 감안 하시길..
좋은예의 경우 <decorator:title> 이 original page's 의 title 값으로 변경이 되지만 나쁜예의 경우는 변경이 되지 않습니다.

좋은 예)
defaultLayout.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<html lang="ko">
<head>
<title><decorator:title default="INDEX" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
document.domain=".naver.com";
//-->
</script>
<decorator:head /> <!-- 이 부분은 original page's HTML 에서 <head></head>사이의 코드를 append 합니다. -->
</head>
<decorator:body />
<page:applyDecorator name="bbsFooterLayout" />

나쁜 예)
defaultLayout.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<page:applyDecorator  name="bbsHeaderLayout" />
<decorator:body/>
<page:applyDecorator name="bbsFooterLayout" />

Decorator Tags

These tags are used to create page Decorators. A Decorator is typically built up from an HTML layout (or whatever is appropriate for the original page content-type) with these tags inserted to provide place-holders for the data from the original (undecorated) page.

For more details, see Building Decorators.

<decorator:head />

Description:

Insert contents of original page's HTML <head> tag. The enclosing tag will not be be written, but its contents will.

Attributes:

  • None

<decorator:body />

Description:

Insert contents of original page's HTML <body> tag. The enclosing tag will not be be written, but its contents will.

Note: the content of the body onload and onunload events (and other body attributes) can be included in the decorator by getting the property body.onload and body.onunload (the named attributes).
For example (the decorator): <body onload="<decorator:getProperty property="body.onload" />">

For more information: see getProperty.

Attributes:

  • None

<decorator:title [ default="..." ] />

Description:

Insert title of original page (obtained from <title> tag). will be used instead.

Attributes:

  • default (optional)
    Value to be inserted if title not found.

<decorator:getProperty property="..." [ default="..." ] [ writeEntireProperty="..." ]/>

Description:

Insert property of original page. See API reference for HTMLPage for details of how properties are obtained from a page.

Attributes:

  • property (required)
    Name (key) of property to insert.

  • default (optional)
    Value to be inserted if property not found.

  • writeEntireProperty (optional)
    This writes the property with a space in front including the name ( propertyName="propertyValue")
    Accepted values are true, yes and 1.
    For example:
    The decorator: <body bgcolor="White"<decorator:getProperty property="body.onload" writeEntireProperty="true" />>
    The undecorated page: <body onload="document.someform.somefield.focus();">
    The decorated page: <body bgcolor="White" onload="document.someform.somefield.focus();">

<decorator:usePage id="..." />

Description:

Expose the Page object as a variable to the decorator JSP.

Attributes:

  • id (required)
    Name of variable to assign to.

Example:

<decorator:usePage id="myPage" />
<% if ( myPage.getIntProperty("rating") == 10 ) { %>
  <b>10 out of 10!</b>
<% } %>

Page Tags

The page tags, are used to apply decorators to inline or external content from within the current page.

<page:applyDecorator name="..." [ page="..." title="..." ] >
   .....
</page:applyDecorator>

Description:

Apply a Decorator to specified content. The content can either be inline by specifying a body to the tag, or by using the result of another page by specifying the page attribute.

Attributes:

  • name (required)
    Name of the Decorator to apply to the included page.

  • page (optional)
    Points to the external resource which should expose an entire page (e.g. another JSP file producing a valid page). This attribute can be relative to the page it is being called from, or an absolute path from the context-root.

  • title (optional)
    Override the title of the page available as Page.getTitle() or <decorator:title/> from within the Decorator. This is identical to specifying <page:param name="title">...<page:param>.

Body:

The content to have the Decorator applied to.

<page:param name="..."> ... </page:param>

Description:

Pass a parameter to a Decorator. This will override the value called from Page.getProperty() or <decorator:getProperty/>. This tag is only valid inside a <page:applyDecorator> tag.

Attributes:

  • name (required)
    The name of the parameter to override.

Body:

The value of the parameter.



그 이외에 여러가지가 더 많이 있지만... 기초적인 설명으로 마무리를 하도록 하겠습니다.. :)
상세한 내용은 원문 사이트에서 참고 하세요..
:

xwork configuration

ITWeb/개발일반 2010. 3. 11. 22:32
원본글 : http://wiki.opensymphony.com/display/XW/Configuring+XWork+in+xwork.xml
원본글 :
http://wiki.opensymphony.com/display/WW/Result+Types

Attribute Required Description
name yes key to for other packages to reference
extends no inherits package behavior of the package it extends
namespace no see Namespace Configuration
abstract no declares package to be abstract (no action configurations required in package)

<package name="default">
    <action name="foo" class="mypackage.simpleAction>
        <result name="success" type="dispatcher">greeting.jsp</result>
    </action>
    <action name="bar" class="mypackage.simpleAction">
        <result name="success" type="dispatcher">bar1.jsp</result>
    </action>
</package>

<package name="mypackage1" namespace="/">
    <action name="moo" class="mypackage.simpleActtion">
        <result name="success" type="dispatcher">moo.jsp</result>
    </action>
</package>

<package name="mypackage2" namespace="/barspace">
    <action name="bar" class="mypackage.simpleAction">
        <result name="success" type="dispatcher">bar2.jsp</result>
    </action>
</package>


<xwork>
    <include file="xwork-default.xml"/>
    <include file="xwork-extension.xml"/>
    <include file="xwork-mail.xml"/>
    <include file="xwork-xmlrpc.xml"/>
    ....
</xwork>


 

Actions are the basic "unit-of-work" in XWork, they define, well, actions. An action will usually be a request, (and usually a button click, or form submit). The main action element has two parts, the friendly name (referenced in the URL, i.e. saveForm.action) and the corresponding "handler" class.

<action name="formTest" class="com.opensymphony.xwork.example.SampleAction" method="processSample">

The optional "method" parameter tells XWork which method to call based upon this action. If you leave the method parameter blank, XWork will call the method execute() by default. If there is no execute() method and no method specified in the xml file, XWork will throw an exception.

<package name="myPackage" ....>

...

<default-action-ref name="simpleViewResultAction">

<!--
An example of a default action that is just a simple class
that has 3 fields: successUrl, errorUrl, and inputUrl.  This action
parses the request url to set the result values.  In the normal case
it just renders velocity results of the same name as the requested url.
-->
<action name="simpleViewResultAction" class="SimpleViewResultAction">
<result type="velocity">${successUrl}</result>
<result name="error" type="velocity">${errorUrl}</result>
<result name="input" type="velocity">${inputUrl}</result>
</action>

...

</package>



Result tags tell XWork what to do next after the action has been called. There are a standard set of result codes built-in to XWork, (in the Action interface) they include:

String SUCCESS = "success";
String NONE    = "none";
String ERROR   = "error";
String INPUT   = "input";
String LOGIN   = "login";

You can extend these as you see fit. Most of the time you will have either SUCCESS or ERROR, with SUCCESS moving on to the next page in your application;

<result name="success" type="dispatcher">
    <param name="location">/thank_you.jsp</param>
</result>

...and ERROR moving on to an error page, or the preceding page;

<result name="error" type="dispatcher">
    <param name="location">/error.jsp</param>
</result>

Results are specified in a xwork xml config file (xwork.xml) nested inside <action>. If the location param is the only param being specified in the result tag, you can simplify it as follows:

<action name="bar" class="myPackage.barAction">
  <result name="success" type="dispatcher">
    <param name="location">foo.jsp</param>
  </result>
</action>

or simplified

<action name="bar" class="myPackage.barAction">
  <result name="success" type="dispatcher">foo.jsp</result>
</action>

or even simplified further

<action name="bar" class="myPackage.barAction">
   <result>foo.jsp</result>
</action>

 

<result-types>
    <result-type name="dispatcher" class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult" default="true"/>
    <result-type name="redirect" class="com.opensymphony.webwork.dispatcher.ServletRedirectResult"/>
    <result-type name="velocity" class="com.opensymphony.webwork.dispatcher.VelocityResult"/>
    <result-type name="chain" class="com.opensymphony.xwork.ActionChainResult"/>
    <result-type name="xslt" class="com.opensymphony.webwork.views.xslt.XSLTResult"/>
    <result-type name="jasper" class="com.opensymphony.webwork.views.jasperreports.JasperReportsResult"/>
    <result-type name="freemarker" class="com.opensymphony.webwork.views.freemarker.FreemarkerResult"/>
    <result-type name="httpheader" class="com.opensymphony.webwork.dispatcher.HttpHeaderResult"/>
    <result-type name="stream" class="com.opensymphony.webwork.dispatcher.StreamResult"/>
    <result-type name="plaintext" class="com.opensymphony.webwork.dispatcher.PlainTextResult" />
</result-types>

Result Types

Webwork provides several implementations of the com.opensymphony.xwork.Result interface to make web-based interactions with your actions simple. These result types include:

Intercepters must first be defined (to give name them) and can be chained together as a stack:
<interceptors>
  <interceptor name="security" class="com.mycompany.security.SecurityInterceptor"/>
  <interceptor-stack name="defaultComponentStack">
    <interceptor-ref name="component"/>
    <interceptor-ref name="defaultStack"/>
  </interceptor-stack>
</interceptors>

To use them in your actions:

<action name="VelocityCounter" class="com.opensymphony.xwork.example.counter.SimpleCounter">
   <result name="success">...</result>
   <interceptor-ref name="defaultComponentStack"/>
</action>


 

:

Quirks mode

ITWeb/개발일반 2010. 2. 2. 12:18


HTML5 관련 문서 읽다가
HTML 5 defines three modes: quirks mode, limited quirks mode and no quirks mode, of which only the latter is considered conforming to use. The reason for this is due to backwards compatibility. The important thing to understand is that there are some differences in the way documents are visually rendered in each of the modes; and to ensure the most standards compliant rendering, it is important to ensure no-quirks mode is used.
이 부분에서 quirk 내용이 있길래 remind 차원에서 다시 한번 찾아 봤습니다.
원문 : http://dev.w3.org/html5/html-author/#doctype-declaration





Quirks mode는 오래된 웹 브라우저들을 위해 디자인된 웹 페이지의 하위 호환성을 유지하기 위해 W3C나 IETF의 표준을 엄격히 준수하는 Standards Mode를 대신하여 사용되는 웹 브라우저의 기술을 나타낸다. 같은 코드라도 웹 브라우저마다 서로 해석을 달리 하기 때문에, 전혀 다른 결과물을 보여주게 된다.
원문 : http://ko.wikipedia.org/wiki/Quirks_mode

중요한 부분만 골라 보면.. 아래 두개 정도..
The reason for this is due to backwards compatibility.
it is important to ensure no-quirks mode is used.
:

The document tree - Sibling

ITWeb/개발일반 2010. 1. 7. 18:44

The document tree - Sibling

A sibling is an element that shares the same parent with another element. In the diagram below, the <li>'s are siblings as they all share the same parent - the <ul>.

같은 부모를 갖는 동일 level 의 node 들...

:

Shell Redirection

ITWeb/개발일반 2009. 10. 20. 14:20
man bash 하신 후 redirection 부분 참고 하시면 됩니다.

Handle Name Description
0 stdin Standard input
1 stdout Standard output
2 stderr Standard error

아래는 뽑아서 올려 놓은 거랍니다.. :)

REDIRECTION
       Before  a command is executed, its input and output may be redirected using a special notation inter-
       preted by the shell.  Redirection may also be used to open and close files for the current shell exe-
       cution environment.  The following redirection operators may precede or appear anywhere within a sim-
       ple command or may follow a command.  Redirections are processed in the order they appear, from  left
       to right.

       In  the  following descriptions, if the file descriptor number is omitted, and the first character of
       the redirection operator is <, the redirection refers to the standard input (file descriptor 0).   If
       the  first  character of the redirection operator is >, the redirection refers to the standard output
       (file descriptor 1).

       The word following the redirection operator in the following descriptions, unless otherwise noted, is
       subjected  to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic
       expansion, quote removal, pathname expansion, and word splitting.  If it expands  to  more  than  one
       word, bash reports an error.

       Note that the order of redirections is significant.  For example, the command

              ls > dirlist 2>&1

       directs both standard output and standard error to the file dirlist, while the command

              ls 2>&1 > dirlist

       directs  only the standard output to file dirlist, because the standard error was duplicated as stan-
       dard output before the standard output was redirected to dirlist.

       Bash handles several filenames specially when they are used in redirections, as described in the fol-
       lowing table:

              /dev/fd/fd
                     If fd is a valid integer, file descriptor fd is duplicated.
              /dev/stdin
                     File descriptor 0 is duplicated.
              /dev/stdout
                     File descriptor 1 is duplicated.
              /dev/stderr
                     File descriptor 2 is duplicated.
              /dev/tcp/host/port
                     If  host is a valid hostname or Internet address, and port is an integer port number or
                     service name, bash attempts to open a TCP connection to the corresponding socket.
              /dev/udp/host/port
                     If host is a valid hostname or Internet address, and port is an integer port number  or
                     service name, bash attempts to open a UDP connection to the corresponding socket.

       A failure to open or create a file causes the redirection to fail.

       Redirections  using  file  descriptors  greater than 9 should be used with care, as they may conflict
       with file descriptors the shell uses internally.

   Redirecting Input
       Redirection of input causes the file whose name results from the expansion of word to be  opened  for
       reading on file descriptor n, or the standard input (file descriptor 0) if n is not specified.

       The general format for redirecting input is:

              [n]<word

   Redirecting Output
       Redirection  of output causes the file whose name results from the expansion of word to be opened for
       writing on file descriptor n, or the standard output (file descriptor 1) if n is not  specified.   If
       the file does not exist it is created; if it does exist it is truncated to zero size.

       The general format for redirecting output is:
              [n]>word

       If  the  redirection operator is >, and the noclobber option to the set builtin has been enabled, the
       redirection will fail if the file whose name results from the expansion of word exists and is a regu-
       lar  file.   If  the  redirection  operator is >|, or the redirection operator is > and the noclobber
       option to the set builtin command is not enabled, the redirection is attempted even if the file named
       by word exists.

   Appending Redirected Output
       Redirection  of  output in this fashion causes the file whose name results from the expansion of word
       to be opened for appending on file descriptor n, or the standard output (file descriptor 1) if  n  is
       not specified.  If the file does not exist it is created.

       The general format for appending output is:

              [n]>>word

   Redirecting Standard Output and Standard Error
       Bash allows both the standard output (file descriptor 1) and the standard error output (file descrip-
       tor 2) to be redirected to the file whose name is the expansion of word with this construct.

       There are two formats for redirecting standard output and standard error:

              &>word
       and
              >&word

       Of the two forms, the first is preferred.  This is semantically equivalent to

              >word 2>&1

   Here Documents
       This type of redirection instructs the shell to read input from the current source until a line  con-
       taining only word (with no trailing blanks) is seen.  All of the lines read up to that point are then
       used as the standard input for a command.

       The format of here-documents is:

              <<[-]word
                      here-document
              delimiter

       No parameter expansion, command substitution, arithmetic expansion, or  pathname  expansion  is  per-
       formed  on  word.  If any characters in word are quoted, the delimiter is the result of quote removal
       on word, and the lines in the here-document are not expanded.  If word is unquoted, all lines of  the
       here-document  are  subjected to parameter expansion, command substitution, and arithmetic expansion.
       In the latter case, the character sequence \<newline> is ignored, and \ must be  used  to  quote  the
       characters \, $, and  ?

       If the redirection operator is <<-, then all leading tab characters are stripped from input lines and
       the line containing delimiter.  This allows here-documents within shell scripts to be indented  in  a
       natural fashion.

   Here Strings
       A variant of here documents, the format is:

              <<<word

       The word is expanded and supplied to the command on its standard input.

   Duplicating File Descriptors
       The redirection operator

              [n]<&word

       is  used  to  duplicate  input  file  descriptors.   If  word expands to one or more digits, the file
       descriptor denoted by n is made to be a copy of that file descriptor.  If the digits in word  do  not
       specify  a  file descriptor open for input, a redirection error occurs.  If word evaluates to -, file
       descriptor n is closed.  If n is not specified, the standard input (file descriptor 0) is used.

       The operator

              [n]>&word

       is used similarly to duplicate output file descriptors.  If n is not specified, the  standard  output
       (file descriptor 1) is used.  If the digits in word do not specify a file descriptor open for output,
       a redirection error occurs.  As a special case, if n is omitted, and word does not expand to  one  or
       more digits, the standard output and standard error are redirected as described previously.

   Moving File Descriptors
       The redirection operator

              [n]<&digit-

       moves  the file descriptor digit to file descriptor n, or the standard input (file descriptor 0) if n
       is not specified.  digit is closed after being duplicated to n.

       Similarly, the redirection operator
       [n]>&digit-

       moves the file descriptor digit to file descriptor n, or the standard output (file descriptor 1) if n
       is not specified.

   Opening File Descriptors for Reading and Writing
       The redirection operator

              [n]<>word

       causes the file whose name is the expansion of word to be opened for both reading and writing on file
       descriptor n, or on file descriptor 0 if n is not specified.  If the file does not exist, it is  cre-
       ated.

:

[PERL] HTML 메일 발송 테스트

ITWeb/개발일반 2009. 7. 27. 15:01

아래 글에 이어서.. 추가 입니다.

참고 URL :
http://alma.ch/perl/Mail-Sendmail-FAQ.html
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/Sendmail.pm

sub setSendMail {
    my $message = $_[0];

    %mail = (
                To           => 'to@email.com',
                From         => 'from@email.com',
                Subject      => 'TITLE',
                'Content-type'  => 'text/html; charset="UTF-8"',
                Message      => "<span style='font-size:11px; font-family:맑은 고딕, 돋움'>$message</span>"
            );

    if ( $message ) {
        sendmail(%mail) or die $Mail::Sendmail::error;
        print "OK. Log says:\n", $Mail::Sendmail::log;
    }
}

보시는 바와 같이 빨간 부분을 추가해 주시면 됩니다.
Content-type 앞뒤로 quotation 빼먹으시면 정상적으로 적용 안되니 유의 하세요.

:

[PERL] 메일 발송 테스트

ITWeb/개발일반 2009. 7. 22. 16:41


우선 기본적으루다.. sendmail 을 이용해서 발송 해야 하는 건 아시죠..
리눅스 기반 입니다.

일단 sendmail 이 실행 되어 있어야 겠죠.
http://www.faqs.org/docs/linux_network/x15649.html

Perl 용 sendmail 모듈을 설치 하시죠.
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79_16/Sendmail.pm
저는 매뉴얼 설치 했습니다.
별거 없죠... 기냥.. 소스 받아서 압축 풀고 /usr/sbin/perl/site_perl 에 가져다 놓으면 끝..

샘플 코드 위에 링크 보면 있죠.. ㅋ
아래 코드는 구글링 해보시면 가장 많이 나오는 예제 중 하나 입니다.
두 가지를 다 넣어서 테스트 해본 거죠..

sub setSendMail {
    my $sendmailer = '/usr/sbin/sendmail';

    %mail = (
                To          => 'your@email.com',
                From        => 'your@email.com',
                Subject     => '제목 입력',
                Message     => "메시지 입력"
            );

    sendmail(%mail) or die $Mail::Sendmail::error;

    print "OK. Log says:\n", $Mail::Sendmail::log;

    open (MAIL, "|$sendmailer -oi -t");
    print MAIL "From: your@email.com\n";
    print MAIL "To: your@email.com\n";
    print MAIL "Subject: 제목입력\n\n";
    print MAIL "메시지 입력\n";
    close(MAIL);
}

그럼 즐프 하세요.

:

[PERL] 지정한 경로의 디렉토리 or 파일 검증.

ITWeb/개발일반 2009. 7. 13. 20:08

아주 초보적인 스크립트죠.

#!/usr/bi/perl

@files = </home/계정/*>;

foreach $file (@files) {
    if ( -f $file ) {
        print "This is a file (" . $file . ")\n";
    }

    if ( -d $file ) {
        print "This is a directory (" . $file . ")\n";
    }
}

사실 제가 만들고 싶은걸 작성 하기 전에 이 기초적인 것 부터.. 기록해 두려고.. 글 등록 합니다.
내가 만들고 싶은거..

1. 특정 디렉토리를 recursive 하게 search 를 한다.
2. inode 가 변경 된 최신 파일을 대상으로 file size 가 특정 용량을 넘는지 검사를 한다.
    - daily 로 검사 하면 된다.
    - 근데 파일은 매일 매일 증가를 할 텐데 추가된 거나 inode 만 변경 된 걸로 increase 하게 검색 할 수 있을까?
    - 파일 올릴때 어디 기록을 해야 하나..ㅡ.ㅡ;
3. 특정 용량이 넘으면 alert mail 을 발송 또는 통계를 작성 하여 메일 발송 한다.

암튼.. 지금은 배도 무지 고프고 머리도 멍 하고..
대충 이정 도만 정리를 하자..
뭐.. 보니 recursive function 하나 만들어서 잘 돌리면 몇 줄 안짜고 쉽게 만들수도 있을 것 같다.
근데.. 고민은.. 2번 이다..ㅡ.ㅡ;;
파일은 무한정 늘어 날텐데... 흠..

:

[펌] Java Annotation

ITWeb/개발일반 2009. 5. 12. 20:08

[원본 글]
http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html
http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

기본적으로 알고 계셔야 하는 annotation 이지요... :)

@Deprecated

The @Deprecated (in the API reference documentation) annotation indicates that the marked method should no longer be used. The compiler generates a warning whenever a program uses a deprecated method, class, or variable. When an element is deprecated, it should be documented using the corresponding @deprecated tag, as shown in the preceding example. Notice that the tag starts with a lowercase "d" and the annotation starts with an uppercase "D". In general, you should avoid using deprecated methods — consult the documentation to see what to use instead.

@Override

The @Override (in the API reference documentation) annotation informs the compiler that the element is meant to override an element declared in a superclass. In the preceding example, the override annotation is used to indicate that the getPreferredFood method in the Horse class overrides the same method in the Animal class. If a method marked with @Override fails to override a method in one of its superclasses, the compiler generates an error.

While it's not required to use this annotation when overriding a method, it can be useful to call the fact out explicitly, especially when the method returns a subtype of the return type of the overridden method. This practice, called covariant return types, is used in the previous example: Animal.getPreferredFood returns a Food instance. Horse.getPreferredFood (Horse is a subclass of Animal) returns an instance of Hay (a subclass of Food). For more information, see Overriding and Hiding Methods (in the Learning the Java Language trail).

@SuppressWarnings

The @SuppressWarnings (in the API reference documentation) annotation tells the compiler to suppress specific warnings that it would otherwise generate. In the previous example, the useDeprecatedMethod calls a deprecated method of Animal. Normally, the compiler generates a warning but, in this case, it is suppressed.

Every compiler warning belongs to a category. The Java Language Specification lists two categories: "deprecation" and "unchecked". The "unchecked" warning can occur when interfacing with legacy code written before the advent of generics. To suppress more than one category of warnings, use the following syntax:

@SuppressWarnings({"unchecked", "deprecation"})

위 원문에 대한 번역이 잘된 글 링크 넣습니다.
원본 글 : http://decoder.tistory.com/21

 

:

[링크]Eclipse 에서 JUnit 사용하기

ITWeb/개발일반 2009. 5. 12. 16:00
구글링 해보면 많이도 나와 있지요.
그래서 따로 정리는 하지 않고 잘 정리된 사이트 몇개 링크 걸어 봅니다. :)

- Junit
http://www.javajigi.net/pages/viewpage.action?pageId=278
http://younghoe.info/255
http://decoder.tistory.com/3


JUnit 과 함께 알아야 할 내용 중 TDD(Test Driven Development) 이라는게 있죠.
요즘 회사에서 개발 생산성이랑 Quality Practice 관련해서 다양한 요구사항이 나오고 있내요.

암튼 재밌다는거... ㅎㅎ

- TDD
http://wikidocs.net/mybook/read/index?pageid=3
http://wiki.javajigi.net/display/OSS/TDD
http://xper.org/LineReaderTdd/
: