Where can I find the JUNIT_CONTAINER value in Eclipse?

I need to find out which way this next path is allowed:

<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

Unable to find classpath variabl unter Window->Preferences, Java->Build Path->Classpath Variables.

Where can I find the von value JUNIT_CONTAINER/4?

thanks

+3
source share
3 answers

A classpathentrytype "con" means a classpath container.

From the Help page for the Java class path :

, classpath:
.
classpath pathpath, .
classpath, (IClasspathContainer) .
classpath , .
, (, , .)

JavaCore getClasspathContainer setClasspathContainer.


, , , , ClassPathUtils

case IClasspathEntry.CPE_CONTAINER:
{
   final IClasspathContainer container;

   try
   {
      container = JavaCore.getClasspathContainer( entry.getPath(), jproj );
   }
   catch( JavaModelException e )
   {
      Logger.getLogger().logError( e );
      continue;
   }

   if( container != null ) 
   {
      final IClasspathEntry[] containerEntries
        = container.getClasspathEntries();

      for( int j = 0; j < containerEntries.length; j++ )
      {
        resolved.add( containerEntries[ j ].getPath() );
      }
   }
}
+4

→ Eclipse → .

+2

A simple solution is this little JUnit test.
This should be a test because Eclipse installs only the required libraries in the classpath System Property:

import static org.junit.Assert.assertTrue;
import org.junit.Test;

public class TestApp {
    @Test
    public void bla() {
        System.out.println(System.getProperty("java.class.path"));
        assertTrue(true);
    }
}
0
source

Source: https://habr.com/ru/post/1712841/


All Articles