Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test runner showing "Configure Python Tests" instead of Java #1646

Open
KaziAfrozAlam opened this issue Jan 2, 2024 · 13 comments
Open

Test runner showing "Configure Python Tests" instead of Java #1646

KaziAfrozAlam opened this issue Jan 2, 2024 · 13 comments

Comments

@KaziAfrozAlam
Copy link

KaziAfrozAlam commented Jan 2, 2024

image

@KaziAfrozAlam
Copy link
Author

I get this issue after mannually downloading of junit also

@jdneo
Copy link
Member

jdneo commented Jan 3, 2024

This means the Java project is not recognized.

How does your java project look like? Would you mind sharing it?

@KaziAfrozAlam
Copy link
Author

image

@jdneo
Copy link
Member

jdneo commented Jan 4, 2024

Screenshot 2024-01-04 at 09 48 13

This icon indicates that the extension failed to activate.

Is there any error in the logs? https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#get-the-java-language-servers-workspace-logs

@KaziAfrozAlam
Copy link
Author

image

Now also it was not working

@jdneo
Copy link
Member

jdneo commented Jan 4, 2024

Would you mind sharing your project if possible?

@KaziAfrozAlam
Copy link
Author

KaziAfrozAlam commented Jan 4, 2024

Does I have to share the full project from the first?

@jdneo
Copy link
Member

jdneo commented Jan 4, 2024

Just a minimal project which can repro your issue will be fine.

@KaziAfrozAlam
Copy link
Author

`

package com.bts.controller;

import java.time.LocalDate;
import org.junit.Test;
import com.bts.beans.Project;
import com.bts.beans.enums.ProjectStatus;
import com.bts.beans.enums.UserType;
import com.bts.exceptions.AuthorizationException;
import com.bts.exceptions.BugAssignmentException;
import com.bts.exceptions.DataAccessException;
import com.bts.exceptions.InvalidDataException;
import com.bts.exceptions.InvalidDateException;
import com.bts.exceptions.ProjectManagerLimitExceededException;
import com.bts.service.BugService;
import com.bts.service.ProjectService;
import com.bts.service.TeamService;
import com.bts.service.UserService;
import com.bts.util.ObjectFactory;

public class TestCases {
static UserService userService = ObjectFactory.getUserInstance();
static ProjectService projectService = ObjectFactory.getProjectServiceInstace();
static BugService bugService = ObjectFactory.getBugServiceInstance();
static TeamService teamService = ObjectFactory.getTeamServiceInstance();

public static void main(String[] args) {
    testUserRegistration();
    testCreateNewProject();
}
@Test
private static void testUserRegistration() {
    System.out.println("Testing User Registration...");


    // Test case a: All fields are mandatory
    try{
    	userService.registerUser("[email protected]", null, null);
    	System.err.println("Test case 1a: Failed");
    }
    catch (Exception e) {System.out.println("Test case 1a: Passed");
	}
    
    // Test case b: Email should exist and match with the role
    try{
    	userService.registerUser("[email protected]", "Alex@123", UserType.DEVELOPER);
    	System.err.println("Test case 1b: Failed");
    }
    catch(Exception e) {
    	System.out.println("Test case 1b: Passed");
    }

    // Test case c: User should not have already been registered
    try{
    	userService.registerUser("[email protected]", "Max@123", UserType.PROJECTMANAGER);
    	System.err.println("Test case 1c: Failed");
    }
    catch(Exception e) {
    	System.out.println("Test case 1c: Passed");
    }
}
@Test
private static void testCreateNewProject() {
	int projectManagerId;
	String projectName;
	String description;
	LocalDate startDate;
	ProjectStatus status;
	int testerId;
	int developerId;
	// Test case 2a: Start date should be at least 2 days later than the current date
	projectManagerId = 1;
	projectName = "Something";
	description = "Something";
	startDate = LocalDate.parse("2023-09-15");
	status = ProjectStatus.INPROGRESS;
	testerId = 2;
	try {
		projectService.createProject(new Project(projectManagerId, projectName, description,startDate, status), projectManagerId, testerId);
		System.err.println("Test case 2a: Failed");
	} catch (DataAccessException | ProjectManagerLimitExceededException | InvalidDateException
			| InvalidDataException e) {
		System.out.println("Test case 2a: Passed");
	}
    // Test case 2b: Project status should be set to "in progress"
	startDate = LocalDate.parse("2023-09-25");
	status = ProjectStatus.COMPLETED;
	try {
		projectService.createProject(new Project(projectManagerId, projectName, description,startDate, status), projectManagerId, testerId);
		System.err.println("Test case 2b: Failed");
	} catch (DataAccessException | ProjectManagerLimitExceededException | InvalidDateException
			| InvalidDataException e) {
		System.out.println("Test case 2b: Passed");
	}
	// Test case 2c: Developers can be assigned to only one project
	developerId = 3;
	try {
		bugService.assignBugToDeveloper(projectManagerId, developerId);
		System.err.println("Test case 2c: Failed");
	} catch (BugAssignmentException | DataAccessException | AuthorizationException e) {
		System.out.println("Test case 2c: Passed");
	}
	
	// Test case 2d: Testers can be assigned to a maximum of 2 projects
	testerId = 4;
	try {
		projectService.createProject(new Project(projectManagerId, projectName, description,startDate, status), projectManagerId, testerId);
		System.err.println("Test case 2d: Failed");
	} catch (DataAccessException | ProjectManagerLimitExceededException | InvalidDateException
			| InvalidDataException e) {
		System.out.println("Test case 2d: Passed");
	}
	
	// Test case 2e: Testers can be assigned to projects only under same project manager
	testerId = 5;
	try {
		projectService.createProject(new Project(projectManagerId, projectName, description,startDate, status), projectManagerId, testerId);
		System.err.println("Test case 2e: Failed");
	} catch (DataAccessException | ProjectManagerLimitExceededException | InvalidDateException
			| InvalidDataException e) {
		System.out.println("Test case 2e: Passed");
	}
	
}

}`

@KaziAfrozAlam
Copy link
Author

https://1drv.ms/f/s!An-s8mCZusGNgeYNgyjTVEjqH1MJrw?e=JbFvBY

This is my full project source code link, you can check from here and you can find the code file from com/bts/controller/testcases.java

@jdneo
Copy link
Member

jdneo commented Jan 5, 2024

Ok, I open the folder onlinebugtrackingsystem. Since it contains .classpath and .project files. It will be treated as Eclipse project. (which means the setting java.project.sourcePaths, java.project.outputPath & java.project.referencedLibraries) won't work for them.

If you need to edit your project classpath, you can open .classpath file and add them there. Like what you did for the mysql-connector-j-8.0.33.jar.

@KaziAfrozAlam
Copy link
Author

I add the path and go this window but when i run the code the import of org.junit.Test error is shown
image

@KaziAfrozAlam
Copy link
Author

Again this error came, what should I do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants