Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Sep 22, 2023
1 parent 499a207 commit 5426336
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test/java/test/TestTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void initTest()
{
// MTGConstants.CONF_DIR = new File(System.getProperty("user.home") + "/.magicDeskCompanion-test/");
// MTGConstants.DATA_DIR = new File(MTGConstants.CONF_DIR.getAbsolutePath(),"data");
MTGLogger.changeLevel(Level.OFF);
MTGLogger.changeLevel(Level.DEBUG);

getEnabledPlugin(MTGCardsProvider.class).init();
}
Expand Down
14 changes: 11 additions & 3 deletions src/test/java/test/providers/GradingTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.Before;
import org.junit.Test;
import org.magic.api.interfaces.MTGGraders;
import org.magic.services.MTGControler;
import org.magic.services.tools.MTG;

import test.TestTools;
Expand All @@ -15,7 +16,7 @@ public class GradingTester {
@Before
public void initTest() throws IOException, URISyntaxException
{
TestTools.initTest();
MTGControler.getInstance().loadAccountsConfiguration();
}


Expand All @@ -27,11 +28,11 @@ public void launch() throws IOException
var grads = TestTools.loadGraderData().get("GRADING").getAsJsonObject();
grads.entrySet().forEach(e->{
var p = MTG.getPlugin(e.getKey(),MTGGraders.class);
testPlugin(p);
testPlugin(p,e.getValue().getAsString());
});
}

public void testPlugin(MTGGraders p)
public void testPlugin(MTGGraders p, String string)
{

System.out.println("*****************************"+p.getName());
Expand All @@ -45,6 +46,13 @@ public void testPlugin(MTGGraders p)
System.out.println("CONF FILE " + p.getConfFile());


try {
System.out.println(p.loadGrading(string));
} catch (IOException e) {
e.printStackTrace();
}


}


Expand Down

0 comments on commit 5426336

Please sign in to comment.