Esempio n. 1
0
def canFindCfgOption():
    directory = os.path.join(sys.argv[1], ".OpenIDE")
    file = os.path.join(directory, "test.oicfgoptions")
    writeToFile(file, "custom.setting|This is a custom setting")
    tests.out("command|conf list")
    expected = "custom.setting                          // This is a custom setting"
    tests.assertOn(tests.hasOutput(expected))
def canFindCfgOption():
    directory = os.path.join(sys.argv[1], ".OpenIDE")
    file = os.path.join(directory, "test.oicfgoptions")
    writeToFile(file, "custom.setting|This is a custom setting")
    tests.out("command|conf list")
    expected = "custom.setting                          // This is a custom setting"
    tests.assertOn(tests.hasOutput(expected))
def canRunTouch():
	tests.out("command|touch bleh.txt")
	result = False
	file = os.path.join(sys.argv[1], "bleh.txt")
	event = "goto \"" + file + "|0|0\""
	result = tests.hasEvent(event)
	if result:
		result = os.path.exists(file)
	tests.assertOn(result)
Esempio n. 4
0
def canRunTouch():
    tests.out("command|touch bleh.txt")
    result = False
    file = os.path.join(sys.argv[1], "bleh.txt")
    event = "goto '" + file + "|0|0'"
    result = tests.hasEvent(event)
    if result:
        result = os.path.exists(file)
    tests.assertOn(result)
def runTest(testfile, expectedcoutput):
    root = os.path.dirname(__file__)
    passed = False
    for line in runProcess(["oi", "package", "test", os.path.join(root, testfile)]):
        if expectedcoutput in line:
            passed = True

    if passed == False:
        tests.out("failed")
    else:
        tests.out("passed")
def runTest(testfile, expectedcoutput):
    root = os.path.dirname(__file__)
    passed = False
    for line in runProcess(
        ["oi", "package", "test",
         os.path.join(root, testfile)]):
        if expectedcoutput in line:
            passed = True

    if passed == False:
        tests.out("failed")
    else:
        tests.out("passed")
def canWriteReadGlobalSetting():
    # Clean up in case of previous failing test
    tests.out("command|conf test.globalsetting -g -d")
    tests.out("command|conf test.globalsetting=20 -g")
    tests.out("command|conf read -g")
    tests.assertOn(tests.hasOutput("test.globalsetting=20"))
    tests.out("command|conf test.globalsetting -g -d")
Esempio n. 8
0
def canWriteReadGlobalSetting():
    # Clean up in case of previous failing test
    tests.out("command|conf test.globalsetting -g -d")
    tests.out("command|conf test.globalsetting=20 -g")
    tests.out("command|conf read -g")
    tests.assertOn(tests.hasOutput("test.globalsetting=20"))
    tests.out("command|conf test.globalsetting -g -d")
def canCreateGlobalProfile():
    root = "nonexistent"
    for line in runProcess(["oi", "conf", "read", "rootpoint", "-g"]):
        root=line
    profile = os.path.join(root, ".OpenIDE", "active.profile")
    backup = profile + ".backup"
    if os.path.exists(profile) == False:
        profile = None
    if not profile == None:
        shutil.copyfile(profile, backup)

    tests.out("command|profile init new-global-profile -g")
    tests.out("command|profile load new-global-profile -g")
    tests.out("command|profile list")

    if not profile == None:
        os.remove(profile)
        shutil.copyfile(backup, profile)
        os.remove(backup)

    tests.assertOn(tests.hasOutput("Active global profile: new-global-profile"))
    tests.out("command|profile rm new-global-profile -g")
def canCreateGlobalProfile():
    root = "nonexistent"
    for line in runProcess(["oi", "conf", "read", "rootpoint", "-g"]):
        root = line
    profile = os.path.join(root, ".OpenIDE", "active.profile")
    backup = profile + ".backup"
    if os.path.exists(profile) == False:
        profile = None
    if not profile == None:
        shutil.copyfile(profile, backup)

    tests.out("command|profile init new-global-profile -g")
    tests.out("command|profile load new-global-profile -g")
    tests.out("command|profile list")

    if not profile == None:
        os.remove(profile)
        shutil.copyfile(backup, profile)
        os.remove(backup)

    tests.assertOn(
        tests.hasOutput("Active global profile: new-global-profile"))
    tests.out("command|profile rm new-global-profile -g")
def canReadGlobalRootPoint():
    root = tests.get("applocation")
    tests.out("command|conf read rootpoint -g")
    tests.assertOn(tests.hasOutput(root))
def canFailTest():
	root = os.path.dirname(__file__)
	tests.out("command|pkgtest " + os.path.join(root, "pkgtest.failed.test.py"))
	tests.assertOn(tests.hasOutput("FAILED A failing test"))
def canReadGlobalCfgPoint():
    cfgfile = os.path.join(tests.get("applocation"), ".OpenIDE")
    tests.out("command|conf read cfgpoint -g")
    tests.assertOn(tests.hasOutput(cfgfile))
Esempio n. 14
0
def canReadGlobalRootPoint():
    root = tests.get("applocation")
    tests.out("command|conf read rootpoint -g")
    tests.assertOn(tests.hasOutput(root))
Esempio n. 15
0
def canReadGlobalCfgFile():
    root = tests.get("applocation")
    file = os.path.join(os.path.join(root, ".OpenIDE"), "oi.config")
    tests.out("command|conf read cfgfile -g")
    tests.assertOn(tests.hasOutput(file))
def canPassTest():
	root = os.path.dirname(__file__)
	tests.out("command|pkgtest " + os.path.join(root, "pkgtest.passing.test.py"))
	tests.assertOn(tests.hasOutput("PASSED A passing test"))
def canReadCfgPoint():
    cfgfile = os.path.join(sys.argv[1], ".OpenIDE")
    tests.out("command|conf read cfgpoint")
    tests.assertOn(tests.hasOutput(cfgfile))
Esempio n. 18
0
def canReadRootPoint():
    root = sys.argv[1]
    tests.out("command|conf read rootpoint")
    tests.assertOn(tests.hasOutput(root))
def canReadGlobalCfgFile():
    root = tests.get("applocation")
    file = os.path.join(os.path.join(root, ".OpenIDE"), "oi.config")
    tests.out("command|conf read cfgfile -g")
    tests.assertOn(tests.hasOutput(file))
Esempio n. 20
0
def canFindLocalCfgFile():
    cfgfile = os.path.join(os.path.join(sys.argv[1], ".OpenIDE"), "oi.config")
    tests.out("command|conf read cfgfile")
    tests.assertOn(tests.hasOutput(cfgfile))
Esempio n. 21
0
def canReadCfgPoint():
    cfgfile = os.path.join(sys.argv[1], ".OpenIDE")
    tests.out("command|conf read cfgpoint")
    tests.assertOn(tests.hasOutput(cfgfile))
def canMarkTestAsInconclusuve():
	root = os.path.dirname(__file__)
	tests.out("command|pkgtest " + os.path.join(root, "pkgtest.inconclusive.test.py"))
	tests.assertOn(tests.hasOutput("?????? A inconclusive test"))
Esempio n. 23
0
def canReadout():
    tests.out("command|conf test.setting=34")
    tests.out("command|conf read test.setting")
    tests.assertOn(tests.hasOutput("34"))
Esempio n. 24
0
def canRemoveGlobalSetting():
    tests.out("command|conf test.globalremovedsetting=34 -g")
    tests.out("command|conf test.globalremovedsetting -g -d")
    tests.out("command|conf read -g")
    tests.assertOn(tests.hasOutput("test.globalremovedsetting=34") == False)
def canRemoveGlobalSetting():
    tests.out("command|conf test.globalremovedsetting=34 -g")
    tests.out("command|conf test.globalremovedsetting -g -d")
    tests.out("command|conf read -g")
    tests.assertOn(tests.hasOutput("test.globalremovedsetting=34") == False)
def canRemoveSetting():
    tests.out("command|conf test.removedsetting=34")
    tests.out("command|conf test.removedsetting -d")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.removedsetting=34") == False)
def canReadout():
    tests.out("command|conf test.setting=34")
    tests.out("command|conf read test.setting")
    tests.assertOn(tests.hasOutput("34"))
def canRemoveFromSetting():
    tests.out("command|conf test.reducedsetting=hei,men,ja")
    tests.out("command|conf test.reducedsetting-=men")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.reducedsetting=hei,ja"))
def canFindLocalCfgFile():
    cfgfile = os.path.join(os.path.join(sys.argv[1], ".OpenIDE"), "oi.config")
    tests.out("command|conf read cfgfile")
    tests.assertOn(tests.hasOutput(cfgfile))
def canCreateLocalProfile():
    tests.out("command|profile init new-local-profile")
    tests.out("command|profile load new-local-profile")
    tests.out("command|profile list")
    tests.assertOn(tests.hasOutput("Active local profile:  new-local-profile"))
def canReadRootPoint():
    root = sys.argv[1]
    tests.out("command|conf read rootpoint")
    tests.assertOn(tests.hasOutput(root))
Esempio n. 32
0
def canReadGlobalCfgPoint():
    cfgfile = os.path.join(tests.get("applocation"), ".OpenIDE")
    tests.out("command|conf read cfgpoint -g")
    tests.assertOn(tests.hasOutput(cfgfile))
def canAppendToSetting():
    tests.out("command|conf test.appendsetting=hei")
    tests.out("command|conf test.appendsetting+=ja")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.appendsetting=hei,ja"))
Esempio n. 34
0
def canRemoveFromSetting():
    tests.out("command|conf test.reducedsetting=hei,men,ja")
    tests.out("command|conf test.reducedsetting-=men")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.reducedsetting=hei,ja"))
Esempio n. 35
0
def canRemoveSetting():
    tests.out("command|conf test.removedsetting=34")
    tests.out("command|conf test.removedsetting -d")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.removedsetting=34") == False)
Esempio n. 36
0
def canAssertOnEvents():
    file = os.path.join(sys.argv[1], "bleh.txt")
    tests.out("command|touch bleh.txt")
    tests.out("command|conf read test.setting")
    event = "'codemodel' 'raw-filesystem-change-filecreated' '" + file + "'"
    tests.assertOn(tests.hasEvent(event))
Esempio n. 37
0
def canAppendToSetting():
    tests.out("command|conf test.appendsetting=hei")
    tests.out("command|conf test.appendsetting+=ja")
    tests.out("command|conf read")
    tests.assertOn(tests.hasOutput("test.appendsetting=hei,ja"))
def canCreateLocalProfile():
    tests.out("command|profile init new-local-profile")
    tests.out("command|profile load new-local-profile")
    tests.out("command|profile list")
    tests.assertOn(tests.hasOutput("Active local profile:  new-local-profile"))