コード例 #1
0
ファイル: Extension_Test.java プロジェクト: wolfhesse/MPS
 @MPSLaunch
 public void test_testObject() throws Exception {
   Iterable<Extension<TestObject>> extensions =
       ((ExtensionPoint<TestObject>)
               ExtensionPoint.<TestObject>generify(
                   new ExtensionPoint(
                       "jetbrains.mps.lang.extension.tests.testExtensionPoint", TestObject.class)))
           .getExtensions();
   Assert.assertNotNull(extensions);
   Iterator<Extension<TestObject>> it = extensions.iterator();
   Assert.assertTrue(it.hasNext());
   Extension<TestObject> ext = it.next();
   try {
     it.next();
     Assert.fail("unexpected value");
   } catch (NoSuchElementException e) {
     // expected exception
   }
   TestObject to = ext.get();
   TEST_OBJECT = to;
   Assert.assertEquals("foobar", to.getValue());
   Assert.assertFalse(to.getShutDown());
 }