testmycode / tmc-intellij

*BETA* TestMyCode plugin for IntelliJ IDEA
MIT License
24 stars 13 forks source link

Week6-100.NightSky FAILS! #118

Closed ragmha closed 7 years ago

ragmha commented 7 years ago

Fails at test8 🤔 , seems to work on netbeans. Any reason why ?

/test/NightSkyTest.java

  @Test
    @Points("100.1")
    public void test8() {
        noForbiddens();
    }
   private void noForbiddens() {
        try {
            Scanner lukija = new Scanner(new File("src/NightSky.java"));
            while (lukija.hasNext()) {
                String rivi = lukija.nextLine();
                if (rivi.contains("while")) {
                    fail("Koska nyt harjoitellaan for-toistolauseketta, "
                            + "et saa käyttää ohjelmassasi while-komentoa.");
                }
            }
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }

Error Details:

src/NightSky.java (No such file or directory)
org.junit.Assert.fail(Assert.java:88)
NightSkyTest.noForbiddens(NightSkyTest.java:463)
NightSkyTest.test8(NightSkyTest.java:114)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
fi.helsinki.cs.tmc.edutestutils.MockStdio$1.evaluate(MockStdio.java:106)
org.junit.rules.RunRules.evaluate(RunRules.java:20)
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
org.junit.runners.ParentRunner.run(ParentRunner.java:309)
fi.helsinki.cs.tmc.testrunner.TestRunner$TestingRunnable.runTestCase(TestRunner.java:134)
fi.helsinki.cs.tmc.testrunner.TestRunner$TestingRunnable.doRun(TestRunner.java:89)
fi.helsinki.cs.tmc.testrunner.TestRunner$TestingRunnable.run(TestRunner.java:70)
java.lang.Thread.run(Thread.java:745)
nygrenh commented 7 years ago

This is most likely fixed here: https://github.com/testmycode/tmc-langs/commit/1f83df049c33245c5985286d4f5b6ce53bd69445

So this should be resolved when we update tmc-core.

ragmha commented 7 years ago

@nygrenh when will the tmc-core be updated ?

nygrenh commented 7 years ago

It has been updated in the latest version.