Java Code Examples for org.kie.api.builder.KieFileSystem#write()
The following examples show how to use
org.kie.api.builder.KieFileSystem#write() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonTestMethodBase.java From kogito-runtimes with Apache License 2.0 | 6 votes |
public static byte[] createJar(KieServices ks, ReleaseId releaseId, String... drls) { KieFileSystem kfs = ks.newKieFileSystem().generateAndWritePomXML( releaseId); for (int i = 0; i < drls.length; i++) { if (drls[i] != null) { kfs.write("src/main/resources/r" + i + ".drl", drls[i]); } } KieBuilder kb = ks.newKieBuilder(kfs).buildAll(); assertFalse(kb.getResults().hasMessages(org.kie.api.builder.Message.Level.ERROR), kb.getResults().getMessages(org.kie.api.builder.Message.Level.ERROR).toString()); InternalKieModule kieModule = (InternalKieModule) ks.getRepository() .getKieModule(releaseId); byte[] jar = kieModule.getBytes(); return jar; }
Example 2
Source File: CommonTestMethodBase.java From kogito-runtimes with Apache License 2.0 | 6 votes |
public static byte[] createKJar(KieServices ks, ReleaseId releaseId, Resource pom, Resource... resources) { KieFileSystem kfs = ks.newKieFileSystem(); if (pom != null) { kfs.write(pom); } else { kfs.generateAndWritePomXML(releaseId); } for (int i = 0; i < resources.length; i++) { if (resources[i] != null) { kfs.write(resources[i]); } } ks.newKieBuilder(kfs).buildAll(); InternalKieModule kieModule = (InternalKieModule) ks.getRepository() .getKieModule(releaseId); byte[] jar = kieModule.getBytes(); return jar; }
Example 3
Source File: KieBuilderTest.java From kogito-runtimes with Apache License 2.0 | 6 votes |
@Test public void testInvalidPomXmlContent() throws ClassNotFoundException, InterruptedException, IOException { String namespace = "org.kie.test"; KieModuleModel kProj = createKieProject(namespace); ReleaseId releaseId = KieServices.Factory.get().newReleaseId(namespace, "memory", "1.0"); KieFileSystem kfs = KieServices.Factory.get().newKieFileSystem(); kfs.write( "pom.xml", "xxxx" ); generateKProjectXML( kfs, namespace, kProj ); generateMessageClass( kfs, namespace ); generateRule( kfs, namespace ); KieBuilder kieBuilder = createKieBuilder(kfs); kieBuilder.buildAll(); assertTrue ( kieBuilder.getResults().hasMessages(Level.ERROR) ); }
Example 4
Source File: ExtendsTest.java From kogito-runtimes with Apache License 2.0 | 6 votes |
@Test public void testDeclareExtendsWithFullyQualifiedName() { String drl = "package org.drools.extends.test; \n" + "" + "declare org.drools.extends.test.Foo end \n" + "declare org.drools.extends.test.Bar extends org.drools.extends.test.Foo end \n" + ""; KieServices kieServices = KieServices.Factory.get(); KieFileSystem kfs = kieServices.newKieFileSystem(); kfs.write( kieServices.getResources().newByteArrayResource( drl.getBytes() ) .setSourcePath( "test.drl" ) .setResourceType( ResourceType.DRL ) ); KieBuilder kieBuilder = kieServices.newKieBuilder( kfs ); kieBuilder.buildAll(); assertFalse( kieBuilder.getResults().hasMessages( Message.Level.ERROR ) ); }
Example 5
Source File: SerializationSecurityPolicyTest.java From kogito-runtimes with Apache License 2.0 | 6 votes |
@Test public void testSerialization() throws IOException, ClassNotFoundException { final String rule = " rule R " + " when " + " then " + " System.out.println(\"consequence!\"); " + " end"; final KieServices kieServices = KieServices.get(); final Resource drlResource = kieServices.getResources().newByteArrayResource( rule.getBytes(StandardCharsets.UTF_8.name()), StandardCharsets.UTF_8.name()); drlResource.setResourceType(ResourceType.DRL); drlResource.setTargetPath("test.drl"); final KieFileSystem kieFileSystem = kieServices.newKieFileSystem(); kieFileSystem.write(drlResource); final KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem); kieBuilder.buildAll(); final KieBase kieBase = kieServices.newKieContainer(kieBuilder.getKieModule().getReleaseId()).getKieBase(); final Collection<KiePackage> kpkgs = kieBase.getKiePackages(); final Collection<KiePackage> newCollection = new ArrayList<>(); for (KiePackage kpkg : kpkgs) { kpkg = SerializationHelper.serializeObject(kpkg); newCollection.add(kpkg); } ((InternalKnowledgeBase) kieBase).addPackages(newCollection); final KieSession kieSession = kieBase.newKieSession(); assertThat(kieSession.fireAllRules()).isEqualTo(1); }
Example 6
Source File: JbpmBpmn2TestCase.java From kogito-runtimes with Apache License 2.0 | 6 votes |
protected KieBase createKnowledgeBaseFromResources(Resource... process) throws Exception { KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); if (process.length > 0) { KieFileSystem kfs = ks.newKieFileSystem(); for (Resource p : process) { kfs.write(p); } KieBuilder kb = ks.newKieBuilder(kfs); kb.buildAll(); // kieModule is automatically deployed to KieRepository // if successfully built. if (kb.getResults().hasMessages(Level.ERROR)) { throw new RuntimeException("Build Errors:\n" + kb.getResults().toString()); } } KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId()); return kContainer.getKieBase(); }
Example 7
Source File: ListenersTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
/** * Inserts a new KieModule containing single KieBase and a stateful and stateless KieSessions with listeners * into KieRepository. * * @return created KIE module ReleaseId */ private ReleaseId prepareKieModule() { final KieServices ks = KieServices.Factory.get(); KieModuleModel module = ks.newKieModuleModel(); KieBaseModel baseModel = module.newKieBaseModel("defaultKBase"); baseModel.setDefault(true); baseModel.addPackage("*"); KieSessionModel sessionModel = baseModel.newKieSessionModel("defaultKSession"); sessionModel.setDefault(true); sessionModel.setType(KieSessionModel.KieSessionType.STATEFUL); sessionModel.newListenerModel(MarkingAgendaEventListener.class.getName(), ListenerModel.Kind.AGENDA_EVENT_LISTENER); sessionModel.newListenerModel(MarkingRuntimeEventListener.class.getName(), ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER); KieSessionModel statelessSessionModel = baseModel.newKieSessionModel("defaultStatelessKSession"); statelessSessionModel.setDefault(true); statelessSessionModel.setType(KieSessionModel.KieSessionType.STATELESS); statelessSessionModel.newListenerModel(MarkingAgendaEventListener.class.getName(), ListenerModel.Kind.AGENDA_EVENT_LISTENER); statelessSessionModel.newListenerModel(MarkingRuntimeEventListener.class.getName(), ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER); KieFileSystem kfs = ks.newKieFileSystem(); kfs.writeKModuleXML(module.toXML()); kfs.generateAndWritePomXML(RELEASE_ID); kfs.write("src/main/resources/" + PACKAGE_PATH + "/test.drl", ResourceFactory.newByteArrayResource(DRL.getBytes())); KieBuilder builder = ks.newKieBuilder(kfs).buildAll(); assertEquals(0, builder.getResults().getMessages().size(), "Unexpected compilation errors"); ks.getRepository().addKieModule(builder.getKieModule()); return RELEASE_ID; }
Example 8
Source File: MessageImplTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testMessageWithIncrementalBuild() throws Exception { //Some suitably duff DSL to generate errors String dsl1 = "bananna\n"; //Some suitably valid DRL String drl1 = "import org.drools.compiler.Person;\n" + "rule R1\n" + "when\n" + "There is a Person\n" + "then\n" + "end\n"; //Some suitably valid DRL String drl2 = "rule R2\n" + "when\n" + "then\n" + "end\n"; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem() .write( "src/main/resources/dsl.dsl", dsl1 ) .write( "src/main/resources/drl.dslr", drl1 ); KieBuilder kieBuilder = ks.newKieBuilder( kfs ).buildAll(); Results fullBuildResults = kieBuilder.getResults(); assertEquals( 3, fullBuildResults.getMessages().size() ); kfs.write( "src/main/resources/r2.drl", drl2 ); IncrementalResults incrementalBuildResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r2.drl" ).build(); assertEquals( 0, incrementalBuildResults.getAddedMessages().size() ); assertEquals( 0, incrementalBuildResults.getRemovedMessages().size() ); }
Example 9
Source File: KieDefaultPackageTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testAllInDifferentExplicitPackages() throws Exception { //This Model will be in package "org.smurf" String model_drl = "" + "package org.smurf\n" + "declare Smurf\n" + "Field1 : String\n" + "end\n"; //This DRL is in package "org.smurf.subpackage" String drl = "" + "package org.smurf.subpackage\n" + "import org.smurf.Smurf\n" + "rule \"test\"\n" + "when\n" + "Smurf()\n" + "then\n" + "end"; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.write( "src/main/resources/model.drl", model_drl ); kfs.write( "src/main/resources/drl.drl", drl ); KieBuilder builder = ks.newKieBuilder( kfs ).buildAll(); assertEquals( 0, builder.getResults().getMessages().size() ); }
Example 10
Source File: KieDefaultPackageTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testAllInExplicitPackage() throws Exception { //This Model will be in package "org.smurf" String model_drl = "" + "package org.smurf\n" + "declare Smurf\n" + "Field1 : String\n" + "end\n"; //This DRL is in package "org.smurf" too String drl = "" + "package org.smurf\n" + "rule \"test\"\n" + "when\n" + "Smurf()\n" + "then\n" + "end"; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.write( "src/main/resources/model.drl", model_drl ); kfs.write( "src/main/resources/drl.drl", drl ); KieBuilder builder = ks.newKieBuilder( kfs ).buildAll(); assertEquals( 0, builder.getResults().getMessages().size() ); }
Example 11
Source File: KieDefaultPackageTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testModelInDefaultPackage2() throws Exception { //This Model will be in the "default package" String model_drl = "" + "declare Smurf\n" + "Field1 : String\n" + "end\n"; //This DRL is in a named package, but imports the model (trying with defaultPkg prefix) String drl = "" + "package org.smurf\n" + "import defaultpkg.Smurf\n" + "rule \"test\"\n" + "when\n" + "Smurf()\n" + "then\n" + "end"; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.write( "src/main/resources/model.drl", model_drl ); kfs.write( "src/main/resources/drl.drl", drl ); KieBuilder builder = ks.newKieBuilder( kfs ).buildAll(); assertEquals( 0, builder.getResults().getMessages().size() ); }
Example 12
Source File: KieFileSystemScannerTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
private InternalKieModule createKieJar( KieServices ks, ReleaseId releaseId, String... rules) throws IOException { KieModuleModel kproj = ks.newKieModuleModel(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.writeKModuleXML(kproj.toXML()); kfs.writePomXML(getPom(releaseId)); for (String rule : rules) { String file = "org/test/" + rule + ".drl"; kfs.write("src/main/resources/KBase1/" + file, createDRL(rule)); } KieBuilder kieBuilder = ks.newKieBuilder(kfs); assertTrue(kieBuilder.buildAll().getResults().getMessages().isEmpty()); return (InternalKieModule) kieBuilder.getKieModule(); }
Example 13
Source File: QueryCepFireUntilHaltTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@BeforeEach public void prepare() { String drl = "package org.drools.compiler.integrationtests\n" + "import " + TestEvent.class.getCanonicalName() + "\n" + "declare TestEvent\n" + " @role( event )\n" + "end\n" + "query EventsFromStream\n" + " $event : TestEvent() from entry-point FirstStream\n" + "end\n" + "query ZeroToNineteenSeconds\n" + " $event : TestEvent() from entry-point FirstStream\n" + " $result : TestEvent ( this after [0s, 19s] $event) from entry-point SecondStream\n" + "end\n"; final KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); KieModuleModel kmodule = ks.newKieModuleModel(); KieBaseModel baseModel = kmodule.newKieBaseModel("defaultKBase") .setDefault(true) .setEventProcessingMode(EventProcessingOption.STREAM); baseModel.newKieSessionModel("defaultKSession") .setDefault(true) .setClockType(ClockTypeOption.get("pseudo")); kfs.writeKModuleXML(kmodule.toXML()); kfs.write( ResourceFactory.newByteArrayResource(drl.getBytes()) .setTargetPath("org/drools/compiler/integrationtests/queries.drl") ); assertTrue(ks.newKieBuilder(kfs).buildAll().getResults().getMessages().isEmpty()); ksession = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()).newKieSession(); firstEntryPoint = ksession.getEntryPoint("FirstStream"); secondEntryPoint = ksession.getEntryPoint("SecondStream"); clock = ksession.getSessionClock(); this.startEngine(); }
Example 14
Source File: SimulateTestBase.java From kogito-runtimes with Apache License 2.0 | 5 votes |
public static ReleaseId createKJarWithMultipleResources(String id, String[] resources, ResourceType[] types) { KieServices ks = KieServices.Factory.get(); KieModuleModel kproj = ks.newKieModuleModel(); KieFileSystem kfs = ks.newKieFileSystem(); for ( int i = 0; i < resources.length; i++ ) { String res = resources[i]; String type = types[i].getDefaultExtension(); kfs.write( "src/main/resources/" + id.replaceAll( "\\.", "/" ) + "/org/test/res" + i + "." + type, res ); } KieBaseModel kBase1 = kproj.newKieBaseModel( id ) .setEqualsBehavior( EqualityBehaviorOption.EQUALITY ) .setEventProcessingMode( EventProcessingOption.STREAM ); KieSessionModel ksession1 = kBase1.newKieSessionModel( id + ".KSession1" ) .setDefault(true) .setType(KieSessionModel.KieSessionType.STATEFUL) .setClockType( ClockTypeOption.get( "pseudo" ) ); kfs.writeKModuleXML(kproj.toXML()); KieBuilder kieBuilder = ks.newKieBuilder(kfs).buildAll(); assertTrue(kieBuilder.getResults().getMessages().isEmpty()); KieModule kieModule = kieBuilder.getKieModule(); return kieModule.getReleaseId(); }
Example 15
Source File: KieLoggersTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testDeclarativeKieConsoleLoggerStateless() throws Exception { String drl = "package org.drools.integrationtests\n" + "import org.drools.compiler.Message;\n" + "rule \"Hello World\"\n" + " when\n" + " m : Message( myMessage : message )\n" + " then\n" + "end"; KieServices ks = KieServices.Factory.get(); KieModuleModel kproj = ks.newKieModuleModel(); kproj.newKieBaseModel("KBase1") .newKieSessionModel("KSession1") .setType(KieSessionModel.KieSessionType.STATELESS) .setConsoleLogger("logger"); KieFileSystem kfs = ks.newKieFileSystem(); kfs.writeKModuleXML(kproj.toXML()); kfs.write("src/main/resources/KBase1/rule.drl", drl); KieModule kieModule = ks.newKieBuilder(kfs).buildAll().getKieModule(); KieContainer kieContainer = ks.newKieContainer(kieModule.getReleaseId()); StatelessKieSession ksession = kieContainer.newStatelessKieSession("KSession1"); ksession.execute( new Message("Hello World") ); KieRuntimeLogger logger = ksession.getLogger(); assertNotNull(logger); logger.close(); }
Example 16
Source File: DeclarativeAgendaTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testFiredRuleDoNotRefireAfterUnblock() { // BZ-1038076 String drl = "package org.drools.compiler.integrationtests\n" + "\n" + "import org.kie.api.runtime.rule.Match\n" + "import java.util.List\n" + "\n" + "global List list\n" + "\n" + "rule startAgenda\n" + "salience 100\n" + "when\n" + " String( this == 'startAgenda' )\n" + "then\n" + " drools.getKnowledgeRuntime().getAgenda().getAgendaGroup(\"agenda\").setFocus();\n" + " list.add(kcontext.getRule().getName());\n" + "end\n" + "\n" + "rule sales @department('sales')\n" + "agenda-group \"agenda\"\n" + "when\n" + " $s : String( this == 'fireRules' )\n" + "then\n" + " list.add(kcontext.getRule().getName());\n" + "end\n" + "\n" + "rule salesBlocker salience 10\n" + "when\n" + " $s : String( this == 'fireBlockerRule' )\n" + " $i : Match( department == 'sales' )\n" + "then\n" + " kcontext.blockMatch( $i );\n" + " list.add(kcontext.getRule().getName());\n" + "end\n"; final KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); KieModuleModel kmodule = ks.newKieModuleModel(); KieBaseModel baseModel = kmodule.newKieBaseModel("defaultKBase") .setDefault(true) .setDeclarativeAgenda(DeclarativeAgendaOption.ENABLED); baseModel.newKieSessionModel("defaultKSession") .setDefault(true); kfs.writeKModuleXML(kmodule.toXML()); kfs.write("src/main/resources/block_rule.drl", drl); KieBuilder kieBuilder = ks.newKieBuilder( kfs ).buildAll(); assertEquals( 0, kieBuilder.getResults().getMessages( org.kie.api.builder.Message.Level.ERROR ).size() ); KieSession ksession = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()).newKieSession(); List<String> list = new DebugList<String>(); ksession.setGlobal("list", list); // first run ksession.insert("startAgenda"); ksession.insert("fireRules"); FactHandle fireBlockerRule = ksession.insert("fireBlockerRule"); ksession.fireAllRules(); String[] expected = { "startAgenda", "sales", "salesBlocker" }; assertEquals(expected.length, list.size()); for (int i = 0; i < list.size(); i++) { assertEquals(expected[i], list.get(i)); } // second run ksession.delete(fireBlockerRule); list.clear(); ksession.fireAllRules(); assertEquals(0, list.size()); ksession.dispose(); list.clear(); }
Example 17
Source File: BasicUpdateTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@BeforeEach public void setUp() { final KieFileSystem kfs = KieServices.Factory.get().newKieFileSystem(); kfs.write(KieServices.Factory.get().getResources() .newClassPathResource(UPDATE_TEST_DRL, DeleteTest.class)); final KieBuilder kbuilder = KieServices.Factory.get().newKieBuilder(kfs); kbuilder.buildAll(); final List<Message> res = kbuilder.getResults().getMessages(Message.Level.ERROR); assertEquals(0, res.size(), res.toString()); final KieBase kbase = KieServices.Factory.get() .newKieContainer(kbuilder.getKieModule().getReleaseId()) .getKieBase(); ksession = kbase.newKieSession(); }
Example 18
Source File: KieBuilderTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testKieBuilderWithDotFiles() { // BZ-1044409 final String KBASE_NAME = "kieBase"; final String KSESSION_NAME = "kieSession"; //This can be any DRL, or any file recognised by drools-compiler final String drl = "declare TestEvent\n" + " name : String\n" + "end\n"; final String dotDrl = "Meta-data used by kie-wb"; final KieServices ks = KieServices.Factory.get(); final KieFileSystem kfs = ks.newKieFileSystem(); kfs.write( "src/main/resources/drlFile.drl", drl ); kfs.write( "src/main/resources/.drlFile.drl", dotDrl ); final KieModuleModel kmoduleModel = ks.newKieModuleModel(); kmoduleModel.newKieBaseModel( KBASE_NAME ) .addPackage( "*" ) .newKieSessionModel( KSESSION_NAME ) .setDefault( true ); kfs.writeKModuleXML( kmoduleModel.toXML() ); final KieBuilder builder = ks.newKieBuilder( kfs ).buildAll(); for ( final org.kie.api.builder.Message m : builder.getResults().getMessages() ) { System.out.println( m ); } assertEquals( 0, builder.getResults().getMessages().size() ); ks.getRepository().addKieModule( builder.getKieModule() ); final KieSession kieSession = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() ).newKieSession( KSESSION_NAME ); assertNotNull( kieSession ); final KieBase kieBase = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() ).getKieBase( KBASE_NAME ); assertNotNull( kieBase ); }
Example 19
Source File: KieBuilderTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public void generateMessageClass(KieFileSystem kfs, String namespace) { kfs.write("src/main/java/" + namespace.replace('.', '/') + "/Message.java", getMessageClass( namespace ) ); }
Example 20
Source File: TypeDeclarationTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testCrossPackageDeclares() { String pkg1 = "package org.drools.compiler.test1; " + "import org.drools.compiler.test2.GrandChild; " + "import org.drools.compiler.test2.Child; " + "import org.drools.compiler.test2.BarFuu; " + "declare FuBaz foo : String end " + "declare Parent " + " unknown : BarFuu " + "end " + "declare GreatChild extends GrandChild " + " father : Child " + "end " ; String pkg2 = "package org.drools.compiler.test2; " + "import org.drools.compiler.test1.Parent; " + "import org.drools.compiler.test1.FuBaz; " + "declare BarFuu " + " baz : FuBaz " + "end " + "declare Child extends Parent " + "end " + "declare GrandChild extends Child " + " notknown : FuBaz " + "end " ; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.generateAndWritePomXML( ks.newReleaseId( "test", "foo", "1.0" ) ); KieModuleModel km = ks.newKieModuleModel(); km.newKieBaseModel( "rules" ) .addPackage( "org.drools.compiler.test2" ) .addPackage( "org.drools.compiler.test1" ); kfs.writeKModuleXML( km.toXML() ); KieResources kr = ks.getResources(); Resource r1 = kr.newByteArrayResource( pkg1.getBytes() ) .setResourceType( ResourceType.DRL ) .setSourcePath( "org/drools/compiler/test1/p1.drl" ); Resource r2 = kr.newByteArrayResource( pkg2.getBytes() ) .setResourceType( ResourceType.DRL ) .setSourcePath( "org/drools/compiler/test2/p2.drl" ); kfs.write( r1 ); kfs.write( r2 ); KieBuilder builder = ks.newKieBuilder( kfs ); builder.buildAll(); assertEquals( Collections.emptyList(), builder.getResults().getMessages( Message.Level.ERROR ) ); KieContainer kc = ks.newKieContainer(builder.getKieModule().getReleaseId()); FactType ft = kc.getKieBase( "rules" ).getFactType( "org.drools.compiler.test2", "Child" ); assertNotNull( ft ); assertNotNull( ft.getFactClass() ); assertEquals( "org.drools.compiler.test1.Parent", ft.getFactClass().getSuperclass().getName() ); }