Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.helger.jcodemodel.tests;
 
 import org.junit.Test;
 
Unit test for class com.helger.jcodemodel.JAnnotationUse.

Author(s):
Philip Helger
public class JAnnotationUseTest
  @Test
  {
    final JCodeModel codeModel = new JCodeModel ();
    final JDefinedClass testClass = codeModel._class ("Test");
    final JAnnotationUse suppressWarningAnnotation = testClass.annotate (SuppressWarnings.class);
    suppressWarningAnnotation.param ("value", JExpr.lit ("unused"));
    Assert.assertEquals ("@java.lang.SuppressWarnings(\"unused\")",
                         CodeModelTestsUtils.generate (suppressWarningAnnotation));
  }
New to GrepCode? Check out our FAQ X